Skip to content

fix(chat): show the quiet-time notice after a tool call returns - #35880

Merged
bolichen97 merged 1 commit into
mainfrom
fix/10114-stall-after-tool-return
Nov 13, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/10114-stall-after-tool-return

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

  • No change to the notice's wording, its 45-second threshold, or how it looks.
  • No change while a tool call is still running: the notice stays off then, since a tool may rightly run for many minutes.
  • No change to the slot's own run state or to any gateway frame.
  • No change to hosts that do not opt in to the notice (the crew window, embedded chats).

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 to tool_running by 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) in ChatFooter.tsx reads 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:

Fact about the tool log How allToolCallsReturned reads it
An auto-approved call is logged twice under one id, and its result lands only on the newest entry each call is judged by its newest entry per tool_call_id, the entry the tool pills read too
sseToolActivity (store/chat/activity.ts) keeps only the newest TOOL_LOG_CAP (100, in chat/types.ts) entries, so a full log may have dropped a call still running a full log reads false, and that turn keeps today's gate

The footer takes the result as a toolsReturned prop and keeps the notice off for tool_running only while it is false. The two hosts that show the notice pass it from selectSlotToolLog: the chat page (ChatPage.tsx through chat/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 — allToolCallsReturned is 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 at TOOL_LOG_CAP entries reads false, one entry short of it reads true; with state="tool_running" and toolsReturned the notice shows after STALL_MS.
  • src/test/ChatPane.hydrateBound.test.tsx — through the real reducers: a pane turn with an open tool call stays silent past STALL_MS * 2; once sseToolResult lands and no text follows, the notice shows after STALL_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.shuffle with 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_call frame marked auto, 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:

Chat footer under a returned "Read the changelog" tool row: the Thinking loader, then "No new output for a while. Keep waiting, or stop it if it seems stuck." and "Quiet for 1m 10s"

While the call is still running, 70 s in, the notice stays off:

The same turn while the "Read the changelog" call still runs: spinner on the tool row and only "Thinking…" in the footer

Light theme

The returned-call footer with the notice in the 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 12, 2026 15:49
@bolichen97
bolichen97 enabled auto-merge (squash) November 12, 2026 15:49
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 984c7cae2a986e3d4fed65ee164de2e9e8233b3e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The tool log is never cleared between turns, so once a session has made 100 tool calls, allToolCallsReturned always reads false and those sessions never get this fix. Making "every call returned" a per-turn count (or an open-call counter kept by the reducers) would remove that limit.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 984c7cae2a986e3d4fed65ee164de2e9e8233b3e — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The fix targets the real cause: the footer read the sticky tool_running slot state as "a tool is still running". It is tied to #10114, and new tests fail on base.

What this change ships

Inventory (6 items) — 6 justified

Intent: 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.

  1. On the chat page, the notice now shows 45 s after a returned tool call when no text follows — justified
  2. Split-view panes show the same notice in the same state — justified
  3. While any tool call is still open or streaming output, the notice stays off as before — justified
  4. A tool log that is full (100 entries) keeps today's gate, because it may have dropped a running call — justified
  5. The literal 100 in sseToolActivity and its comments becomes the named TOOL_LOG_CAP, which item 4 also reads — justified
  6. New exported allToolCallsReturned and an optional toolsReturned prop that defaults to today's behaviour; it has 2 consumers, ChatPage.tsx and ChatPane.tsx — justified

[FIRST-PRINCIPLES-REVIEWED] 984c7ca

Description read

[DESCRIPTION-READ] 53c1fd6f9105050453ec0a4c19e2c7b2e41189cd950bab5883872c30e6892943

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 984c7cae2a986e3d4fed65ee164de2e9e8233b3e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The notice says "stop it if it seems stuck" but has no Stop button beside it. The blind reader had to guess that "the unlabelled red square far away in the message box" stops the turn. This existed before this PR; a follow-up could add a "Stop" action inline with the notice.
  • In light theme the reader found the grey notice "fainter and … easy to miss" (shot-03). Since it reports a stall, a later change could give it more contrast there.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 984c7cae2a986e3d4fed65ee164de2e9e8233b3e — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 984c7ca

Verdict parsed from the review's SHA-scoped output markers for commit 984c7cae2a986e3d4fed65ee164de2e9e8233b3e.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 984c7cae2a986e3d4fed65ee164de2e9e8233b3e false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 984c7cae2a986e3d4fed65ee164de2e9e8233b3e and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 984c7ca

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 984c7cae2a986e3d4fed65ee164de2e9e8233b3e false-positive: <reason, 20 to 500 characters>

@KiroCrewCaptain

KiroCrewCaptain commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: 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 tool_running as a wait on a tool only while some tool-log call is still open. Checks against the code: the log is cleared on every user message that isn't a steer. Every new call adds an open entry (onToolCall and onToolStatus) before its row arrives. Results land on the newest entry for a call's id, which matches the newest-entry-per-id rule. Old entries are only dropped in sseToolActivity, which cuts the log to exactly 100, and the log only grows after that, so a length of 100 or more safely catches every log that may have dropped a running call. Hosts that pass nothing, and empty or reloaded logs, keep today's behaviour. Unit tests and a pane test through the real reducers cover the change and would fail without it.

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 ed032ba464 · 123 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 12, 2026
@bolichen97
bolichen97 force-pushed the fix/10114-stall-after-tool-return branch from 7861a3f to 16d61a5 Compare November 12, 2026 22:12
@bolichen97

bolichen97 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: a tool log at its cap reads as not returned

  • span=42aaa1d1bd7e Log eviction can hide a still-running tool

fixed in 16d61a5: allToolCallsReturned reads false once the log holds TOOL_LOG_CAP entries (the cap sseToolActivity trims to, now one named constant), so a call the cap dropped can no longer let the footer watch a running turn.
An eviction always leaves the log at the cap or longer until the next turn clears it, so every eviction is covered; such a turn keeps today's gate.
Test: does not trust a tool log full enough to have dropped a running call (red on 7861a3f, green on 16d61a5).
[operator: bolichen97]

@bolichen97

bolichen97 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: each call judged by its newest tool-log entry per tool_call_id

  • span=42aaa1d1bd7e Auto-approval duplicates prevent completion detection

fixed in 16d61a5: allToolCallsReturned judges each call by its newest log entry per tool_call_id, the entry sseToolResult and markToolReturned mark, so the older entry an auto-approved call leaves open no longer holds the check false.
The reducers are unchanged; the tool pills read the same newest entry (toolRowIndex logById). An id-less entry is still judged on its own.
Test: judges each tool call by its newest log entry (red on 7861a3f, green on 16d61a5).
[operator: bolichen97]

@bolichen97
bolichen97 force-pushed the fix/10114-stall-after-tool-return branch from 16d61a5 to ed032ba Compare November 13, 2026 02:33
@bolichen97

Copy link
Copy Markdown
Contributor Author

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 src/pages/chat/AssistantMessage.tsx(683,114): error TS2304: Cannot find name 'GitFork', a file this PR does not touch. Main fixed that in #36124, so this rebase picks up the fix. The PR's change is the same as before (same patch id).

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The auto-approved path named here was fixed in 16d61a5 and carried unchanged into the rebased head: allToolCallsReturned judges each call by its newest tool-log entry per tool_call_id, the entry the result lands on, and ChatFooter.test.tsx covers a call logged twice under one id.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 13, 2026
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
@bolichen97
bolichen97 force-pushed the fix/10114-stall-after-tool-return branch from ed032ba to 984c7ca Compare November 13, 2026 06:44
@bolichen97

Copy link
Copy Markdown
Contributor Author

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 test/test_reply_format_once.py::TestEveryMessageWhereTheBlockCannotBeTakenOut::test_the_table_names_every_selectable_harness (the table was missing mimocode), a backend test this frontend-only PR does not touch; Coverage Gate failed closed on those two shards. Main fixed that test in #36290, so this rebase picks up the fix. Analyze (python) failed while uploading its results, on an API rate limit. The PR's change is the same as before (same patch id).

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 13, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 13, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bolichen97
bolichen97 merged commit b0d4b10 into main Nov 13, 2026
98 of 101 checks passed
@bolichen97
bolichen97 deleted the fix/10114-stall-after-tool-return branch November 13, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard: a streaming turn gives no signal to tell a working stream from a dead one

2 participants