Problem
ACP requests such as session/prompt can run for several minutes. The HTTP adapter currently keeps the POST open until the agent returns its JSON-RPC response. This makes correctness depend on every proxy and client allowing an arbitrarily long response-header timeout; for example, Node/Undici aborts after its default five-minute headers timeout.
The client already maintains an SSE connection capable of receiving JSON-RPC responses. Holding the originating POST open duplicates that response path and makes a transport timeout capable of disrupting an otherwise healthy stream.
Proposed contract
For requests that will complete asynchronously:
- Accept and validate the JSON-RPC request.
- Return
202 Accepted promptly from the POST.
- Deliver the eventual JSON-RPC result or error on the existing SSE stream, correlated by request ID.
- Keep immediate
4xx/5xx responses for failures that occur before acceptance.
Notifications can continue to return 202 without a later response.
Questions
- Should this apply to every ACP request, or only explicitly long-running methods such as
session/prompt?
- Does ACP-over-streamable-HTTP already define this behavior, or should sandbox-agent document an extension?
- What retry/idempotency guarantees should clients use if the POST connection fails before receiving
202?
Separately, a narrow client reliability fix can ensure an individual detached POST failure rejects only its matching JSON-RPC request rather than closing the shared SSE transport. That protects current behavior but does not remove the long-lived POST dependency described here.
Problem
ACP requests such as
session/promptcan run for several minutes. The HTTP adapter currently keeps the POST open until the agent returns its JSON-RPC response. This makes correctness depend on every proxy and client allowing an arbitrarily long response-header timeout; for example, Node/Undici aborts after its default five-minute headers timeout.The client already maintains an SSE connection capable of receiving JSON-RPC responses. Holding the originating POST open duplicates that response path and makes a transport timeout capable of disrupting an otherwise healthy stream.
Proposed contract
For requests that will complete asynchronously:
202 Acceptedpromptly from the POST.4xx/5xxresponses for failures that occur before acceptance.Notifications can continue to return
202without a later response.Questions
session/prompt?202?Separately, a narrow client reliability fix can ensure an individual detached POST failure rejects only its matching JSON-RPC request rather than closing the shared SSE transport. That protects current behavior but does not remove the long-lived POST dependency described here.