Skip to content

Add ACP agents examples (TypeScript and Python) - #162

Open
max-sudolabs wants to merge 7 commits into
e2b-dev:mainfrom
max-sudolabs:int-155-acp-agents
Open

max-sudolabs wants to merge 7 commits into
e2b-dev:mainfrom
max-sudolabs:int-155-acp-agents

Conversation

@max-sudolabs

@max-sudolabs max-sudolabs commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

What this adds

examples/acp-agents-js and examples/acp-agents-python: one ACP client that drives OpenCode, goose or Claude Code inside an E2B sandbox, picked with AGENT=opencode|goose|claude.

  • AcpAgent.start() from @e2b/acp / e2b-acp starts the agent and connects the official ACP client (a client() app in JS) over its stdin/stdout. Only the template and the start command differ per agent.
  • The agent edits files and runs commands with its own tools in the sandbox; the client only answers permission requests (picks the allow_once option) and prints progress.
  • OpenCode's model is set with OPENCODE_CONFIG_CONTENT, so no config file is written.
  • The example re-runs the agent's fizzbuzz.py in the sandbox and checks for FizzBuzz.
  • Index row in README.md and both entries in tests/run-examples.ts.

Verification

All 6 combinations (JS/Python × OpenCode/goose/Claude Code) ran live against local builds of the packages and passed the FizzBuzz check.

If an agent offers no allow_once option, the example falls back to the first option.

Drive OpenCode, goose or Claude Code inside an E2B sandbox with the
official ACP client through sandbox.acp. One client for all agents; the
agent's tools run inside the sandbox.
Python twin of acp-agents-js using AsyncSandbox.acp with
agent-client-protocol.
Drop the per-agent config-file maps and the remote write loop; OpenCode
reads the same JSON from the environment.
connectAcpAgent / connect_acp_agent replace the hand-built transport.
The examples now fail if fizzbuzz.py in the sandbox does not print
FizzBuzz, and the READMEs state the exact tool boundary.
@max-sudolabs

Copy link
Copy Markdown
Collaborator Author

Depends on e2b-dev/E2B#1992: npm install / uv sync here need @e2b/acp 0.1.0, e2b-acp 0.1.0 and e2b 2.56.1 published. The pins already match that release, so nothing changes in this PR after it ships. To check after the release: both examples install from npm/PyPI, and the @e2b/acp link in examples/acp-agents-js/README.md resolves.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant