Repository navigation
fix(acp): resolve preset launch args by command when no runtime id is set - #8584
sunshine-sutingjun wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🔐 Codex Security Review
|
… set An agent with a known ACP runtime command but no `runtime` id and no instance args (e.g. `preferred_runtime: "omp"`, or a command-only `agent_command_override`) spawned the bare command. ACP-native CLIs then start their interactive TUI instead of their ACP/stdio mode; under headless Buzz there is no controlling TTY, so ACP `initialize` never answers and every pool worker dies with "Request timeout — agent did not respond within 60s" (`omp`, `opencode`, `kimi`, `cursor-agent`, `devin`) or ENXIO (grok). `resolve_effective_harness_descriptor` only consulted `PRESET_HARNESSES` through a resolvable runtime id, so the preset's args were dropped exactly when the record carried none. Fall back to a command-keyed lookup (`preset_args_for_command`) before giving up and using the empty instance args. The lookup matches through the existing `normalize_command_identity`, so a bare name, an absolute path (`/opt/homebrew/bin/omp`, what the runtime log actually shows) and a Windows `.exe` all resolve to the same preset. `PRESET_HARNESSES` stays the single source of truth. Refs block#3457 Signed-off-by: sunshine-sutingjun <[email protected]>
eefac88 to
bfc7cdb
Compare
joahg
left a comment
There was a problem hiding this comment.
🤖 Checked the new by-command preset lookup against normalize_command_identity and the resolution order in readiness.rs; explicit args and runtime-id definitions still win. Looks right.
Summary
An agent with a known ACP runtime command but no
runtimeid and no instance args is spawned as the bare command, so ACP-native CLIs start their interactive TUI instead of their ACP/stdio mode. Under headless Buzz there is no controlling TTY, so the JSON-RPCinitializehandshake never answers and every pool worker dies with:This is reachable from the shipped app without any manual editing: set
preferred_runtime: "omp"inglobal-agent-config.json, start the Welcome Team agents, and the runtime log showsSame class as #3457 (Grok) and #3660 (OpenCode);
omp,opencode,kimi,cursor-agent,devinall hit the 60 sinitializetimeout, Grok hitsENXIO.Root cause
resolve_effective_harness_descriptor(managed_agents/readiness.rs) resolves launch args from:record.agent_args, elserecord.runtime→ persona runtime →lookup_loaded_harness_by_id, elsenormalize_agent_args(command, record_args).A command-only pin satisfies neither 1 nor 2, so
descriptor.argsstays empty even thoughPRESET_HARNESSESalready carries the correct args for that command. The args exist; they are just never consulted on this path.Fix
Look the preset up by command when no runtime id resolved a definition:
preset_args_for_commandmatches through the existingnormalize_command_identity, so a bare name, an absolute path (/opt/homebrew/bin/omp— what the runtime log actually shows) and a Windows.exeall resolve to the same preset.PRESET_HARNESSESstays the single source of truth; nothing is mirrored.descriptor.argsflows toBUZZ_ACP_AGENT_ARGS, the config hash and the agent summary, so this fixes spawn, the dashboard and cache keys in one place.Tests
presets::tests::preset_args_for_command_matches_bare_and_absolute_commandscovers:ompand/opt/homebrew/bin/omp→["acp"]C:\tools\omp.exe→["acp"]grok→["agent", "--always-approve", "stdio"]amp-acp(no preset args) →[], unknown command →NoneNotes
0600, resolved-launch marker); this PR is only the args fallback.agent_argsstill win.agent_cmd=/Users/…/.buzz/bin/omp-acp(wrapper) oromp acp,agent initializedreturns in ~120 ms, and the harness connects to the relay.Refs #3457