fix: honor per-role command/platform/model when spawning through AgentRuntime#250
Merged
windoliver merged 1 commit intomainfrom Apr 14, 2026
Merged
Conversation
…tRuntime Closes #207. Topology roles and agent profiles define command, platform, and model fields but the runtime ignored them — every agent spawned on the constructor-level default backend. Interface changes: - AgentConfig: add platform?, model? fields - AgentSession: add platform?, model?, agent? metadata - SessionConfig: accept optional AgentProfile[] for overlay Runtime changes (AcpxRuntime): - resolveAgent(): platform → command parsing → constructor default - PLATFORM_TO_AGENT mapping (claude-code→claude, codex→codex, etc.) - Cached isAvailable() (no execSync per spawn) - Write streams instead of appendFileSync in data path - Multi-agent listSessions() + discoverSessions() for reattach - Session metadata preserved through spawn and reattach - GROVE_AGENT_PLATFORM/MODEL env vars exported Orchestrator changes: - mergeRuntimeConfig(): profile > role > default (pure function) - Passes platform, model, goal from topology roles - Uses role.goal in goal composition TUI changes: - screen-manager: passes role.platform/model to spawn context; skips stale platform when user overrides CLI in launch preview - spawn-manager: prompt no longer embedded in command string (security); uses composed initialPrompt as goal (not bare session goal) - app.tsx: advanced palette passes platform/model/goal to context DRY: shellEscape extracted to shared shell-utils.ts Tests: 97 targeted tests (0 fail), 4996 full suite (1 pre-existing). Live validation: codex + claude sessions spawn on distinct backends, metadata survives reattach, discoverSessions finds both.
5405fe6 to
ad9b0f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #207.
platform,model,agentfieldsplatform → command → defaultchain; cachesisAvailable(); multi-agentlistSessions()+discoverSessions()for reattach; write streams replaceappendFileSyncmergeRuntimeConfig(); passesplatform,model,goalfrom topologyplatform/modelto spawn context; prompt no longer embedded in command string (shell injection fix); launch-preview override respectedshellEscapeextracted toshell-utils.tsGROVE_AGENT_PLATFORM/GROVE_AGENT_MODELenv varsLive validation
Test plan