You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
@@ -30,11 +30,14 @@ system (first tenant: the Helios Ethereum light node), Agent Client Protocol
- [x] Verified: unit tests (`pkg/acp` fake runner/conn + real `EventBus`), and a real stdio smoke — `initialize`/`session/new`/`session/prompt` against a fake SSE OpenAI endpoint produced three `agent_message_chunk` notifications + `stopReason:"end_turn"` with a clean stdout protocol stream.
- [ ] `pkg/acp` client: spawn per `agents.list[].acp = {command, args, env, cwd}`; `initialize` (clientCapabilities: `fs` read/write routed through `restrict_to_workspace` sandbox; `terminal` declared unsupported); `session/new` per delegation; `session/prompt` → collect `session/update` → final text; cancel on ctx done.
- [ ] `AgentConfig.ACP *ACPAgentConfig` binding; registry marks the id external; new `ACPSpawner` in the `SubTurnSpawner` chain routes ACP-bound ids *before* local dispatch — `hasLocal` stays true so `mesh.RemoteSpawner` never routes them off-box. `delegate`, `spawn`, `subagent`, `network route`, `swarm offer --require-agent` all work unchanged. **Also needed** (found in planning): remote peers delegate via `runFunc`→`agentLoop.ProcessRemoteDispatch`, which bypasses the spawner chain — add an `ExternalAgentRunner` seam on the loop so ACP-bound ids resolve to the ACP client there too.
- [ ] `acp_run` tool — explicit one-off invocation of a configured ACP agent (escape hatch).
- [ ] Manifests advertise ACP-bound agents like locals (peer-bound to the host); remote peers can delegate into them under existing ACL.
- [x] `pkg/acp/client.go` — `ClientManager` spawns per `agents.list[].acp = {command, args, env, cwd}` via plain `exec.Command` (documented trust posture: un-sandboxed child; safety = sandboxed fs bridge + permission policy). Lazy spawn, process reuse, respawn on dead conn, `Close()` on gateway shutdown (`services.ACPManager`). `initialize` advertises `fs:{readTextFile,writeTextFile}` + `terminal:false`; `session/new` per delegation (mcpServers must be `[]`, not nil — SDK validates); `session/prompt` → accumulate chunks → final text; ctx cancel → SDK sends `session/cancel`; `session/close` best-effort.
- [x] `pkg/acp/client_handler.go` — `acpsdk.Client` impl: `SessionUpdate` collects `agent_message_chunk`+`agent_thought_chunk` text; `fs/read_text_file`+`fs/write_text_file` served via `toolfs.ValidatePathWithAllowPaths` (new exported `CompilePatterns`) under `restrict_to_workspace` + allow_*_paths, 64 KiB read cap; `terminal/*` → method-not-found.
- [x] `AgentConfig.ACP *ACPAgentConfig` → `AgentInstance.ACP`; `acp.Spawner` (`tools.SubTurnSpawner`) inserted remote→**acp**→local in gateway.go — `hasLocal` stays true for ACP ids so `mesh.RemoteSpawner` never routes them off-box; also set as the loop's spawner when mesh is off. Prompt = `SubTurnConfig.SystemPrompt` + user `InitialMessages` (where delegate/subagent put the task).
- [x] `ExternalAgentRunner` seam (`AgentLoop.SetExternalAgentRunner`) intercepts `ProcessRemoteDispatch` for `inst.ACP != nil` — remote peers delegating into ACP ids hit the client instead of silently running local inference. Registry resolved lazily (`func() *AgentRegistry`) since reload swaps it.
- [x] `acp_run` tool (`pkg/tools/acp_run.go`) — `tools.ACPInvoker` interface keeps the SDK out of pkg/tools; registered only when `SetACPInvoker` was called (≥1 acp-bound agent).
- [x] Manifests advertise ACP-bound agents automatically (registry membership is all that takes).
- [x] Tests: `client_test.go` — io.Pipe mock agent over the real SDK transport (streamed text, stop-reason mapping, per-policy permission outcomes, fs sandbox allow/deny, process reuse) **plus a real-process E2E** (`TestHelperProcess` re-exec of the test binary over stdio through the actual `spawn()` path).
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
`allow` answers the external agent's `session/request_permission`;
`fs/*` requests are served through the workspace sandbox
(`restrict_to_workspace` + `tools.allow_*_paths`); `terminal/*` is
refused. `authMethods` advertised at initialize → clear error.
- Registry is resolved lazily (`func() *AgentRegistry`) in both the
manager and spawner — reload swaps the registry pointer.
## Web Backend Network API
The web console (the launcher) exposes authenticated JSON endpoints that wrap `rhizome network status` so the dashboard can display live mesh/DHT status:
Expand DownExpand Up
@@ -246,7 +273,7 @@ Both endpoints require a valid node identity and use the launcher's `RHIZOME_HOM
- `pkg/modules` — companion-module sidecar system (catalog, sha256-verified install, daemon supervision with restart backoff, bounded logs, `module.*` events); `cmd/rhizome/internal/module` exposes the `rhizome module` CLI, `pkg/gateway/moduleapi.go` the `/modules*` daemon endpoints, `web/backend/api/modules.go` the `/api/modules*` launcher routes.
- `pkg/acp` — ACP (Agent Client Protocol) server bridge: `rhizome acp` exposes the agent loop to editor clients over stdio JSON-RPC via `coder/acp-go-sdk` (all SDK usage isolated here). Sessions map to `agent:<id>:acp:<sid>` keys on channel `acp` through `AgentLoop.ProcessInbound`; streaming via a `bus.StreamDelegate`; tool approvals bridge to `session/request_permission`.
- `pkg/acp` — ACP (Agent Client Protocol) both ways, all `coder/acp-go-sdk` usage isolated here: **server** (`rhizome acp` exposes the agent loop to editor clients over stdio JSON-RPC; sessions map to `agent:<id>:acp:<sid>` keys on channel `acp` through `AgentLoop.ProcessInbound`; streaming via a `bus.StreamDelegate`; tool approvals bridge to `session/request_permission`) and **client** (`ClientManager` spawns `agents.list[].acp` external agents; `Spawner` intercepts ACP-bound `SubTurn` targets; `RunRemote` backs `ExternalAgentRunner` for mesh dispatch; sandboxed `fs/*` serving + `acp.client.permission_policy` for permission requests).
- `pkg/redact` — leaf package for secret masking (generic patterns + configured `SecureString` values); used by `pkg/logger` and `Config.FilterSensitiveData`.
- `pkg/guard` — leaf package for prompt-injection phrase detection; used by shell-command screening, the tool-argument scan, and CLI tool-call extraction.
- `pkg/rhizome/identity` — BIP39/SLIP-0010 Ed25519 node identity, persistence, and Ed25519 signing; now supports OS keyring and passphrase encryption.
This file contains hidden or bidirec
10BC8
tional 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
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
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.
feat(acp): ACP client — external agents as first-class agent ids (Track 62) #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
feat(acp): ACP client — external agents as first-class agent ids (Track 62) #8
Changes from all commits
1a6b36eFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.