Skip to content

Detached ACP POST failure closes the shared SSE transport #307

Description

@RGHenderson

Summary

When a detached ACP request POST fails, acp-http-client calls failReadable(error). This closes the shared readable stream and aborts the SSE loop, so one request-scoped network failure terminates the entire client connection.

Impact

A transient POST failure—such as a response-header timeout or the server closing that HTTP socket—rejects more than the affected request. Pending and subsequent ACP operations can no longer receive responses over an otherwise healthy SSE connection.

This is especially visible for long-running session/prompt calls because their POST remains open while the agent works.

Expected behavior

For a JSON-RPC request with an ID, a detached POST failure should reject only that matching request. The shared SSE transport should remain usable by later requests.

Notifications have no matching response promise and may continue to treat an unhandled POST failure as transport-fatal.

Reproduction

  1. Initialize an AcpHttpClient and create a session.
  2. Cause the fetch for one session/prompt POST to reject.
  3. Observe that the prompt rejects and the transport's readable stream is closed.
  4. Send another prompt on the same client; it cannot complete over SSE.

Related work

Activity

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

Metadata

Metadata

Assignees

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