You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the recent fix to the useObject hook in the Vercel AI SDK, the isLoading and stop functionality now work as expected during the streaming process. However, a new issue has been identified: when the stop function is called, the isLoading state remains true instead of switching to false.
To reproduce this issue:
Use the next-openai example from the Vercel AI SDK repository.
Run the application and click the "Generate notifications" button.
While notifications are being generated, click the "STOP" button.
Observe that the stream stops (which is correct), but the loading indicator remains visible, and the "Generate notifications" button remains disabled.
Expected behavior:
When the stop function is called, the isLoading state should immediately become false, hiding the loading indicator and re-enabling the "Generate notifications" button.
Actual behavior:
When the stop function is called, the stream stops, but the isLoading state remains true, leaving the UI in a loading state.
I have recorded a video demonstrating this behavior:
CleanShot.2024-06-28.at.08.42.17.mp4
This issue was identified after the fix for the previous useObject hook issues was implemented. While the stop functionality now correctly interrupts the stream, the UI does not update to reflect that the loading process has ended.
Environment:
Node.js: v20.13.0
Vercel AI SDK versions:
@ai-sdk/openai: 0.0.34
@ai-sdk/react: 0.0.14
ai: 3.2.14
React version: 18.3.1
Next.js version: 14.2.4
AI Provider: OpenAI
This issue impacts the user experience as it leaves the UI in an inconsistent state after stopping the stream. Users may be confused about whether the process has actually stopped and whether they can start a new generation.
This is a follow-up to the previous issue #2122 , which was resolved but led to the discovery of this new problem.
The text was updated successfully, but these errors were encountered:
Description
After the recent fix to the
useObject
hook in the Vercel AI SDK, theisLoading
andstop
functionality now work as expected during the streaming process. However, a new issue has been identified: when thestop
function is called, theisLoading
state remainstrue
instead of switching tofalse
.To reproduce this issue:
next-openai
example from the Vercel AI SDK repository.Expected behavior:
stop
function is called, theisLoading
state should immediately becomefalse
, hiding the loading indicator and re-enabling the "Generate notifications" button.Actual behavior:
stop
function is called, the stream stops, but theisLoading
state remainstrue
, leaving the UI in a loading state.Code example
Additional context
I have recorded a video demonstrating this behavior:
CleanShot.2024-06-28.at.08.42.17.mp4
This issue was identified after the fix for the previous
useObject
hook issues was implemented. While thestop
functionality now correctly interrupts the stream, the UI does not update to reflect that the loading process has ended.Environment:
This issue impacts the user experience as it leaves the UI in an inconsistent state after stopping the stream. Users may be confused about whether the process has actually stopped and whether they can start a new generation.
This is a follow-up to the previous issue #2122 , which was resolved but led to the discovery of this new problem.
The text was updated successfully, but these errors were encountered: