-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
fix(ui): webchat run-status-label stuck on "In progress" after model call ends #86939
Copy link
Copy link
Closed
Closed
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug
After a model call completes in the webchat dashboard, the
agent-chat__run-status-labelbriefly shows "Done", then flips back to "In progress" and stays there permanently until page refresh.Root Cause
Race condition between the terminal chat event and the
sessions.list/sessions.changedresponse timing:chatRunStatus = { phase: "done" }, clearschatRunId→ shows "Done" ✓loadSessionsis triggered (refresh after chat) → sendssessions.listRPC to gatewaystatus: "running"because its session store hasn't been updated yet (async write)loadSessionsreplacessessionsResult→ current session row getsstatus: "running"(overwriting the locally-reconciled "done")chatRunStatus = nullisSessionRunActive({status: "running"}) = true→canAbort = true,hasTerminalRunStatus(null) = false→showAbortableUi = true→ "In progress" displayed permanentlyThe same race applies to
sessions.changedevents that arrive after the terminal chat event with stalestatus: "running".Key insight from debugging
isSessionRunActivechecksstatusfirst (line 9-10 ofsession-run-state.ts): ifstatus === "running"it returnstrueregardless ofhasActiveRun.Minimal Fix
In
ui/src/ui/controllers/sessions.ts, afterloadSessionsresponse and in thesessions.changedevent handler, ifchatRunIdis already null (local run ended), force-correct stale server values:Verified
status: "running"from server, nothasActiveRunAffected files
ui/src/ui/controllers/sessions.ts(bothloadSessionsandapplySessionsChangedEventpaths)Related context
ui/src/ui/session-run-state.ts:9-10—isSessionRunActiveprioritizesstatusoverhasActiveRunui/src/ui/views/chat.ts:1069-1070—showAbortableUiforces "in-progress" whencanAbort && !hasTerminalRunStatusui/src/ui/chat/run-lifecycle.ts:5— 5-second toast timer (CHAT_RUN_STATUS_TOAST_DURATION_MS)