Skip to content

Allow long-running ACP requests to complete asynchronously over SSE #305

Description

@RGHenderson

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:

  1. Accept and validate the JSON-RPC request.
  2. Return 202 Accepted promptly from the POST.
  3. Deliver the eventual JSON-RPC result or error on the existing SSE stream, correlated by request ID.
  4. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions