Skip to content

Backport: fix: prevent Chat resume-stream onFinish errors when requests overlap#17258

Merged
github-actions[bot] merged 4 commits into
release-v6.0from
backport-pr-16620-to-release-v6.0
Jul 14, 2026
Merged

Backport: fix: prevent Chat resume-stream onFinish errors when requests overlap#17258
github-actions[bot] merged 4 commits into
release-v6.0from
backport-pr-16620-to-release-v6.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

This is an automated backport of #16620 to the release-v6.0 branch. FYI @lgrammel

…#16620)

## Background

Overlapping chat requests could clear the shared active response before
a resume-stream request reached its finally block, causing onFinish
handling to log a TypeError in development.

## Summary

Chat.makeRequest now keeps a request-local active response for finish
handling and only clears the shared activeResponse when it still belongs
to the finishing request.

## Testing

Kept the focused regression test covering an overlapped resumeStream and
sendMessage request where activeResponse is cleared before the resume
stream finishes.

## Related Issues

Fixes #15668

Co-authored-by: alexanderjacobsen
<[email protected]>
@github-actions
github-actions Bot merged commit 6ace546 into release-v6.0 Jul 14, 2026
48 checks passed
@github-actions
github-actions Bot deleted the backport-pr-16620-to-release-v6.0 branch July 14, 2026 22:02
@github-actions

Copy link
Copy Markdown
Contributor Author

🚀 Published in:

Package Version
ai 6.0.227 github npm
@ai-sdk/alibaba 1.0.39 github npm
@ai-sdk/angular 2.0.228 github npm
@ai-sdk/baseten 1.0.64 github npm
@ai-sdk/cerebras 2.0.67 github npm
@ai-sdk/deepinfra 2.0.65 github npm
@ai-sdk/fireworks 2.0.69 github npm
@ai-sdk/google-vertex 4.0.162 github npm
@ai-sdk/huggingface 1.0.63 github npm
@ai-sdk/langchain 2.0.235 github npm
@ai-sdk/llamaindex 2.0.227 github npm
@ai-sdk/mistral 3.0.50 github npm
@ai-sdk/moonshotai 2.0.37 github npm
@ai-sdk/openai-compatible 2.0.61 github npm
@ai-sdk/react 3.0.229 github npm
@ai-sdk/rsc 2.0.227 github npm
@ai-sdk/svelte 4.0.227 github npm
@ai-sdk/togetherai 2.0.66 github npm
@ai-sdk/vercel 2.0.63 github npm
@ai-sdk/vue 3.0.227 github npm
@ai-sdk/xai 3.0.108 github npm

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants