Skip to content

feat(agents): add OpenCode as a native ACP runtime#2370

Open
leesalminen wants to merge 1 commit into
block:mainfrom
leesalminen:feat/opencode-acp-runtime
Open

feat(agents): add OpenCode as a native ACP runtime#2370
leesalminen wants to merge 1 commit into
block:mainfrom
leesalminen:feat/opencode-acp-runtime

Conversation

@leesalminen

Copy link
Copy Markdown

Summary

Closes #2368.

  • Registers OpenCode in Buzz's managed ACP runtime catalog (id: opencode) so Desktop can discover and spawn it like Goose/Claude/Codex.
  • Uses OpenCode's native ACP entrypoint (opencode acp) — no separate *-acp npm adapter.
  • Adds a config bridge for ~/.config/opencode/opencode.json (model, provider from the provider/model string, MCP servers with enabled flags), ~/.opencode/bin binary discovery, process-sweep name opencode, docs, and unit tests.

Why

OpenCode already speaks ACP over stdio (opencode acp). Users currently cannot select it as a first-class Buzz harness without a custom command. This mirrors the Grok Build (#2344) and Kimi Code (#2365) runtime registration pattern. OpenCode's provider-agnostic catalog (Anthropic, OpenAI, OpenRouter, local Ollama/vLLM) surfaces through the existing ACP configOptions model discovery unchanged.

What changed

Area Change
KNOWN_ACP_RUNTIMES New OpenCode entry (CLI-login runtime, opencode auth login hint)
Default args acp — in both desktop discovery and buzz-acp arg normalization
Config bridge ~/.config/opencode/opencode.json → model / provider / MCP servers ($OPENCODE_CONFIG override honored)
PATH Discovers ~/.opencode/bin
Persona UI opencode classified as CLI-login / provider-locked, like claude/codex
Process sweep opencode added to KNOWN_AGENT_BINARIES
Docs README / TESTING / buzz-acp README
Tests discovery avatar + arg normalization (desktop + buzz-acp), config bridge parsing, persona UI capability

Validation

  • just ci — all recipes green (fmt, clippy, desktop lint + tests + build, tauri check + tests, web build, mobile tests) except one pre-existing buzz-db unit-test failure that reproduces identically on a clean main checkout on Linux — filed as test(buzz-db): replica_fence unit test fails on Linux due to sub-microsecond Utc::now() precision #2369, unrelated to this change
  • cargo test -p buzz-acp --lib normalizes_ — 6 passed (incl. OpenCode)
  • cargo test --manifest-path desktop/src-tauri/Cargo.toml managed_agents — passed
  • Live ACP handshake: BUZZ_ACP_AGENT_COMMAND=opencode BUZZ_ACP_AGENT_ARGS=acp buzz-acp models --json returns the full model list (configOptions, category model) in ~3s
  • Manual dev launch (just desktop-standalone): OpenCode detected from PATH, agent created with runtime=OpenCode, live model picker populated via ACP discovery against a local relay

How to try

curl -fsSL https://opencode.ai/install | bash
opencode auth login

export BUZZ_PRIVATE_KEY=nsec1...
export BUZZ_RELAY_URL=wss://your-relay
export BUZZ_ACP_AGENT_COMMAND=opencode
buzz-acp

Then @mention the agent from Buzz Desktop (owner-only by default).

Checklist

  • New behavior has tests
  • User-facing setup is documented
  • No new unwrap() in production code
  • No unsafe code

🤖 Generated with Claude Code

@leesalminen
leesalminen requested a review from a team as a code owner July 22, 2026 14:12
Registers OpenCode in the managed ACP runtime catalog so Desktop can
discover and spawn it like Goose/Claude/Codex. Uses OpenCode's native
ACP entrypoint (opencode acp) — no separate *-acp npm adapter.

- KNOWN_ACP_RUNTIMES entry (id: opencode), CLI-login runtime,
  provider-locked in the persona UI like claude/codex
- config bridge for ~/.config/opencode/opencode.json: model, provider
  (from the provider/model string), MCP servers with enabled flags
- ~/.opencode/bin added to binary discovery; process-sweep name
- buzz-acp default-arg normalization: opencode → acp
- docs: README / TESTING / buzz-acp README
- unit tests: discovery, arg normalization (desktop + buzz-acp),
  config bridge, persona UI capability

Closes block#2368

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Lee Salminen <leesalminen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(agents): add OpenCode as a first-class ACP runtime

1 participant