feat(acp): Gateway-backed ACP server implementation#122
Closed
visionik wants to merge 23 commits intoopenclaw:mainfrom
Closed
feat(acp): Gateway-backed ACP server implementation#122visionik wants to merge 23 commits intoopenclaw:mainfrom
visionik wants to merge 23 commits intoopenclaw:mainfrom
Conversation
- Add src/acp/ module with ClawdisAgent, AcpSessionAdapter, and stdio server - Plug into getReplyFromConfig() like Discord/Telegram/WhatsApp connectors - Add clawd-acp binary entry point for IDE integration - Include 8 unit tests for agent lifecycle methods - Uses @agentclientprotocol/sdk for JSON-RPC transport See: https://agentclientprotocol.com
- Add clawd-acp-client binary for testing without an IDE - Spawns clawd-acp, initializes, creates session, interactive prompt loop - Auto-approves permission requests for testing - Supports --cwd, --agent, --verbose flags See: https://agentclientprotocol.com
- Add acp-gw module: thin ACP server that delegates to Gateway via WebSocket - Fix ACP session blocking: use sessionKey as lane for parallel execution - Add --trace-sessions flag for debugging session/lane routing - Document architecture and concurrency fix in docs/acp-gw.md The key fix: ACP sessions now use their own lane (e.g., acp:sessionId) instead of the global 'main' lane, allowing them to run concurrently with the main conversation session.
- Track cumulative text to only send new characters (not full text each time) - Detect and skip duplicate text when Gateway sends response twice - Fixes double-printing in ACP client output
- Extract image content blocks from ACP prompts - Pass as attachments to Gateway chat.send - Images use base64 data with mimeType
- Add runId -> sessionId reverse lookup for agent event correlation - Handle tool stream events (phase: start/result) - Send tool_call and tool_call_update session updates
- Reject all pending prompts when Gateway disconnects - Clean up session state on disconnect - Log disconnect reason
- Retry connection up to 5 times with exponential backoff - Update Gateway client reference on reconnect - Reset attempt counter on successful connection
- Session manager tests (create, get, delete, active runs) - Translator tests (initialize, newSession, auth, disconnect/reconnect) - 21 tests total, all passing
- Document streaming (text, tools, delta diffing) - Document attachments, reconnection, abort - Add Limitations section (MCP servers, session persistence) - Add CLI options reference - Update file listing with tests
- Sessions persist to ~/.clawdis/acp-gw-sessions.json by default - Add --session-store and --no-session-store CLI options - Sessions survive acp-gw restart (Gateway keeps conversation history) - Add persistence tests (4 new tests, 27 total)
- Test gateway connection - Test session creation (single and multiple) - Test disconnect handling with callback wiring - Test authentication - 5 integration tests, 32 total acp-gw tests
- Add tests for setSessionMode, prompt, cancel - Add tests for handleGatewayEvent (tool start/result/error) - Add tests for handleChatEvent (delta, final, aborted) - Add tests for text deduplication, image extraction - Add verbose logging test - Coverage: translator.ts 15% → 88%, overall 30% → 66% - 52 tests total (was 32)
- Add full lifecycle integration tests - Add setSessionMode, cancel, reconnection tests - Add error handling tests (unknown session, loadSession) - Add verbose mode test - Add server module test - 62 tests total, 78.78% line coverage (target: 75%)
- Test prompt/response with streaming - Test tool use events (tool_call, tool_call_update) - Test prompt cancellation - Handle various model responses (end_turn, refusal) - 65 tests total, 80.8% line coverage
Users can now run: - pnpm acp-gw (local dev) - clawd-acp-gw (when installed globally)
- Remove src/acp/ (non-gateway ACP implementation) - Point clawd-acp binary to acp-gw/server.js - Single ACP implementation via Gateway
- src/acp-gw → src/acp - docs/acp-gw.md → docs/acp.md - Update all internal references
- Show tool name with full args in Toad (e.g., 'bash: command: ls') - Skip duplicate Gateway tool start events (second event lacks args) - Wait for both job:done AND state=final before resolving prompts - Use startedAt timestamp to correctly match job events across prompts - Disable keepalive dots (tool updates provide sufficient activity) - Add detailed logging for tool events Note: Code may be messy due to extensive debugging of Gateway event timing corner cases. Will be cleaned up tomorrow.
- Add resolvedSessionKeys Set to ignore events after session resolution - Clear resolved marker when new prompt starts on same session - Improve delta dedup logging for debugging - Fixes issue where subsequent prompts on same session were blocked
Contributor
|
Haven't forgotten about this, just too many fires! |
Contributor
|
Took me longer than I wanted, but finally landed - thank you! |
Contributor
|
Thanks @visionik! We already landed ACP support in main. Implemented across:
Closing this PR as already implemented. Appreciate the work! |
Contributor
Author
|
Outstanding. Thank you @steipete and Clawd! |
dgarson
referenced
this pull request
in dgarson/clawdbot
Feb 7, 2026
voice-call: use fromNumber for Twilio webhook sync
dgarson
referenced
this pull request
in dgarson/clawdbot
Feb 22, 2026
- WebhookPlayground: webhook test/replay tool (Reed agent) - Endpoint config, request body editor, response viewer, delivery history with 6+ entries - SLAManager: SLA compliance tracking (Quinn agent) - 4 tabs: Overview/Definitions/Compliance Report/Incidents - 6 SLAs with compliance bars, monthly breach tracking - DocumentationViewer: 3-column docs browser (Wes agent) - Nav tree, content area with headings/code blocks/callouts, TOC, search
github-actions bot
pushed a commit
to Piboonsak/openclaw_github
that referenced
this pull request
Mar 11, 2026
Piboonsak
added a commit
to Piboonsak/openclaw_github
that referenced
this pull request
Mar 12, 2026
- Add safeBinProfiles.gh and .git to config/openclaw.prod.json5 (WS-B) * Fixes config drift that blocked exec path and forced approval fallback * Profiles allow git clone/pull, gh issue/pr operations * Reduces outbound message bursts that trigger LINE rate limits - Add exponential backoff + jitter retry to LINE exec-approvals (WS-D) * Retries template send with 3 attempts, baseDelay 300ms, max 5s * Retries fallback text with 2 attempts, baseDelay 500ms, max 3s * Only retries on transient errors (429, 5xx, network timeouts) * Spreads requests over time to avoid burst rate limits - Add backoff retry to heartbeat runner (WS-D) * Wraps deliverOutboundPayloads calls with retry logic * 2 attempts, baseDelay 500ms, max 5s for heartbeat pings * Handles transient rate limiting gracefully Fixes openclaw#122 (LINE 429 bursts) Addresses openclaw#97 #101 (exec allow list reliability)
zhyongrui
added a commit
to zhyongrui/openclaw
that referenced
this pull request
Mar 20, 2026
0x666c6f
added a commit
to 0x666c6f/openclaw
that referenced
this pull request
Mar 26, 2026
…#122) * fix(slack:PLA-950): guard numeric summary totals * fix(slack:PLA-950): validate final replies against evidence * fix(slack:PLA-950): address PR review findings * fix(slack:PLA-950): harden evidence reply validation * fix(slack:PLA-950): tighten evidence provenance guards * fix(slack:PLA-950): bound evidence fact parsing * fix(slack:PLA-950): tighten evidence-backed total reconciliation * fix(slack:PLA-950): harden summary evidence parsing * build(ui): bump vite to fix prod audit * fix(slack): harden numeric token parsing
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
Implements a complete ACP (Agent Client Protocol) server that delegates to the Clawdis Gateway.
Features
acp:namespace prefixFiles
src/acp/- Server, translator, session manager, typesdocs/acp.md- Full documentationTests
Binaries
clawdis-acp- Main binarypnpm acp- Dev script