Repository navigation
fix(chat): show the quiet-time notice after a tool call returns - #35880
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the gate now asks the tool log, which already records whether each call returned, instead of the sticky slot state, and hosts that pass nothing keep today's behaviour. Notes
[DESIGN-REVIEWED] 984c7ca Description read[DESCRIPTION-READ] fd205fb001afae626348277de983a0cc1e9e4ab97ae4c1c98abaa9e2ef401f5b That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix targets the real cause: the footer read the sticky What this change shipsInventory (6 items) — 6 justifiedIntent: a person whose turn stalls after a tool call returns sees the "No new output for a while" notice instead of an endless "Thinking…". This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 984c7ca Description read[DESCRIPTION-READ] 53c1fd6f9105050453ec0a4c19e2c7b2e41189cd950bab5883872c30e6892943 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. No new control or wording: an existing notice now shows in one more state, and the screenshots show both states. The blind reader read the notice correctly as "the assistant may be stuck". Notes
[UX-REVIEWED] 984c7ca Description read[DESCRIPTION-READ] 05a4a8a0fa5b60190d6542c07d7d53a80abca8ca98f50c0b991f177ceab605c3 That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: ApproveWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. The footer's stall gate now treats An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
7861a3f to
16d61a5
Compare
|
self-added: yes
|
|
self-added: yes
|
16d61a5 to
ed032ba
Compare
|
Rebased: main moved in website/src/pages/ChatPage.tsx since this head was built (2f7e9f2 -> b2aac45); CI re-running. The previous head's Frontend Lint & Type Check, Build Wheel and Build Desktop runs failed on [operator: bolichen97] |
|
[operator: bolichen97] The auto-approved path named here was fixed in 16d61a5 and carried unchanged into the rebased head: |
The chat footer keeps its "No new output for a while" notice off while the slot reads tool_running, because a tool may rightly run for minutes. The slot is set to tool_running by a tool row and set back only by the next text chunk, so a turn that stalls right after its tool call returned never showed the notice. The footer now also takes allToolCallsReturned over the slot's tool log, which records each call's return, and watches a tool_running turn once every call has returned or was refused. Each call is judged by its newest log entry, the one a result lands on, since an auto-approved call is logged twice under one id. A log at its 100-entry cap may have dropped a call still running, so a full log keeps the old gate. The chat page and split-view panes pass it; other hosts keep the old gate. Closes #10114
ed032ba to
984c7ca
Compare
|
Rebased: main moved in website/src/pages/chat/page/composerHost.ts, website/src/components/useChatPaneDraft.ts and 15 other files beside this PR's since this head was built (b2aac45 -> b677e0d); CI re-running. The previous head's Backend Tests (3.12, 8) and Backend Tests (Windows) (8) failed on [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (8 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: the stall notice is watched once every tool call has returned, with tests.
Problem / Motivation
Goal: A running chat turn that goes quiet right after a tool call returned shows the "No new output for a while" notice, as any other quiet turn does.
The chat footer says "No new output for a while" once a running turn has shown nothing new for 45 seconds, but never while the turn is waiting on a tool. A turn whose tool call has already returned still counts as waiting on the tool until the model sends its next text. So a turn that stalls right after a tool returns keeps the plain "Thinking…" loader forever, which is the dead-or-working question #10114 asked the footer to answer.
Why it matters
Stalls after a tool result are a common shape of a dead turn: the tool finished, the model never answered. Today that turn looks exactly like one still running a long build, so the person either interrupts real work or leaves a dead session spinning. The notice was built for this case and stays silent on it.
Not a goal
What changed (motivation → approach → change)
A turn that goes quiet right after its tool call returned shows "No new output for a while" after 45 seconds, like any other quiet turn. While a call is still running the notice stays off.
The footer turned the notice off whenever the slot read
tool_running. The slot is set totool_runningby a tool row and set back only by the next text chunk, so it cannot tell a call still running from one that already returned.The tool log records each call's return (
sseToolResult,markToolReturned).allToolCallsReturned(toolLog)inChatFooter.tsxreads it: true once every tool call has returned or was refused, false while one is open or still streaming output. Two facts about the log shape that reading:allToolCallsReturnedreads ittool_call_id, the entry the tool pills read toosseToolActivity(store/chat/activity.ts) keeps only the newestTOOL_LOG_CAP(100, inchat/types.ts) entries, so a full log may have dropped a call still runningThe footer takes the result as a
toolsReturnedprop and keeps the notice off fortool_runningonly while it is false. The two hosts that show the notice pass it fromselectSlotToolLog: the chat page (ChatPage.tsxthroughchat/page/ChatTranscriptView.tsx) and split-view panes (components/ChatPane.tsx). A host that passes nothing keeps today's behaviour.Backwards compatibility
Compatible: one optional prop with a default that reproduces the current gate; no stored data, frame or API changes. The tool log keeps the same 100-entry cap, named once.
Removes nothing: the notice only gains one state in which it may show.
Tests
src/test/ChatFooter.test.tsx—allToolCallsReturnedis false for an empty log, an open call and a call still streaming output, true once every call returned or was refused; a call logged twice under one id counts by its newest entry; a log atTOOL_LOG_CAPentries reads false, one entry short of it reads true; withstate="tool_running"andtoolsReturnedthe notice shows afterSTALL_MS.src/test/ChatPane.hydrateBound.test.tsx— through the real reducers: a pane turn with an open tool call stays silent pastSTALL_MS * 2; oncesseToolResultlands and no text follows, the notice shows afterSTALL_MS.Every new test fails on the parent of its fix and passes with it: the two pane and footer tests on the base commit (the notice never appears), the newest-entry and full-log tests on the previous head of this branch.
Determinism: both files run under
--sequence.shufflewith seeds 11, 4242 and 90210 (95/95 each), and the three footer tool-log tests run 3 times in a row (3/3 each). The footer tests are pure-function or fake-timer driven; the pane test drives time with fake timers only.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Captured on the built SPA from this head with the repo's capture harness (stubbed dashboard API and websocket frames shaped as the gateway sends them, no gateway): a running turn makes an auto-approved tool call (its
tool_callframe markedauto, then its row); with the call open for 70 s the footer shows only "Thinking…"; the call returns, no text follows, and 70 s later the footer shows the notice.Screenshots / video
The auto-approved call returned and nothing followed, 70 s later (dark). Before this change this state showed only "Thinking…", as in the frame below it:
While the call is still running, 70 s in, the notice stays off:
Light theme
Related Issues
Closes #10114
Sibling sweep
Swept: git grep -nE "state !== 'tool_running'|=== 'tool_running'" -- website/src
Sibling: website/src/pages/chat/ChatFooter.tsx -- changed here
Sibling: website/src/pages/chat/page/transcriptRendering.tsx -- not affected -- its toolRunning flag only lets a trailing tool row animate; the row decides done from the tool log first (ToolCallLine isDone), so a returned call already draws as done
Sibling: website/src/pages/ChannelPage.tsx -- not affected -- channel agent badges read the agent state the gateway sends, not the chat slot state
Swept: git grep -nE "toolReturned(" -- website/src
Sibling: website/src/hooks/websocket/chatStream.ts -- not affected -- reads the newest tool-log entry for one id, the entry a result lands on
Sibling: website/src/pages/chat/ToolCallLine.tsx -- not affected -- reads the newest entry per id from the tool-row index (
logById)Sibling: website/src/store/chat/messages.ts -- not affected -- the turn-end sweep marks every unreturned entry rejected, duplicates included
Pattern harvest
Not generalizable: the slot's run state is sticky by design (it keeps tool ordering until the next text); only this footer gate read it as "a tool is still running".
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)