Skip to content

feat: add initial acp streable http rfc. - #100

Closed
Million-mo wants to merge 5 commits into
develop/agenticfrom
feat/acp-streamable-http-websocket-transport
Closed

feat: add initial acp streable http rfc.#100
Million-mo wants to merge 5 commits into
develop/agenticfrom
feat/acp-streamable-http-websocket-transport

Conversation

@Million-mo

Copy link
Copy Markdown
Owner

备份迁移自 SRC-PR#31 · 作者 @Leoyzen · 创建于 2026-05-19T01:48:50Z · head=feat/acp-streamable-http-websocket-transport base=develop/agentic
源状态: merged · merge_commit_sha=f6fdaf1d907d23933a9d8af1b2a209f9d5e85248

Leoyzen added 5 commits May 19, 2026 09:48
- Fix Hypercorn terminology: server framework -> ASGI server
- Document port default (8080) differs from legacy WebSocketTransport (8765)
- Change JSON-RPC error code -32600 -> -32002 for initialize-required state
- Add Rejected Options table in Decision Record per RFC rules
- Add Initialize Guard implementation notes explaining protocol-layer interception
- Add ACPWebSocketTransport dataclass for streamable-http config
- Implement _serve_streamable_http() with Starlette/uvicorn server
- Add _StarletteWebSocketReadStream/_StarletteWebSocketWriteStream adapters
- Generate Acp-Connection-Id UUID header per connection
- Track active connections with graceful cleanup on shutdown
- Add initialize guard to AgentSideConnection (-32002 error before init)
- Extend ACPPoolServerConfig with transport/host/port fields
- Update ACPServer.from_config() to resolve YAML transport config
- Extend CLI with --transport streamable-http/--host/--port options
- Add deprecation warning for legacy 'websocket' transport literal
- Migrate Toad helper in ui.py to use new transport
- Add starlette>=0.40 to dependencies
- Fix WebSocket accept header format (bytes instead of str)
- Add 41 unit/integration/CLI tests for streamable-http transport
- Update existing tests to work with initialize guard
- Add buffering to _StarletteWebSocketReadStream.receive to respect max_bytes
- Change _StarletteWebSocketWriteStream.send to use rstrip(b'\n') instead of strip()
- Add test for buffering behavior across receive calls
@Million-mo

Copy link
Copy Markdown
Owner Author

评论 by @Leoyzen 于 2026-05-22T01:59:44Z(备份迁移)

@gemini-code-assist All four review comments have been addressed in commit ec743ed:

  1. Hypercorn terminology ✅ — Changed "another server framework" to "another ASGI server" in Option 1 Disadvantages.

  2. Port default inconsistency ✅ — Added documentation in ACPWebSocketTransport docstring explaining that 8080 (standard HTTP port) differs from the legacy WebSocketTransport default 8765, including a migration note for --ws-port users.

  3. JSON-RPC error code ✅ — Changed all occurrences of -32600 to -32002 (Success Criteria, Initialize Guard description, Initialize Lifecycle Flow diagram). Added a Rejected Options table in the Decision Record per repository RFC rules, documenting why -32600 was rejected.

  4. Initialize Guard implementation ✅ — Added Implementation notes under Initialize Guard clarifying that the guard operates at the protocol layer (on parsed JSON-RPC request/response objects, not raw bytes), avoiding stream adapter complexity. The guard wraps the agent's initialize() handler and flips state on successful InitializeResponse return.

All changes are pushed to this branch. Please re-review when convenient.

@Million-mo

Copy link
Copy Markdown
Owner Author

评论 by @Leoyzen 于 2026-05-22T06:40:11Z(备份迁移)

/gemini review

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