[v5.0] reproduction: @ai-sdk/anthropic: messagestart for a different message while the - #18492
Draft
ai-sdk-factory[bot] wants to merge 1 commit into
Draft
[v5.0] reproduction: @ai-sdk/anthropic: messagestart for a different message while the#18492ai-sdk-factory[bot] wants to merge 1 commit into
ai-sdk-factory[bot] wants to merge 1 commit into
Conversation
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
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.
Bug
@ai-sdk/anthropic: message_start for a different message while the previous message is still open is silently merged into one generation, corrupting thinking blocks and failing all subsequent requests
Reproduction
release-v5.0,ai5.0.228 and@ai-sdk/anthropic2.0.93 acceptmsg_secondwhilemsg_firstremains open without emittingInvalidResponseDataError.examples/ai-functions/src/reproduction/issue-18331-anthropic-spliced-message-start.tsobserved both signed reasoning blocks in one completedstreamTextstep, dropped unfinishedtoolu_first, and completed onlytoolu_second; expected behavior is an explicit stream error with no completed corrupted step.message_stopfollowed bymessage_startremained valid, producing two finishes without errors.packages/anthropic/src/issue-18331.test.tsand fixtures underpackages/anthropic/src/__fixtures__/issue-18331-*.chunks.txtpreserve failing Node and Edge coverage for the malformed streams and passing coverage for sequential messages.Relevant Documentation
Related Issues
Reproduces #18331