Repository navigation
test(agent): abort matrix for stream unhandled rejections (stacked on #122) - #130
Draft
LukasParke wants to merge 3 commits into
Draft
LukasParke wants to merge 3 commits into
LukasParke wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ers (#113) Covers every stream getter, abort during client tool execution, early break then abort, parallel runs sharing one signal, and getText with and without tools. 7 of the 11 cases fail without the #122 fix; #122's own test covers only getFullResponsesStream. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
Stacked on #122 (fork branch
warun7:fix/unhandled-rejection-on-stream-abort). GitHub can't target a fork branch as a base, so this PR targetsmainand currently includes #122's commits. Once #122 merges, the diff here is only the new test file. Please merge #122 first.What
Adds
packages/agent/tests/unit/stream-abort-unhandled-rejection.test.ts, an 11-case abort matrix for #113. Each case asserts that the consumer rejects and that no process-levelunhandledRejectionfires:getFullResponsesStream,getTextStream,getItemsStream,getReasoningStream,getToolStream,getToolCallsStream,getNewMessagesStream) aborted mid-streambreak, then abortgetText()with and without toolsWhy
#122's test only covers
getFullResponsesStream. The fix lives on the shared broadcaster path, so a regression there would show up on the other getters too. Without the #122 fix, 7 of these 11 cases fail (all four other broadcaster-backed getters, early-break, parallel). With it, all 11 pass.Tests only, so there's no changeset.
Test plan
pnpm install --frozen-lockfile,pnpm typecheck,pnpm lint,pnpm test(1248 agent tests pass)model-result.tstomainlocally: 7/11 cases fail, which confirms the matrix catches the regressionRefs #113, #122
🤖 Generated with Claude Code