Skip to content

fix(ai): Set status to ready when reconnect stream is null #7685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brandonchoe
Copy link

@brandonchoe brandonchoe commented Aug 1, 2025

Background

In the resume-stream flow, an active stream may not exist. In this case, the server returns 204 and the client should move on. However, prior to this fix, the useChat status would remain as "submitted" instead of being reset to "ready".

Summary

This commit addresses the issue by setting status to "ready" before returning early in the makeRequest function.

Verification

To reproduce the issue, call resumeStream when there is no active stream. Make sure your server is returning 204 in this case. If you log the status returned from useChat, you can see that it stays as submitted. It never gets reset back to ready.

With this fix in place, the logs showed status being reset to ready after receiving the 204 from the server.

Tasks

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)
In the resume-stream flow, an active stream may not exist. In this case, the server returns 204 and the client should move on. However, prior to this fix, the useChat status would remain as "submitted" instead of being reset to "ready". This commit addresses this issue by setting status to "ready" before returning early in the makeRequest function.
@brandonchoe brandonchoe changed the title Set status to ready when reconnect stream is null Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant