feat(acp): add opencode as a selectable ACP backend - #9013
Conversation
82114e6 to
041d037
Compare
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/acp_backends.py:130 -- selectable OpenCode sessions skip fail-closed permission routing
Adjudication (Opus 4.8) — is blocking on each finding proportionate?I have enough to rule. Let me confirm the enforcement flow once more: This is a fenced, annotate-only finding. My verdict set is {UPHOLD-FENCED, FLAG}. Harm rung: UNBOUNDED (security-class — governance ceiling / denied-command / sensitive-path bypass). Conditions confirmed: opencode is baseline-selectable on a plain public build (acp_backends.py BASELINE_SELECTABLE_BACKENDS, diff:415-424); FLAG requires a rarity argument that the reaching conditions are extreme. They are not: selecting a baseline-selectable backend and letting its agent run a tool is the ordinary operating path, not a contradictory-timing or unproducible-input corner. I cannot complete the rarity record, and this is exactly the class where a wrong clearance is unrecoverable — so UPHOLD-FENCED. [ADJUDICATION] b640e3d total=0 uphold=0 downgrade=0 |
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS "Chat-only" scopes Crew's tools, not opencode's — its self-approving built-ins ship with no gate, no credential mask, and no sandbox-floor refusal. Watch
Suggestions
[DESIGN-REVIEWED] b640e3d |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS A clean, data-driven backend addition that follows the codex template, but ships a dormant What this change shipsIntent: let users point agent sessions at their installed
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] b640e3d |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsBoth candidates rest on opencode's ACP wire behavior, which cannot be verified from this repository. Let me confirm the key facts I've established before concluding. I've verified the load-bearing code paths: Candidate 1 (opencode ships with no credential mask / no gate routing): Grounded facts — opencode's routing is Candidate 2 (warm-pool Neither survives falsification, and I found no grounded 80+ defect to add. No findings. [OPUS-REVIEWED] b640e3d |
Register `opencode` in the baseline selectable backend registry and add its spawn arm (stdio JSON-RPC via `opencode acp`), install probe, session lifecycle with capability gating, and content serialization, mirroring the codex backend template. v1 scope: chat-only (no per-session MCP array), no steer/compaction, no model-via-config; unsupported capability calls fail fast with explicit errors so existing backends are unaffected. Adds twin tests (test_acp_opencode_backend.py, 29 tests) and updates the agent-host-contract and acp-client docs.
041d037 to
b640e3d
Compare
Problem / Motivation
Kiro Crew currently supports
{kiro, claude, kas, codex}as selectable ACP backends. Users who run opencode have no way to point agent sessions at it: the backend registry, spawn arms, install probes, and capability sets are closed over the existing four ids, soopencodenever appears under Developer → Agent Backend even when the binary is installed.Why it matters
opencode ships an ACP-compatible stdio agent (
opencode acp) with session fork/list/resume and image support. Without an adapter, users standardizing on opencode cannot use Kiro Crew as their dashboard/orchestration layer for it, and must keep a separate client open for those sessions.What changed (motivation → approach → change)
Goal: make
opencodea first-class selectable backend with the smallest possible surface change.Approach: follow the codex backend template (PR #7963) rather than a new integration path, because the current main has refactored backend registration into a leaf module with capability membership sets — a new backend is now mostly data, not branches:
acp_backends.py: addedACP_BACKEND_OPENCODEto the known/baseline-selectable/policy sets; deliberately not added toACP_BACKENDS_SESSION_MCP_ARRAY, steer, compaction, model-selection, member-dispatch, or seed-local-settings sets (v1 is chat-only — per-sessionmcpServerssupport on opencode is unproven, and joining silently would drop Crew tools with no error).acp/client.py:_resolve_opencode_acp_bin()(OPENCODE_ACP_BINenv → mise → PATH), spawn arm[opencode, "acp"],_is_opencodehelper.agent_sdk/backend_install.py:_probe_opencode()registered in_PROBES(reportsopencode auth loginas a user-side prerequisite).opencode acpprobe (v1.18.x).Tests
New
test/test_acp_opencode_backend.py(29 tests) mirrors the codex twins: registry snapshot/invariants across the 14 capability sets, spawn-resolution order, probe state, capability gating fail-fast behavior, serialization, and member-dispatch exclusion. Existing kas / editable-backend / backend-install / harness-parity tests updated where they enumerate backends.Local validation: twin suite 29/29; targeted run across the 18 touched test files = 1,210 passed; mypy + flake8 clean on touched files.
Manual verification
Live E2E against a real gateway booted from this branch (isolated
KIROCREW_HOME, port 5588), full round completed:opencode (Experimental); selecting it persists as the session backend (acp_backend=opencodein the instance config).opencode acp, and the reply rendered in the dashboard. Tools used in the session were opencode's own built-ins, matching the v1 chat-only scope (no per-session MCP array).Screenshots / video
Developer → Agent Backend on the test gateway, with
opencodepresent and selected:A real prompt answered in chat through the opencode adapter:
Related Issues
N/A — no tracking issue yet.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)