Skip to content

fix(acp)!: preserve JSON-RPC frames across transport adapters#275

Merged
benbrandt merged 1 commit into
mainfrom
fix-jsonrpc-frame-transport
Jul 21, 2026
Merged

fix(acp)!: preserve JSON-RPC frames across transport adapters#275
benbrandt merged 1 commit into
mainfrom
fix-jsonrpc-frame-transport

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Carry complete single, batch, and malformed frames through component, tracing, HTTP, WebSocket, and polyfill boundaries. Preserve grouped responses and HTTP request provenance, including duplicate and null IDs.

BREAKING CHANGE: Channel now carries TransportFrame instead of Result<RawJsonRpcMessage, Error>. FramedChannel and into_framed_channel_and_future are removed.

Carry complete single, batch, and malformed frames through component, tracing, HTTP, WebSocket, and polyfill boundaries. Preserve grouped responses and HTTP request provenance, including duplicate and null IDs.

BREAKING CHANGE: Channel now carries TransportFrame instead of Result<RawJsonRpcMessage, Error>. FramedChannel and into_framed_channel_and_future are removed.
Copilot AI review requested due to automatic review settings July 21, 2026 12:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the ACP Rust SDK’s in-process transport boundary so protocol components and transport adapters preserve complete JSON-RPC frames (single values, non-empty batches, and malformed wire input) end-to-end. It removes the legacy Result<RawJsonRpcMessage, Error>-based channel API in favor of a frame-aware Channel<TransportFrame>, and updates core routing plus HTTP/WebSocket/polyfill integrations to maintain batch grouping, request provenance, and duplicate/null ID behavior.

Changes:

  • Make Channel carry TransportFrame (single/batch/malformed) and remove FramedChannel / into_framed_channel_and_future.
  • Introduce public TransportBatch / TransportBatchEntry and add TransportFrame::{parse_json,to_json} utilities to round-trip frames across text-based transports.
  • Update HTTP + WebSocket servers/clients and the MCP-over-ACP polyfill to preserve batch frames and correctly correlate grouped responses.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/agent-client-protocol/tests/protocol_v2.rs Updates protocol v2 tests to send/receive TransportFrame::Single on channels.
src/agent-client-protocol/tests/jsonrpc_transport_close.rs Adjusts close/drain tests for the new frame-based channel semantics.
src/agent-client-protocol/tests/jsonrpc_batch.rs Updates documentation to reflect batch-aware frames at the channel boundary.
src/agent-client-protocol/src/stdio.rs Switches stdio transport adapter to into_channel_and_future returning Channel.
src/agent-client-protocol/src/role/acp.rs Migrates ACP role/router wiring to frame-based channels and malformed handling.
src/agent-client-protocol/src/lib.rs Publicly re-exports TransportFrame / batch types; removes hidden FramedChannel export.
src/agent-client-protocol/src/jsonrpc/transport_actor.rs Implements frame parsing/serialization and safe relaying of malformed multiline payloads.
src/agent-client-protocol/src/jsonrpc/outgoing_actor.rs Updates protocol→transport forwarding to send TransportFrame::Single directly.
src/agent-client-protocol/src/jsonrpc/incoming_actor.rs Updates frame entry extraction and response-destination assignment for new frame types.
src/agent-client-protocol/src/jsonrpc.rs Makes TransportFrame/batch types public, removes legacy bridging, and redefines Channel as frame boundary.
src/agent-client-protocol/src/component.rs Removes into_framed_channel_and_future and legacy negotiation adapter.
src/agent-client-protocol/src/acp_agent.rs Updates AcpAgent to expose Channel via into_channel_and_future and use TransportFrame.
src/agent-client-protocol/CHANGELOG.md Documents the breaking channel change and frame-preservation fixes with migration-guide link.
src/agent-client-protocol-polyfill/src/mcp_over_acp/http.rs Preserves batch frames through MCP-over-ACP HTTP bridge; correlates malformed POST errors to the originating request.
src/agent-client-protocol-polyfill/CHANGELOG.md Notes batch-frame preservation and malformed correlation fixes in polyfill changelog.
src/agent-client-protocol-http/src/websocket_server.rs Switches WS handling to TransportFrame::parse_json, forwards batches intact, and adds grouped-response tests.
src/agent-client-protocol-http/src/http_server.rs Adds batch-aware POST handling and session-aware routing while preserving grouped batch responses.
src/agent-client-protocol-http/src/connection.rs Routes outbound frames (single/batch/malformed), supports duplicate IDs via queued pending routes, and adds tests.
src/agent-client-protocol-http/src/client.rs Updates HTTP client transport to post/receive frames (including batches/malformed) and adds end-to-end preservation tests.
src/agent-client-protocol-http/CHANGELOG.md Notes batch-frame preservation fixes for HTTP and WebSocket transports.
src/agent-client-protocol-conductor/src/snoop.rs Updates conductor snooper to bridge with inspection using Channel instead of FramedChannel.
md/transport-architecture.md Updates architecture doc to describe TransportFrame boundary and frame-based Channel.
md/SUMMARY.md Adds the v2.0 migration guide to the mdBook ToC.
md/migration_v2.0.md Adds a 2.0 migration guide describing the new Channel<TransportFrame> boundary and removed APIs.

@benbrandt
benbrandt merged commit edc6920 into main Jul 21, 2026
15 checks passed
@benbrandt
benbrandt deleted the fix-jsonrpc-frame-transport branch July 21, 2026 12:07
@acp-release-bot acp-release-bot Bot mentioned this pull request Jul 21, 2026
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