feat(msb): derive default sandbox-template image from agent token - #409
Open
mogul wants to merge 1 commit into
Open
feat(msb): derive default sandbox-template image from agent token#409mogul wants to merge 1 commit into
mogul wants to merge 1 commit into
Conversation
When no explicit image override is set, the msb backend now derives the sbx agent-template image name from the requested agent (docker.io/docker/sandbox-templates:<agent>-docker), matching how `sbx run <agent>` selects its template, and falls back to shell-docker only if the derived image is not found. This shortens startup for agents like opencode whose template bakes in the binary. Fallback is conservative and live-verified against msb: it triggers only on registry not-found errors (manifest unknown) for an agent-derived image, never on auth/network failures or explicit image overrides. As the enabling cleanup, single-source the known-agent list into acq.backends/agents.sh (shared by both adapters) so adding an agent no longer means editing duplicated KNOWN_AGENTS lists and parallel case statements. A new bats suite enforces catalog/adapter parity. prime-agent is intentionally not added here. Refs: #404 Refs: #377 Co-authored-by: OpenCode [claude_4_8_opus] <bret.mogilefsky@gsa.gov>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
AI-assisted change.
When
acqprovisions through the msb backend and the user does not set an image, msb always useddocker.io/docker/sandbox-templates:shell-docker. That differs from sbx, wheresbx run opencode .usesdocker.io/docker/sandbox-templates:opencode-docker— which bakes in the agent binary and significantly shortens startup. This PR brings the msb path to parity.Fixes #404. Also does the enabling cleanup from #377 (single-sourcing the agent list).
prime-agentis not added here.What changed
docker.io/docker/sandbox-templates:<agent>-dockerfor known agents (shell→shell-docker), matching sbx's template naming. Precedence:ACQ_MSB_IMAGE>--image/ACQ_IMAGE> agent-derived default >shell-dockerfallback.msb createfailure, msb retries once withshell-dockeronly when the image was agent-derived, the error is registry not-found, and no sandbox was created. Auth/network failures and explicit image overrides never fall back silently. The not-found classifier was live-verified against msb (Docker Hub + ghcr.io both returnmanifest unknown).acq.backends/agents.shholdsACQ_KNOWN_AGENTS,acq_is_known_agent,acq_agent_template_image, and the msb install-recipe check. Both adapters source it; the duplicatedKNOWN_AGENTSdefinitions and parallelis_known_agentcase statements are removed. Newtest/bats/36-agent-catalog.batsenforces catalog/adapter parity and that the list lives only in the shared file.BACKEND_GUIDE.md, ADR-0022, ADR-0011 updated for the derived default + fallback;howto/msb.mdandhowto/sbx.mdagent lists corrected and pointed atagents.sh.Verification
Live msb probe (host with a sandbox-capable runtime), confirming the classifier wording:
Rollback
Revert this commit; no state migration. Behavior returns to always using
shell-dockeron msb.Security impact
None. No change to auth, secrets, or egress. The image name is derived from a charset-validated known-agent token; unknown/unsafe tokens fall back to
shell-docker. Explicit-image failures are never masked.