Skip to content

feat: ACP bridge for editor integration#333

Merged
khaliqgant merged 26 commits into
mainfrom
feature/acp-bridge
Feb 3, 2026
Merged

feat: ACP bridge for editor integration#333
khaliqgant merged 26 commits into
mainfrom
feature/acp-bridge

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Jan 28, 2026

Summary

  • Adds @agent-relay/acp-bridge package that exposes relay agents to ACP-compatible editors (Zed, Neovim, etc.)
  • Implements the Agent Client Protocol (JSON-RPC 2.0 over stdio) to bridge editor prompts to all connected relay agents
  • Adds comprehensive documentation for editor integration

Changes

  • New package: packages/acp-bridge/ with relay client, ACP agent implementation, and CLI
  • Documentation: docs/guides/editor-integration.mdx with setup instructions for Zed, Neovim, and other editors
  • Navigation: Updated docs/mint.json to include the new guide

How it works

┌─────────────────┐     ACP (stdio)    ┌─────────────────┐
│   Zed Editor    │ ◄────────────────► │  relay-acp      │
│   (or other)    │   JSON-RPC 2.0     │  (bridge)       │
└─────────────────┘                    └────────┬────────┘
                                                │
                                       Relay Protocol
                                                │
                                       ┌────────▼────────┐
                                       │  Relay Daemon   │
                                       └────────┬────────┘
                                                │
                        ┌───────────────────────┼───────────────────────┐
                        │                       │                       │
                   Agent 1                 Agent 2                 Agent N

Test plan

  • Build the acp-bridge package
  • Configure Zed to use relay-acp as a custom agent
  • Verify prompts are broadcast to connected relay agents
  • Verify responses stream back to the editor

🤖 Generated with Claude Code


Open with Devin

khaliqgant and others added 2 commits January 28, 2026 12:14
…itors

Implements an ACP (Agent Client Protocol) bridge that allows ACP-compatible
editors like Zed to communicate with Agent Relay agents.

Key features:
- ACP JSON-RPC server over stdio transport
- Session management (new sessions, cancellation)
- Prompt handling with streaming responses
- Relay daemon client for agent communication
- CLI entry point (relay-acp)

The bridge broadcasts user prompts to all connected relay agents and
streams their responses back to the editor in real-time.

Usage:
  relay-acp --name my-agent --debug

Or configure in Zed settings:
  { "agent": { "custom_agents": [{ "name": "Agent Relay", "command": "relay-acp" }] } }

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Documents how to use the ACP bridge to integrate Agent Relay with
code editors like Zed and Neovim that support the Agent Client Protocol.

Covers:
- Architecture overview and message flow
- Installation and configuration for various editors
- CLI options and environment variables
- Programmatic usage with TypeScript
- Troubleshooting and best practices

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View issue and 5 additional flags in Devin Review.

Open in Devin Review

Comment thread packages/acp-bridge/src/acp-agent.ts
khaliqgant and others added 2 commits January 30, 2026 20:46
…itors

Implements an ACP (Agent Client Protocol) bridge that allows ACP-compatible
editors like Zed to communicate with Agent Relay agents.

Key features:
- ACP JSON-RPC server over stdio transport
- Session management (new sessions, cancellation)
- Prompt handling with streaming responses
- Relay daemon client for agent communication
- CLI entry point (relay-acp)

The bridge broadcasts user prompts to all connected relay agents and
streams their responses back to the editor in real-time.

Usage:
  relay-acp --name my-agent --debug

Or configure in Zed settings:
  { "agent": { "custom_agents": [{ "name": "Agent Relay", "command": "relay-acp" }] } }

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Documents how to use the ACP bridge to integrate Agent Relay with
code editors like Zed and Neovim that support the Agent Client Protocol.

Covers:
- Architecture overview and message flow
- Installation and configuration for various editors
- CLI options and environment variables
- Programmatic usage with TypeScript
- Troubleshooting and best practices

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 9 additional flags in Devin Review.

Open in Devin Review

Comment thread packages/acp-bridge/src/acp-agent.ts
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 10 additional flags in Devin Review.

Open in Devin Review

Comment thread packages/acp-bridge/src/relay-client.ts Outdated
khaliqgant and others added 3 commits February 3, 2026 15:32
Add 'zed-bridge' to the INTERNAL_AGENTS set so it doesn't appear
in the default `agent-relay agents` output. It will still be visible
when using the --all flag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 12 additional flags in Devin Review.

Open in Devin Review

Comment thread src/cli/index.ts
- Add @AgentName targeting to send messages to specific agents
- Use main @agent-relay/sdk instead of duplicate relay-client
- Restructure docs to emphasize `agent-relay up --zed` quick start
- Move advanced editor config (Neovim, programmatic usage) to bottom
- Remove redundant CLI Options section from docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…nced

Streamline the editor integration guide by removing unnecessary
internal details and moving programmatic usage to the advanced section.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add vscode-acp extension to editor integration docs. Note that it
currently only supports auto-detected agents (Claude, OpenCode, etc.)
and doesn't yet have custom agent configuration support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
khaliqgant and others added 5 commits February 3, 2026 20:44
When an agent crashes (SIGKILL, OOM, etc.), the ACP bridge now:
- Detects system messages via isSystemMessage flag
- Formats crash notifications with agent name, signal, exit code
- Broadcasts to all active Zed sessions (not just processing ones)

This ensures users see when spawned agents die unexpectedly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add `agent-relay status` command to show:
- Connection state (Connected/Disconnected)
- Relay client state
- Agent name
- Number of connected agents

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add `agent-relay uninstall` command with options:
- --keep-data: Keep database and message history, only remove runtime files
- --zed: Also remove Agent Relay from Zed editor configuration
- --snippets: Remove agent-relay snippets from CLAUDE.md, GEMINI.md, AGENTS.md
- --force: Skip confirmation prompt
- --dry-run: Preview what would be removed without making changes

The command stops the daemon if running, then removes the .agent-relay/
directory and optionally cleans up related configuration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comment thread src/cli/index.ts
content = content.replace(/<!-- prpm:snippet:start @agent-relay\/agent-relay-protocol.*?<!-- prpm:snippet:end @agent-relay\/agent-relay-protocol[^\n]*\n?/gs, '');

if (content.length !== originalLength) {
fs.writeFileSync(filePath, content);

Check failure

Code scanning / CodeQL

Potential file system race condition High

The file may have changed since it
was checked
.
khaliqgant and others added 2 commits February 3, 2026 21:11
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Regenerated lock file from scratch to ensure all workspace
packages are properly recorded for npm ci.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View issue and 18 additional flags in Devin Review.

Open in Devin Review

Comment thread src/cli/index.ts Outdated
khaliqgant and others added 7 commits February 3, 2026 22:37
Add @agent-relay/acp-bridge to the packages matrix in publish.yml
so it gets published alongside other workspace packages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… IDE

- Add onChannelMessage handler to receive channel broadcasts
- Subscribe to #general channel on connect
- Route channel messages to all active sessions in Zed

This ensures messages sent to #general by agents are visible in the IDE.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit d708bca into main Feb 3, 2026
31 of 32 checks passed
@khaliqgant khaliqgant deleted the feature/acp-bridge branch February 3, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants