Repository navigation
feat(acp-tunnel): inbound tunnel dispatch — parse frames + build replies (Part B slice 4) - #42
Merged
Merged
Conversation
…ies (Part B slice 4) The gateway-initiated tunnel routing, kept **pure** so the async work (forwarding an inner MCP call to the running oab-mcp sidecar and awaiting it) stays in the src-tauri transport and the routing is unit-testable without a runtime. - `Inbound` classification of an `/acp` frame: `Connect` / `Message` (request vs notification by presence of the outer id) / `Disconnect` / `Cancel` / `Other` (ACP chat + unknown are ignored by the tunnel). - `parse_inbound` (never fails; lenient sub-field reads) and the reply builders `connect_reply` / `message_reply` / `message_error` / `disconnect_reply`. - Correlation is always by the OUTER ACP frame id; the inner MCP result becomes the ACP response result verbatim; an inner error becomes an outer JSON-RPC error (tunnel contract §4). Verification: `cargo test -p acp-tunnel` — 13/13 pass locally (7 lifecycle + 6 dispatch), no aws / no Tauri. Remaining for path (i): the src-tauri WS transport — dial `/acp` (tokio-tungstenite), drive the `Session`, and on each `Inbound::Message` relay to the sidecar `McpClient` and reply. That half compiles only under desktop.yml (macOS) and runs end-to-end only against a real gateway (ADR §5, pending). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.
Drafted by Orca (
ecs-claude) — flagging authorship (shared GitHub identity).Slice 4 (protocol half) of the reverse-MCP client ADR (#36). Rebased onto main after #40 (slice 3) merged — supersedes the auto-closed #41 (its stacked base branch was deleted on squash-merge).
The gateway-initiated tunnel routing, kept pure so the async work (relaying an inner MCP call to the running
oab-mcpsidecar) stays in the transport, and routing is unit-testable.What
Inboundclassification:Connect/Message(request vs notification by outer-id presence) /Disconnect/Cancel/Other(ACP chat + unknown ignored).parse_inbound(never fails) + reply buildersconnect_reply/message_reply/message_error/disconnect_reply.resultverbatim; inner error → outer JSON-RPC error (contract §4).Verification
cargo test -p acp-tunnel— 13/13 pass locally (7 lifecycle + 6 dispatch), no aws / no Tauri.Next: the src-tauri WS transport + the configurable endpoint (editable config file) and an explicit "activate remote connection" button (per operator direction) — coming as the transport PR.
🤖 Generated with Claude Code