Repository navigation
[Bug] acq run opencode fails on sbx: duplicate kit name "opencode" blocks sandbox create #593
Description
Summary
acq run opencode <paths> fails at sbx create on the sbx backend whenever the pinned OpenCode agent kit is active. The sandbox is never created.
error: request failed: 400 Bad Request: kit_artifacts: compose: duplicate kit name "opencode" — each kit in a composition must have a unique name
Reported by a user on 2026-10-20 against quickstart main.
Root cause
Two independent mechanisms each contribute a kit named opencode to the same sbx create composition.
1. acq explicitly passes the pinned OpenCode agent kit. The patterns kit declares name: opencode and an agent: block with name: opencode / entrypoint: opencode. acq fetches it and forwards it via --kit:
acq: selected built-in agent kit: agent=opencode kit=opencode entrypoint=opencode install_owner=kit start_owner=kit apply=enabled
2. sbx synthesizes its own native opencode kit from the positional agent token. acq.backends/sbx.sh:561 forwards the user's opencode token through _stripped, and the image resolves to docker/sandbox-templates:opencode-docker. sbx builds a native kit for that agent variant on its own.
sbx then rejects the composition because both carry the same name. Current main has no mitigation: the pinned kit is passed as --kit alongside the positional opencode token, and nothing rewrites that token or suppresses the native kit.
Scope
- Backend:
sbxonly.msbdoes not synthesize native agent kits from the agent token, so themsbpath is unaffected. - Trigger: the pinned patterns OpenCode agent kit being active, which is the default on current bundles.
- Visibility: limited because
msbis now the default backend. Users still pinned tosbxhit this on their first OpenCode create.
Reproduction
On the sbx backend with a current kit bundle:
acq backend set sbx
acq run opencode <any-path>Create fails with the duplicate kit name "opencode" error above.
Workaround
Switch to the recommended default backend, which is unaffected:
acq backend set msb
acq run opencode <paths>Relationship to existing work
The token-rewrite portion of #584 fixes exactly this. That PR's own description states it:
Use
shellonly as SBX's template-selection token for the generic default, preventing SBX from synthesizing a duplicate nativeopencodekit.
#584 is currently CHANGES_REQUESTED for three unrelated Major findings in its launch-mode record logic, none of which touch the duplicate-kit fix. This issue exists so the user-facing break is tracked independently of that PR's review cycle, and so it does not get closed implicitly if #584 is restructured.
See also ADR-0030 for the generic-base direction this sits inside.
Acceptance criteria
-
acq run opencode <path>succeeds on thesbxbackend with the pinned OpenCode agent kit active. - Exactly one kit named
opencodereaches thesbx createcomposition. - Regression coverage asserts the create argv does not contain both an explicit pinned
opencodekit and an agent token that causes sbx to synthesize a second one. - The
msbpath is unchanged. - Non-OpenCode agents on
sbxare unchanged.
Activity
wz-gsa commentedon Oct 20, 2026
Cross-reference: the token-rewrite portion of #584 fixes this. That PR is currently
CHANGES_REQUESTEDfor three Major findings in its launch-mode record logic (sbx.sh:603-610destructive pre-create clear, orphaned sandbox on launch-mode write failure, and the best-effort-provenance/fail-closed-mode asymmetry) — none of which touch the duplicate-kit fix.Worth considering whether the duplicate-kit fix can be split out as a minimal standalone change so users on the
sbxbackend are unblocked without waiting on the rest of #584's review cycle.