After Stop, the step's Thinking indicator keeps animating: a thought the abort cut off is never cleared #174

Closed
opened 2026-10-16 14:16:02 -04:00 by cmoriarty · 1 comment
Owner

After Stop run on run 66, agent.summarize read interrupted: a grey ■, "Summarise the change — interrupted", and the reason "stopped with the run". Below that card, though, the orange Thinking indicator went on animating. It was still animating after trogdor was powered off and the status light read Backend down. A step that has ended, on a backend that is off, cannot be thinking.

After Stop: agent.summarize reads interrupted, and Thinking still animates below it

Cause

The animated row is not drawn from the step's state. It is the console's live buffer of the part the model is writing: stream B's deltas, held in deltaStore (ui/src/state/store.ts) and drawn by LiveText → ThinkingIndicator (ui/src/components/Transcript.tsx, Reasoning.tsx).

A live part leaves that buffer in only two ways (ingest, store.ts):

  • its settling event arrives on stream A: an oc.part.reasoning or oc.part.text with time.end (partEnds);
  • for a subagent's part, its session's oc.child.ended.

A Stop aborts the step's own session in the middle of a thought, so the part is never settled. Run 66's agent.summarize on production shows it:

  • seq 274628 is oc.part.reasoning for prt_145c29767001qiIybEr3gnAOjA, with time.start only;
  • seq 274631 is osf.step.interrupted, and 274632 osf.attempt.closed;
  • no event with time.end for that part ever arrives. It is the only one of the step's six reasoning parts never settled.

Nothing for the step clears the buffer either. Neither osf.step.interrupted, osf.attempt.closed, nor stream B's own end frame (sent once none of its steps is writing, ui/src/lib/sse.ts only stops reading) drops the step's entry. So the indicator stays until the page is reloaded: stream B is not replayed, and the settled transcript draws no live row.

The same holds for every way a step's session ends mid-part: a Stop on the step or the run, a time-out, a context-budget abort, or osfd restarting. A text part cut off the same way would leave its half-written answer on screen as live text.

Fix

  • When a step's attempt closes (osf.attempt.closed), or the step leaves running for any reason, drop every live entry for that step from deltaStore: byStep and every bySession entry with its stepId. Its subagents' sessions end with it.
  • Treat stream B's end frame the same way, for the steps it names. That covers a client that missed the closing event.
  • In the settled transcript, a reasoning part whose attempt closed without settling it reads as a cut-off thought, in the muted tone #152 uses for an interrupted step, not as nothing.

Done when

  • A vitest on the store: live reasoning deltas for a step, then osf.attempt.closed (and, separately, an end frame), and the step has no live entry left.
  • A Playwright spec on the fixture: a step streaming a thought is interrupted, and [data-thinking-indicator] disappears without a reload. The fixture's run_stopped (ui/dev/fakeosfd.py, from #152) can carry the unsettled part.
  • On production: a Stop during a step's thought leaves no Thinking indicator after the step reads interrupted.

Related: #152 (an operator's Stop reads interrupted) and #173 (the message box under an interrupted step).

