Repository navigation
Conversation
Add a first-class 'acq acp' subcommand (ADR-0040) that launches a sandboxed coding agent's Agent Client Protocol (ACP) server over bidirectional stdio without allocating a PTY: - Route all prologue output (backend resolution, prepare, create-or-heal, and credential validation) to stderr with stdin bound to /dev/null and ACQ_NO_PROMPT=1 / ACQ_UPDATE_CHECK=0 enforced so stdout stays reserved for JSON-RPC 2.0 frames. - Pass '--stream' to 'msb exec' and '-i' to 'sbx exec' when ACQ_SESSION_KIND=acp so bidirectional JSON-RPC lines stream without waiting for stdin EOF or allocating a PTY. - Fast-path already-running sandboxes on the current kit bundle so IDE reconnects skip redundant remote kit fetches. - Add ADR-0040, how-to documentation for Zed agent_servers, KFM #53, and offline Bats unit coverage. Co-authored-by: OpenCode [gemini-4-argon] <John.Jediny@gsa.gov>
Contributor
|
@JJediny this is an interesting idea! I wish you'd talked to us about it first though... We're about to land a major Python rewrite of acq, and we don't want to integrate this before we do that. Are you game to make another run at this once the Python version is in place? |
Member
Author
|
@mogul sure just point me at the branch to work off a porting to python |
This was referenced Nov 13, 2026
Member
Author
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
Desktop IDEs and multi-agent orchestrators (such as Zed via
agent_servers) communicate with coding agents over the Agent Client Protocol (ACP) (https://agentclientprotocol.com/): newline-delimited JSON-RPC 2.0 overstdio. Whileopencode(opencode acp) andgoose(goose acp) implement ACP natively, connecting a host IDE directly to a sandboxed agent previously had three obstacles:acq runallocates a PTY (msb exec -t/sbx run), which translates\nto\r\nand emits terminal control sequences that corrupt JSON-RPC framing.stdout(fd 1) or read from the IDE'sstdin(fd 0) pipe, and interactive terminal pickers must not block on a headless JSON-RPC pipe.msb(microsandbox), a plainmsb execbuffers or waits forstdinEOFbefore completing non-interactive I/O;msb exec --stream(andsbx exec -iwithout-t) is required for real-time bidirectional JSON-RPC line streaming while the IDE holdsstdinopen.Plan & Changes (ADR-0040)
docs/adr/0040-acp-standard-agent-interface.md: Record the architectural decision to exposeacq acpasacq's standard programmatic agent interface alongside interactiveacq run(PTY) and one-shotacq exec.acq.backends/agents.sh&acq.backends/common.sh:acq_agent_kit_acp_entrypoint(resolving known coding agents and rejectingshell).acq_build_acp_argv(mappingopencodetoopencode acpwith working directory set byacq_backend_run's-w "$ws", honoring post---flags and custom ACP server overrides).acpinacq_session_is_user.acq.backends/msb.sh&acq.backends/sbx.sh:--streamtomsb execand-itosbx execwhenACQ_SESSION_KIND=acpfor byte-faithful bidirectional streaming without a PTY.acq:acq acp [AGENT] [PATH ...] [-- ACP_ARGS...]andacq acp SANDBOX_NAME [-- ACP_ARGS...].</dev/null >&2,ACQ_NO_PROMPT=1, andACQ_UPDATE_CHECK=0.currentso IDE reconnects skip redundant remote kit fetches.acq acp, Zedagent_serverssetup, and session persistence indocs/howto/acq.md,docs/BACKEND_GUIDE.md, anddocs/KNOWN_FAILURE_MODES.md(docs: deprecate Docker Desktopdocker sandboxin favor of sbx CLI #53).test/bats/30-dispatch-routing.bats,test/bats/36-agent-catalog.bats, andtest/bats/60-help.bats.Verification Transcript
1. Offline Bash 3.2 Syntax & Bats Unit Suite
2. Live End-to-End Verification (Zed +
msbv0.7.7 + OpenCode v2.0.30)Verified both via open-pipe bidirectional JSON-RPC (
initialize->session/newin 1.62s / 3.02s) and live inside Zed (agent_servers.opencode-acq), confirming the agent runs inside themsbmicroVM (uid=1000(agent),/var/lib/acq/host:ro,/var/lib/acq/provider-input/generation.*:ro, workspace mountedrw).Rollback
Revert the squash-merge commit on
main.acq acpis an additive subcommand; existingacq run,acq create, andacq execflows are unchanged.Security Impact
SC-7,AC-6): The host IDE communicates overstdiopipes viamsb exec --stream/sbx exec -i; no TCP ports are opened on the host, and provider/GitHub credentials remain bound to the sandbox wire injector.SI-7, ADR-0035): Preserves read-only/var/lib/acq/hostand/var/lib/acq/provider-inputmounts.gemini-4-argon), reviewed and verified live.