Skip to content

fix(ai): settle the stream status when a request ends without a terminal callback - #2965

Merged
openai0229 merged 1 commit into
mainfrom
fix/ai-stream-status-settle
Sep 29, 2026
Merged

openai0229 merged 1 commit into
mainfrom
fix/ai-stream-status-settle

Conversation

@openai0229

Copy link
Copy Markdown
Contributor

An SSE stream could end after a business error payload without onSuccess, onError or onStop, so useSSERequest stayed in LOADING and the assistant bubble kept spinning next to the error that had already arrived.

  • track whether a terminal callback fired and fall back to ERROR in the finally block, only while the request is still the current generation on a mounted component
  • stop the active request when the chunk handler surfaces an error

Reproduced with a Gateway business error (LOCAL_AI_USAGE_LIMIT): before the change the bubble showed the error and the model logo kept spinning; after the change the generation ends and the send button returns to its idle state.

…nal callback

An SSE stream could end after a business error payload without onSuccess, onError or
onStop, so the hook stayed in LOADING and the assistant bubble kept spinning next to
the error that had already arrived.

- track whether a terminal callback fired and fall back to ERROR in the finally block,
  only while the request is still the current generation on a mounted component
- stop the active request when the chunk handler surfaces an error
@openai0229
openai0229 requested review from a team and auenger as code owners September 29, 2026 07:51
@openai0229
openai0229 merged commit dc2b80a into main Sep 29, 2026
18 of 22 checks passed
@openai0229
openai0229 deleted the fix/ai-stream-status-settle branch September 29, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant