Repository navigation
feat(channels): ACP channel and agents acp stdio bridge
#2501
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
Open
cjol
wants to merge
4
commits into
main
Choose a base branch
from
feat/channels-acp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,975
−435
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8bee6c4
feat(channels): Channels resolve their own participants; the agent ob…
cjol 0aba40b
docs(channels): a route names an agent object, not a conversation's a…
cjol e3ee3f9
docs(channels): a participant's threads share the object's default co…
cjol 0ca868d
feat(channels): ACP channel and `agents acp` stdio bridge
cjol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| "agents": patch | ||
| --- | ||
|
|
||
| Add `AcpChannel` (`agents/experimental/channels/acp`), which serves a Channels agent to [Agent Client Protocol](https://agentclientprotocol.com) clients such as Zed and T3 Code, and `npx agents acp <url>`, which bridges an ACP client's stdio to the channel's WebSocket. | ||
|
|
||
| Each ACP session is a conversation. The channel supports `session/new`, `load`, `resume`, `list`, `close` and `fork`. It streams text, reasoning and tool calls as session updates, turns approvals into `session/request_permission`, and cancels the running turn on `session/cancel`. Messages sent from other surfaces show up in the ACP client too. | ||
|
|
||
| `acp()` is its side in the gateway, like `web()` for the Web Channel: it takes `/acp` upgrades by default and resolves who is connecting. The gateway now names the Channel that took an upgrade in the connection identity (`channel`), so the agent's channel mounted under the same key serves it, and the Web Channel ignores connections addressed to another channel. |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/bin/sh | ||
| # Starts `agents acp` against this example's ACP channel, for ACP clients | ||
| # that launch an agent as a local command (Zed, T3 Code). | ||
| # | ||
| # T3 Code's ACP Registry provider runs this as an executable override and | ||
| # appends the registry agent's own arguments, so arguments are ignored here. | ||
| # Configure it with environment variables instead: | ||
| # | ||
| # ACP_URL Default: ws://localhost:5173/acp/$ACP_HARNESS/$ACP_ROOM | ||
| # ACP_HARNESS ai-sdk (default) or pi | ||
| # ACP_ROOM Default: lobby | ||
| # ACP_PARTICIPANT Sent as ?as=; default: acp | ||
| here=$(cd "$(dirname "$0")" && pwd) | ||
| exec node "$here/../node_modules/agents/dist/cli.js" acp \ | ||
| "${ACP_URL:-ws://localhost:5173/acp/${ACP_HARNESS:-ai-sdk}/${ACP_ROOM:-lobby}}" \ | ||
| --as "${ACP_PARTICIPANT:-acp}" |
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Pi setup snippet omits ACP
The Pi setup snippet still mounts only
WebChannel, while PiAgent mounts both channels. Readers copying it will miss the ACP setup.(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.