After **Stop run** on run 66, `agent.summarize` read **interrupted**: a grey ■, "Summarise the change — interrupted", and the reason "stopped with the run". Below that card, though, the orange **Thinking** indicator went on animating. It was still animating after trogdor was powered off and the status light read **Backend down**. A step that has ended, on a backend that is off, cannot be thinking. ![After Stop: agent.summarize reads interrupted, and Thinking still animates below it](https://forgejo.underthere.xyz/attachments/dac04a1b-ff3d-44ea-8f3a-dc086a09e0df) ## Cause The animated row is not drawn from the step's state. It is the console's live buffer of the part the model is writing: stream B's deltas, held in `deltaStore` (`ui/src/state/store.ts`) and drawn by `LiveText` → `ThinkingIndicator` (`ui/src/components/Transcript.tsx`, `Reasoning.tsx`). A live part leaves that buffer in only two ways (`ingest`, `store.ts`): - its settling event arrives on stream A: an `oc.part.reasoning` or `oc.part.text` with `time.end` (`partEnds`); - for a subagent's part, its session's `oc.child.ended`. A Stop aborts the step's own session in the middle of a thought, so the part is never settled. Run 66's `agent.summarize` on production shows it: - seq 274628 is `oc.part.reasoning` for `prt_145c29767001qiIybEr3gnAOjA`, with `time.start` only; - seq 274631 is `osf.step.interrupted`, and 274632 `osf.attempt.closed`; - no event with `time.end` for that part ever arrives. It is the only one of the step's six reasoning parts never settled. Nothing for the step clears the buffer either. Neither `osf.step.interrupted`, `osf.attempt.closed`, nor stream B's own `end` frame (sent once none of its steps is writing, `ui/src/lib/sse.ts` only stops reading) drops the step's entry. So the indicator stays until the page is reloaded: stream B is not replayed, and the settled transcript draws no live row. The same holds for every way a step's session ends mid-part: a Stop on the step or the run, a time-out, a context-budget abort, or osfd restarting. A text part cut off the same way would leave its half-written answer on screen as live text. ## Fix - When a step's attempt closes (`osf.attempt.closed`), or the step leaves `running` for any reason, drop every live entry for that step from `deltaStore`: `byStep` and every `bySession` entry with its `stepId`. Its subagents' sessions end with it. - Treat stream B's `end` frame the same way, for the steps it names. That covers a client that missed the closing event. - In the settled transcript, a reasoning part whose attempt closed without settling it reads as a cut-off thought, in the muted tone #152 uses for an interrupted step, not as nothing. ## Done when - A vitest on the store: live reasoning deltas for a step, then `osf.attempt.closed` (and, separately, an `end` frame), and the step has no live entry left. - A Playwright spec on the fixture: a step streaming a thought is interrupted, and `[data-thinking-indicator]` disappears without a reload. The fixture's `run_stopped` (`ui/dev/fakeosfd.py`, from #152) can carry the unsettled part. - On production: a Stop during a step's thought leaves no Thinking indicator after the step reads interrupted. Related: #152 (an operator's Stop reads interrupted) and #173 (the message box under an interrupted step).
Author
Owner

Shipped in 74e261c (change stop-and-resume-read-calmly, commit 684779a), live since 21:30Z on 2026-10-16.

  • When a step's attempt closes (osf.attempt.closed), the console drops that step's live parts, its subagents' included, and ignores late deltas for them. The same happens when the live stream ends for the step. So a Stop, a time-out, a budget abort or an osfd restart no longer leaves a Thinking row animating.
  • Checked on production in run 67. Stop was pressed on openspec.apply.solo at 22:04:05Z while text streamed. The row read interrupted within 2 s ("stopped by the operator; 4/6 tasks done"). No live text was left at 2, 10 or 30 s, without a reload.
  • Tests: two store tests, and a browser spec with an unsettled thought cut off by a Stop.

The change is archived in the next push. Closing.

Shipped in 74e261c (change `stop-and-resume-read-calmly`, commit 684779a), live since 21:30Z on 2026-10-16. - When a step's attempt closes (`osf.attempt.closed`), the console drops that step's live parts, its subagents' included, and ignores late deltas for them. The same happens when the live stream ends for the step. So a Stop, a time-out, a budget abort or an osfd restart no longer leaves a Thinking row animating. - Checked on production in run 67. Stop was pressed on `openspec.apply.solo` at 22:04:05Z while text streamed. The row read interrupted within 2 s ("stopped by the operator; 4/6 tasks done"). No live text was left at 2, 10 or 30 s, without a reload. - Tests: two store tests, and a browser spec with an unsettled thought cut off by a Stop. The change is archived in the next push. Closing.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid#174
No description provided.