Skip to content

A stopped turn's work never folds, even after the thread resumes and moves on #46438

Done

Description

@the-snesler

What happened

Normally a finished turn's intermediate work (tool calls, reasoning, progress messages) folds under a "Worked for …" row. A turn that the user stops never folds. Its work stays fully expanded permanently, even after the thread is resumed and later turns complete and fold normally.

In a long agent session that was stopped and then resumed, the whole pre-stop turn (dozens of commands, reasoning and progress updates) stays inline above the "Run interrupted · Stopped by user" divider. Directly below it, the resumed turn folds correctly as "Worked for 21m 58s". This makes the conversation history very long and hard to scroll.

Diagnosis

deriveTurnFolds in apps/web/src/components/chat/MessagesTimeline.logic.ts collects every run that has a run_interrupt_request or run_interrupt_result event into interruptedRunIds (around L1096–1110). It then skips folding for any run in that set (around L1194–1199):

if (
  input.unfoldedRunIds.has(runId) ||
  interruptedRunIds.has(runId) ||
  ...
) {
  continue;
}

The exclusion has no condition: it doesn't check whether the run is the latest one or whether newer turns came after it. So once a run has been stopped, it stays itemized forever.

Keeping a turn expanded right after a stop is reasonable, so the user can see where it stopped. But the same function also builds a "You stopped after {duration}" label (isLatestInterruptedTurn) for a folded stopped turn. That suggests stopped turns were meant to fold. A real stop always writes an interrupt event, so this exclusion stops that label from ever being used. The unit test "uses latest-turn timings and the stopped label for an interrupted latest turn" only passes because its data has no interrupt event.

Possible fix: only keep a stopped run unfolded while it is the latest run, or while the interrupt is still in progress. Once a newer turn starts, fold it like any other turn, using the "You stopped after …" label.

Steps to reproduce

  1. Start a turn that does a fair amount of tool work.
  2. Stop it partway through (Stop button). The "Run interrupted · Stopped by user" divider appears.
  3. Resume the thread, or send a new message, and let that turn finish.
  4. Expected: the stopped turn's work folds (e.g. "You stopped after Xm") like any other finished turn. Actual: all of its work stays expanded inline. Only the new turn folds.

Version

0.1.14-nightly.20261130.5465 (desktop app and local server). The same logic is still present on main as of 2026-11-30.

Environment

  • T3 Code Desktop 0.1.14-nightly.20261130.5465, connected to its local server
  • macOS (darwin arm64)
  • Provider: Claude

Evidence

  • Screenshot of a stopped and resumed thread, with the pre-stop turn fully expanded above "Run interrupted" and the resumed turn folded as "Worked for 21m 58s" (attached below).
image
  • Code: apps/web/src/components/chat/MessagesTimeline.logic.ts, deriveTurnFolds, the interruptedRunIds set and its use in the fold-skip condition.

Related issues

None found for stopped turns not folding. Related but separate: #42838 and #41320 (both about steers and folding).

Fix applied or workaround

None. There is no setting that folds stopped turns.

Filed by

Triage session in T3 Code, using Claude Code (Claude Opus 5.5, claude-opus-5-5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions