This repository was archived by the owner on Jul 6, 2026. It is now read-only.
feat(agent): drive Claude Code over ACP with a Claude subscription#13
Draft
sontek wants to merge 2 commits into
Draft
feat(agent): drive Claude Code over ACP with a Claude subscription#13sontek wants to merge 2 commits into
sontek wants to merge 2 commits into
Conversation
Add an opt-in agent backend that routes prompts through the official Claude Code CLI via its ACP server adapter, so prompts run on a user's Claude subscription instead of the built-in API-key agent. Select it with DISCOBOT_AGENT_BACKEND=claude-code-acp; the server passes that flag and CLAUDE_CODE_OAUTH_TOKEN into the sandbox so the CLI authenticates itself. Also close three gaps in the ACP adapter that blocked real turns: - spawn the CLI with a bounded handshake timeout and surface its stderr, so a stalled start falls back to the default agent instead of wedging agent-api startup - send session/new with an empty mcpServers array; strict ACP servers reject a null value - carry a messageId on the start chunk and map the ACP stop reason onto Discobot's finishReason enum, which the UI stream schema validates strictly (an unmapped value showed an error block and hung the turn)
Add a SANDBOX_DNS setting that sets the DNS servers on sandbox containers. Needed when the host resolver isn't reachable from the sandbox VM's network (for example a host running DNS on a loopback address that the VM gateway can't forward to), where the container otherwise can't resolve any names.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Add an opt-in agent backend that runs the official Claude Code CLI over ACP, so prompts execute on the user's Claude subscription instead of the built-in API-key agent. Enable it with
DISCOBOT_AGENT_BACKEND=claude-code-acp; the server forwards that flag and the subscription token into the sandbox, and the CLI authenticates itself. Discobot never holds the subscription token at the API layer, which keeps this on the sanctioned first-party path rather than a third-party app reusing a subscription.Discobot already had an ACP client and Claude Code ships an ACP server, so the wiring itself was small. Getting real turns to complete also meant closing a few gaps in the existing ACP adapter: a bounded startup so a stalled handshake falls back instead of hanging, the empty (not null) mcpServers value that strict ACP servers require, and translating ACP's start and stop signals into the shapes the UI stream schema expects.
A second commit adds an optional
SANDBOX_DNSsetting to point sandbox containers at specific resolvers. It's needed on hosts whose DNS runs on a loopback address the sandbox VM can't reach.