Skip to content

feat(acp): HTTP+SSE and WebSocket transport#826

Merged
bug-ops merged 3 commits intomainfrom
epic/acp-http-transport
Feb 24, 2026
Merged

feat(acp): HTTP+SSE and WebSocket transport#826
bug-ops merged 3 commits intomainfrom
epic/acp-http-transport

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 24, 2026

Summary

  • Add HTTP+SSE transport: POST /acp accepts JSON-RPC, returns SSE stream; GET /acp reconnects SSE notifications with Acp-Session-Id header
  • Add WebSocket transport: GET /acp/ws upgrades to bidirectional WebSocket
  • Refactor transport.rs into transport/ module (stdio.rs, bridge.rs, http.rs, ws.rs, router.rs)
  • Duplex bridge pattern: tokio::io::duplex connects axum handlers to ACP SDK's AsyncRead+AsyncWrite via dedicated OS thread with LocalSet (required for !Send Agent)
  • Security: 1 MiB body/message limits, max_sessions enforcement (503), UUID validation on session headers, CORS deny-all
  • Idle reaper with last_activity tracking via AtomicU64
  • SSE keepalive pings every 15s
  • Feature-gated behind acp-http; adds AcpTransport enum and http_bind to [acp] config

Test plan

  • 12 new transport tests (HTTP POST, SSE, session routing, error paths, WS upgrade, reaper, max_sessions)
  • 2703 total tests pass (--features acp-http)
  • Clippy clean with --features full
  • Existing stdio transport unchanged

Closes #783

Add HTTP+SSE and WebSocket transports to the ACP server alongside
existing stdio. Axum-based POST /acp returns SSE stream, GET /acp
reconnects SSE notifications, GET /acp/ws upgrades to WebSocket.
Session routing via Acp-Session-Id header with UUID validation.

Includes body size limits (1 MiB), WS message size limits,
max_sessions enforcement (503), CORS deny-all, idle reaper with
last_activity tracking, SSE keepalive pings.

Feature-gated behind acp-http. Adds AcpTransport enum and http_bind
config fields.

Closes #783
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 24, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 24, 2026 22:39
@bug-ops bug-ops merged commit a7cb4ea into main Feb 24, 2026
23 checks passed
@bug-ops bug-ops deleted the epic/acp-http-transport branch February 24, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core dependencies documentation Improvements or additions to documentation enhancement New feature or request rust size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Epic: HTTP+SSE and WebSocket Transport

1 participant