fix(acp): opencode preset missing 'acp' arg causes agent timeout
Problem
The OpenCode preset harness in presets.rs defines args: &[], but the install hint correctly states "Buzz talks to OpenCode through its CLI's ACP mode (opencode acp)".
Without the acp argument, opencode starts in TUI mode and never responds to the ACP JSON-RPC handshake, causing buzz-acp to timeout after 60 seconds with "agent initialize failed: Request timeout".
This affects every user who selects OpenCode as their agent runtime.
Steps to reproduce
- Install opencode CLI (
npm install -g opencode-ai) - Open Buzz Desktop, complete onboarding
- Select OpenCode as agent runtime
- @mention any agent
- Agent appears "online" but never responds
Root cause
desktop/src-tauri/src/managed_agents/discovery/presets.rs line ~173:
// Current (broken)
PresetHarness {
id: "opencode",
label: "OpenCode",
command: "opencode",
args: &[], // ← missing "acp"
install_hint: "...through its CLI's ACP mode (opencode acp).",
...
},
Fix
args: &["acp"],
All other presets that need an explicit ACP mode flag already carry it:
- devin:
args: &["acp"]✓ - cursor:
args: &["acp"]✓ - omp:
args: &["acp"]✓ - kimi:
args: &["acp"]✓ - openclaw:
args: &["acp"]✓ - opencode:
args: &[]✗ ← this issue
Tested
Verified locally by editing managed-agents.json to set agent_args: ["acp"]. All three default agents (Fizz, Honey, Pollen) initialize successfully and respond to @mentions. Without the fix, all agents timeout consistently.
I tried to confirm the root cause and the preset looks different from the report — worth checking before anyone patches presets.rs.
On c3132c3ee, desktop/src-tauri/src/managed_agents/discovery/presets.rs:133 already reads:
args: &["acp"],
And git log -S says it was never anything else. The preset was born with acp:
95fdf9788—feat(acp): bring your own harness (BYOH) … (#2773), the commit that introduces the opencode preset:args: &["acp"]1b3ff96a5—Add Devin as a preset ACP harness (#3225), which moved the block intopresets.rsunchanged
The presets currently carrying args: &[] are amp, hermes, and amp-test — not opencode.
But the report also says editing managed-agents.json to agent_args: ["acp"] fixed it. If the preset already supplies acp and the persisted instance had empty args, then the defect isn't the preset constant — it's that the preset's args don't reach the persisted agent_args on the agent-creation path, or that a stale persisted value wins over the preset.
That would also explain why the symptom is real and reproducible while the quoted source line isn't.
Question for a maintainer: is that persistence path the actual bug here, and is it the same class as 0c33a8a55 (fix(agents): canonicalize stale persona harness pins (#4631))? If so this issue probably wants retitling toward the persistence seam, and I'm happy to dig further on that path.
@IMhao-123 — could you check what agent_args your managed-agents.json held before you edited it? Empty vs absent distinguishes the two paths.
Same symptom with the Cursor preset on Buzz Desktop v0.5.25 (latest, macOS arm64, cursor-agent 2026.09.26). The default team agents (Fizz, Honey, Pollen) all time out. This supports @PresentJay's read that the problem is the persisted record, not the preset constant.
Before any edits, the persisted records held an empty array, not a missing key, and had no runtime key:
"agent_command": "cursor-agent",
"agent_command_override": "cursor-agent",
"agent_args": [],
"acp_command": "buzz-acp"
buzz-acp gets BUZZ_ACP_AGENT_ARGS= (empty), which overrides its own [default: acp]. Bare cursor-agent then shows its interactive "Workspace Trust Required" prompt on the pipe:
buzz-acp starting: ... agent_cmd=~/.local/bin/cursor-agent mcp_cmd= ...
ERROR buzz_acp: agent initialize failed: Request timeout — agent did not respond within 60s agent=0
Piping the same initialize request into cursor-agent acp returns a valid response immediately.
Workarounds tried on v0.5.25 (Buzz quit while editing managed-agents.json):
"agent_args": ["acp"]alone does not work anymore. The value persisted, but the next spawn still loggedagent_cmd=…/cursor-agent mcp_cmd=and still hadBUZZ_ACP_AGENT_ARGS=empty in its environment.- Pointing
agent_command/agent_command_overrideat a wrapper script does not work either. Desktop still spawned plaincursor-agent. "runtime": "cursor"plus"agent_args": ["acp"]works, but only temporarily. It spawnedagent_cmd=…/cursor-agent acp, all 10 agents initialized,agent_pool_ready, connected, and presence went online. About 5 minutes later Desktop restarted the agent (auto_restart_on_config_change) and rewrote the record. For Fizz,runtimewas removed andagent_argsreset to[]. For Honey and Pollen,runtime: cursorwas kept butagent_argswas also reset to[]. Every spawn after that timed out again.
So on v0.5.25:
- the preset's
acpis not carried into the persisted record; - a saved
[]beats the preset at spawn; - Desktop resets hand-set args back to
[]when it rewrites the record.
This looks like the same class of bug as #4764; #4765 / #3905 seem to be the relevant fixes.
Separately, even with acp applied, these runs log mcp_cmd= empty, so I expect #7023 to block replies from Cursor preset agents as well.