Repository navigation
Conversation
…T failures - Treat POST 404/410 (Unknown Acp-Connection-Id) as connection-scoped again so a lost connection closes the transport instead of failing every request. - Skip the synthesized error when the request already settled while its POST was in flight, avoiding two responses for one id. - Drop a multi-byte character split by error body truncation. - Name the error body cap and pass truncate as an option. - Document request-scoped POST failures on createHttpStream. - Add tests for isolation, teardown statuses, notification failures, truncation, and duplicate responses.
benbrandt
marked this pull request as ready for review
October 23, 2026 19:31
benbrandt
enabled auto-merge (squash)
October 23, 2026 19:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A failed HTTP POST for one request could close the shared ACP connection, reject unrelated pending requests, abort all SSE streams, and issue a connection-level DELETE.
This change converts request-scoped HTTP failures into JSON-RPC errors for the originating request, keeping the shared transport usable. Errors retain the HTTP status and response body, capped at the smaller of 8 KiB or
maxMessageBytes. Failed operations are not automatically retried.HTTP 401/403 continue to close the shared connection. This isolation applies to outbound requests; failures sending notifications or responses retain their existing behaviour.
Reproduction
createHttpStreamtransport and JSON-RPCConnection, using a controlled fetch implementation to simulate HTTP responses and SSE streams.session/promptrequest for A and leave its response pending.session/loadrequest for B whose POST returns HTTP 500.Before the fix, both requests rejected with B’s HTTP error, the connection closed, and one DELETE was issued.
After the fix, only B rejected. A completed over SSE, subsequent requests succeeded, and no DELETE was issued.
Validation
npm run checkpassed, including all 490 existing tests.The reproduction was an ad hoc script using the real SDK transport and connection with simulated network responses; no new automated tests were added.