fix(decopilot): clear stuck run-status spinner when live stream is silent#4186
Open
viktormarinho wants to merge 1 commit into
Open
fix(decopilot): clear stuck run-status spinner when live stream is silent#4186viktormarinho wants to merge 1 commit into
viktormarinho wants to merge 1 commit into
Conversation
…am is silent A fast run's live /stream tail can deliver 0 chunks (the JetStream subject is purged on terminal status before this client's consumer reads it, or a 204 degraded buffer), so no finish chunk ever clears runStatusStage — the chat sticks on "Request received" forever even though the answer is persisted. Reconcile the spinner against the persisted DB client-side: refetchLatestPage self-clears a stuck spinner when it surfaces the turn's reply, a bounded post-POST poll surfaces it when no reconnect ever happens, and a 204 on /stream is now transient (refetch + backoff-reconnect) instead of a permanent dead stream. Scoped to fresh user turns so tool-output/approval continuations are untouched. Adds unit tests (red/green verified) + a black-box e2e. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
What is this contribution about?
The decopilot chat would stick forever on the run-status spinner "Request received — The run was accepted and queued" even though the run completed server-side and the answer was persisted (confirmed read-only on prod: threads terminal,
projected_seqadvanced, assistant parts persisted). Root cause is client stream-delivery, not the backend: a fast run's live/streamtail can deliver 0 chunks — the JetStream subject is purged on terminal status before this client's consumer reads it, or a 204 degraded buffer returns permanently with no reconnect — so nofinishchunk ever clearsrunStatusStage. The fix reconciles the spinner against the persisted DB client-side (all inthread-connection.ts):refetchLatestPageself-clears a stuck spinner when it surfaces the turn's reply; a bounded post-POST poll surfaces it when no reconnect ever happens; and a 204 on/streamis now transient (refetch + backoff-reconnect). It's scoped to fresh user turns via anawaitingMessageTurnguard so tool-output/approval continuations keep the live-stream behavior untouched.Screenshots/Demonstration
N/A — no visual changes; the spinner simply clears instead of hanging. Behavior is covered by an e2e that drives the real browser.
How to Test
bun test apps/mesh/src/web/components/chat/store/thread-connection.test.ts— 3 new cases (refetch-clears, poll-clears, 204-transient), red/green verified against the pre-fix code.packages/e2e/tests/decopilot-spinner-reconcile.spec.tssends a turn with a silent stream, seeds the persisted reply, and asserts the spinner clears + reply renders without a reload (verified locally red on pre-fix / green on fix).Migration Notes
None.
Review Checklist
Summary by cubic
Fixes the Decopilot chat spinner stuck on "Request received" when the live
/streamdelivers no chunks. The client now reconciles against persisted messages and treats 204 responses as transient, so the reply shows and the spinner clears without a reload.refetchLatestPagesurfaces the persisted assistant reply./streamas transient: refetch latest page and retry with backoff.Written for commit ba353e8. Summary will update on new commits.