fix(ui): thinking indicator never clears on a failed task - #408
Merged
arjun-scale merged 1 commit intoAug 25, 2026
Conversation
arjun-scale
marked this pull request as draft
August 24, 2026 22:01
arjun-scale
force-pushed
the
fix/ui-thinking-indicator-stuck-after-rpc-error
branch
4 times, most recently
from
August 25, 2026 01:39
b8ae784 to
c95fdda
Compare
Opening a task whose turn failed showed "Thinking ..." forever. The error toast fired, but the thread still read as though the agent were working, and reloading the page reproduced it every time. `shouldShowThinkingForLastPair` decided purely from this client's in-session RPC state and the message list, and on a cold load neither mentions the failure: no send mutation runs, so `rpcStatus` starts 'idle'; the task subscription's first `onMessagesChange` writes 'success'; and a failed turn leaves a user message with no agent message, so the check fell into its "waiting for first response" branch and returned true indefinitely. The task's own status is the only failure signal available on a cold load, so consult it. Only a running task can be working on a reply, which covers every settled status without enumerating them. prompt-input already made the same RUNNING comparison to decide whether sending is allowed, so extract `isTaskEnded` and share it rather than keeping two spellings of one rule. Covered by a rendering test that reproduces the cold-load shape — a user message, no reply, rpcStatus 'success' as the subscription leaves it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
arjun-scale
force-pushed
the
fix/ui-thinking-indicator-stuck-after-rpc-error
branch
from
August 25, 2026 01:44
c95fdda to
db2c4fb
Compare
arjun-scale
marked this pull request as ready for review
August 25, 2026 16:45
declan-scale
approved these changes
Aug 25, 2026
Contributor
Author
|
Thanks for the review! Merging |
arjun-scale
deleted the
fix/ui-thinking-indicator-stuck-after-rpc-error
branch
August 25, 2026 17:10
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.
Problem
Opening a task whose turn failed shows "Thinking ..." forever. The error toast fires, but the thread still reads as though the agent were working. It happens in two ways:
Screen.Recording.2026-08-24.at.2.48.31.PM.mov
Cause
shouldShowThinkingForLastPairdecided purely from this client's in-session RPC state and the message list. On a cold load neither mentions the failure:rpcStatusstarts'idle', the subscription's firstonMessagesChangewrites'success', and a failed turn leaves a user message with no agent message — so the check fell into its "waiting for first response" branch and returnedtrueindefinitely.The UI already knew the task had failed; the indicator never consulted it.
Fix
Consult the task's own status, the authoritative signal available in both cases:
prompt-input.tsxalready made the sameRUNNINGcomparison to decide whether sending is allowed, so the rule is extracted toisTaskEndedinlib/task-utils.tsand shared rather than spelled two ways. Comparing againstRUNNINGalso covers every settled status — includingDELETED— without enumerating them.Testing
components/task-messages/task-messages.test.tsxrenders the cold-load shape that was broken: a user message, no reply, andrpcStatus: 'success'as the subscription leaves it. Asserts the indicator shows onRUNNINGand hides on every ended status. Removing the fix fails all five hide cases.isTaskEndedis unit-tested for running, ended, and unknown statuses.Also verified manually against a live agent locally whose turns fail — the indicator clears both when the task fails in-session and on a cold reload.
97 tests pass.
npm run typecheck,eslint, andprettier --checkclean.🤖 Generated with Claude Code
Greptile Summary
The PR centralizes task-ended detection and uses authoritative task status to clear the thinking indicator after terminal outcomes.
isTaskEndedhandling to the message view and prompt input.Confidence Score: 5/5
The PR appears safe to merge because no blocking failure remains within the eligible follow-up review scope.
No blocking failure remains.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(ui): thinking indicator never clears..." | Re-trigger Greptile
Context used (3)