Visitar URL original
[Bug] acq run opencode fails on sbx: duplicate kit name "opencode" blocks sandbox create · Issue #593 · GSA-TTS/agentic-coding-quickstart · GitHub
Skip to content

[Bug] acq run opencode fails on sbx: duplicate kit name "opencode" blocks sandbox create #593

Open

Description

@wz-gsa

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: sbx only. msb does not synthesize native agent kits from the agent token, so the msb path is unaffected.
  • Trigger: the pinned patterns OpenCode agent kit being active, which is the default on current bundles.
  • Visibility: limited because msb is now the default backend. Users still pinned to sbx hit 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 shell only as SBX's template-selection token for the generic default, preventing SBX from synthesizing a duplicate native opencode kit.

#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 the sbx backend with the pinned OpenCode agent kit active.
  • Exactly one kit named opencode reaches the sbx create composition.
  • Regression coverage asserts the create argv does not contain both an explicit pinned opencode kit and an agent token that causes sbx to synthesize a second one.
  • The msb path is unchanged.
  • Non-OpenCode agents on sbx are unchanged.

Activity

  1. wz-gsa commented on Oct 20, 2026

    @wz-gsa
    ContributorAuthor

    Cross-reference: the token-rewrite portion of #584 fixes this. That PR is currently CHANGES_REQUESTED for three Major findings in its launch-mode record logic (sbx.sh:603-610 destructive 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 sbx backend are unblocked without waiting on the rest of #584's review cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions