Skip to content

[WIP] RFD-based ACP HTTP and WS web transport implementation#118

Draft
federicociner wants to merge 1 commit into
agentclientprotocol:mainfrom
federicociner:feat/rfd-web-stransport-implementation
Draft

[WIP] RFD-based ACP HTTP and WS web transport implementation#118
federicociner wants to merge 1 commit into
agentclientprotocol:mainfrom
federicociner:feat/rfd-web-stransport-implementation

Conversation

@federicociner

Copy link
Copy Markdown

Implements the remote transport from the RFD (Streamable HTTP + WebSocket), giving ACP a standard remote transport alongside the existing stdio path. Based on the RFD for web transport and reference implementations that already exist in the Rust and TypeScript SDKs.

What's included

  • Transport seam (_transport.py): message-level Transport protocol; stdio re-expressed as NdjsonTransport with zero behavior change. Connection and connect_to_agent now accept a Transport in addition to byte streams.
  • Streamable HTTP (http/): POST for client→server (202, except initialize which returns 200 + Acp-Connection-Id), long-lived SSE GET streams for server→client (connection- and session-scoped), DELETE to terminate. Framework-agnostic core + thin ASGI adapter.
  • WebSocket (ws/): full-duplex upgrade on the same endpoint, multiplexing all server→client traffic onto one socket.
  • Client transports: create_http_stream() and create_websocket_stream().

Reliability hardening

  • Backpressure: OutboundStream awaits on a full buffer instead of silently
    dropping messages (a dropped response would hang the peer permanently).
  • SSE keepalive: idle streams emit periodic keepalive comments so intermediaries don't time out healthy connections.
  • Disconnect surfacing: HTTP client surfaces EOF when the connection-scoped SSE stream ends, so pending requests reject instead of hanging.
  • initialize cleanup: failed/timed-out initialize tears down the connection (504/500) instead of leaking it.
  • WebSocket cookies: client sends/stores affinity cookies.

@federicociner federicociner changed the title RFD-based ACP HTTP and WS web transport [WIP] RFD-based ACP HTTP and WS web transport implementation Jul 13, 2026
@federicociner

federicociner commented Jul 13, 2026

Copy link
Copy Markdown
Author

I am marking this PR as WIP until I have been able to do E2E testing on our internal infrastructure; we have an agentic runtime platform internally within at Atlassian that exposes an ACP over HTTP endpoint, so we can stress test the Python SDK implementation against this server.

I will update the PR once I've done E2E testing.

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.

1 participant