Repository navigation
feat(acp): ACP client — external agents as first-class agent ids (Track 62) - #8
Merged
Merged
Conversation
Merged
4 of 5 tasks
stpinkie
force-pushed
the
devin/track-61-acp
branch
from
September 15, 2026 08:18
c42afaf to
40a6a0e
Compare
…ck 62)
agents.list[].acp = {command, args, env, cwd} binds an external ACP agent
(gemini --acp, claude-code acp, ...) to a routable Rhizome agent id.
- pkg/acp/client.go: ClientManager lazily spawns the child process
(exec.Command, trust posture documented), handshakes initialize with
fs:{readTextFile,writeTextFile} + terminal:false, runs session/new +
session/prompt per delegation and accumulates session/update text.
Processes are reused across delegations, respawned on dead connections,
and terminated via services.ACPManager on gateway shutdown.
- pkg/acp/client_handler.go: acpsdk.Client impl — fs/read_text_file and
fs/write_text_file served through the workspace sandbox
(restrict_to_workspace + tools.allow_*_paths via new exported
toolfs.CompilePatterns, 64KiB read cap); terminal/* refused; external
session/request_permission answered by acp.client.permission_policy =
deny (default) | allow-read-only | allow; writeTextFile unadvertised and
refused under allow-read-only; advertised authMethods -> clear error.
- pkg/acp/spawner.go: Spawner (tools.SubTurnSpawner) sits between
RemoteSpawner and the local AgentLoopSpawner so ACP-bound ids dispatch
to the external process while hasLocal keeps them on-box; installed
directly when mesh is off.
- ExternalAgentRunner seam on AgentLoop (SetExternalAgentRunner):
ProcessRemoteDispatch bypasses the spawner chain, so remote peers
delegating into ACP-bound ids resolve to ClientManager.RunRemote there.
- AgentConfig.ACP -> AgentInstance.ACP; manifests advertise ACP-bound ids
like locals automatically.
- pkg/tools/acp_run.go: acp_run tool (explicit one-off invocation escape
hatch) via tools.ACPInvoker — SDK stays out of pkg/tools; registered
only when the gateway installs the invoker.
- Registry resolved lazily (func() *AgentRegistry) in manager + spawner —
config reload swaps the registry pointer.
Tests: io.Pipe mock agent over the real SDK transport (streaming, stop
reasons, per-policy permission outcomes, fs sandbox allow/deny, process
reuse) plus a real-process E2E via TestHelperProcess re-exec through
spawn(). docs/guides/acp.md gains the client section; design doc synced.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
stpinkie
force-pushed
the
devin/track-62-acp-client
branch
from
September 15, 2026 08:18
e77fd10 to
1a6b36e
Compare
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.
Summary
agents.list[].acp = {command, args, env, cwd}binds an external ACP agent (gemini --acp,claude-code acp, …) as a routable Rhizome agent id —delegate/subagent/spawn/network route/mesh delegation all reach it.pkg/acp.ClientManagerlazily spawns the child (plainexec.Command, documented trust posture), handshakesinitialize(fs:{read,write}+terminal:false),session/new+session/promptper delegation, accumulatessession/updatetext; process reuse + respawn on dead conn +services.ACPManagershutdown.acp.Spawnerslots betweenRemoteSpawnerand localAgentLoopSpawner—hasLocalkeeps ACP ids on-box; installed directly when mesh is off.ExternalAgentRunnerseam on the loop closes theProcessRemoteDispatchbypass — remote peers delegating into ACP ids hit the client, not local inference.fs/*requests served through the workspace sandbox (restrict_to_workspace+allow_*_paths);acp.client.permission_policy=deny(default) |allow-read-only|allow;terminal/*refused;authMethods→ clear error.acp_runtool viatools.ACPInvoker— SDK stays insidepkg/acp.Test plan
go test ./pkg/acp— 24 tests: io.Pipe mock over real SDK transport + real-process E2E (test binary re-exec'd as a mock ACP agent through the actualspawn()path)go test ./pkg/agent ./pkg/tools ./pkg/tools/fs ./pkg/gateway ./cmd/rhizome— greengolangci-lint run --build-tags goolm,stdjson— 0 issuesGenerated with Devin