Add RFD: Streamable HTTP & WebSocket Transport#721
Add RFD: Streamable HTTP & WebSocket Transport#721alexhancock wants to merge 2 commits intoagentclientprotocol:mainfrom
Conversation
|
A project has already been developed for this feature, and I believe it would be better to keep it as a separate project to avoid increasing code maintenance overhead. |
| │ ┌─────────────────────│ Server creates session, opens SSE stream | ||
| │ │ (SSE stream open) │ | ||
| │<─────────────│─ SSE event ─────────│ { id: 1, result: { capabilities } } | ||
| │ │ │ Response includes Acp-Session-Id header |
There was a problem hiding this comment.
From what I understand Acp-Session-Id here is a transport specific ID. It is a confusing name because ACP session ID is expected to be created later on session/new (https://agentclientprotocol.com/protocol/session-setup#session-id).
There was a problem hiding this comment.
This is a good point, thanks for catching.
Do you think it's sane to drop the transport specific id and have no Acp-Session-Id included in requests unless a session/new has been performed? Also interested in alternative resolutions.
There was a problem hiding this comment.
unless a session/new has been performed
session/prompt has a session_id parameter in its request, which seems to be a separate session ID (actual session ID, not tranport ID). It has to be different from Acp-Session-Id because the same Acp-Session-Id can call session/new multiple times, if I understand it correctly. I'm not sure how exactly Acp-Session-Id is supposed to be used in the proposal.
There was a problem hiding this comment.
Do you think it's sane to drop the transport specific id and have no Acp-Session-Id included in requests
This won't work, as capabilities defined during the initialize phase, so when the client sends their session/new request, the server should know which this Session id. But I agree that the name is confusing here.
|
@alexhancock do I understand it correctly that you suggest opening multiple SSE (first on |
Intent is to follow the request patterns of MCP's streamable http transport https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#sending-messages-to-the-server. From that spec: "Every JSON-RPC message sent from the client MUST be a new HTTP POST request to the MCP endpoint"
"After all JSON-RPC responses have been sent, the server SHOULD close the SSE stream."
I don't have a perfect answer to this off the top of my head, but it likely relates to the discussion here about session ids. Should there perhaps be a session id which only corresponds to the concept of ACP Session ID (nothing transport level) and then a request id to correspond to one client request within a session? Open to ideas! |
does it mean, that f.i. the first SSE stream that was opened for |
The way I had been thinking about it, each SSE stream opened by a POST request closes after its response is sent. But the agent can still reach the client between requests using a dedicated GET listener stream, similar to this part of MCP's specification of its streamable HTTP transport (https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#listening-for-messages-from-the-server)
For the specific case you mentioned, if the agent needs to send data after However, I'm wondering if we should consider a simpler alternative that's more aligned with idiomatic SSE usage: Option 1 (current proposal): Multiple streams as described above and in the current draft of the RFD
Option 2 (alternative): Single long-lived stream
The second option would be a deviation from MCP's spec, but might be better suited to ACP's more bidirectional nature and the high volume of notifications from long-running prompts. It would also naturally solve the concern you raised about messages between requests. This option would likely need to rely more heavily on cookie-based session affinity. I'm curious what you and others think - does the multi-stream approach make sense for ACP, or would a single long-lived stream be simpler and more practical? Open to ideas and feedback. Also agree we need to clean up the semantics of |
Co-authored-by: Jasper Hugo <jhugo@block.xyz>
b15cba3 to
007af59
Compare
007af59 to
274954b
Compare
|
@agentcooper @mikhailshilkov @anna239 I have pushed a new revision of the doc to address feedback.
I would really like opinions/feedback on these resolutions to the original issues from the first draft, and any alternative ideas if you see opportunities to improve the proposal. Thank you! |
|
@alexhancock thank you, current proposal looks good! We have some protocol changes we're planning for some time already, they're related to how ACP works with prompt request. We'd like to review those and see if it makes sense to deliver them before HTTP implementation, I'm sorry for the delay, we need several more days for it |
Adding an RFD for a streamable HTTP and websocket transport