cmux NEXT: a finished thought is one quiet 'Thought for 12s' row

Merged
TE
15d ago
+493-123

A finished thought in an agent chat read "Thought I am here": a muted "Thought" and then the thought's own text inline, because only thoughts taller than 140px folded and the rest showed in full. Now every finished thought folds to one quiet row, "Thought for 12s" (an undated or sub-second one reads "Thought"), with none of its text inline; it opens to the full text. This matches Claude Desktop and Codex.

  • Thoughts side by side in one step merge into one row whose time is the sum of theirs (conversation/thoughts.ts mergeThoughts, used by withoutQuietThoughts and toolGroups). This happens, for example, when a call that a permission ask holds out of the transcript sat between them.
  • A quiet thought draws no row: one that's empty or only whitespace, or one under 40 characters that took under a second or has no timestamps. A step that held only quiet thoughts is dropped (withoutQuietThoughts on the pane's source rows, so Find doesn't count text that isn't drawn). The last thought of a working chat is kept, since it may still be streaming and the live "Thinking" line reads it. Changed rows get a fractional version so they draw again once the turn ends.
  • The live side (the shimmering "Thinking" line) is #23081, now merged. This one doesn't touch turns.ts, WorkingFor.tsx or Thinking.tsx.

Debug toggles. agentPane.debug.thoughtFoldThreshold gets a new default, every. The old choices, viewport and codex, bring back the old look (only long thoughts fold, short ones show in full after "Thought"). thoughtHeader "preview" still gives "Thought ". foldLongThoughts is now on unless the app sets data-fold-long-thoughts="off", so the gallery and the dev server draw the shipped default. That changes the Swift attribute builder and its tests (AgentPaneTunables.swift).

Why the thinking text looked odd. acpmux's own Claude driver (cmux-tui/crates/acpmux/src/claude_stdio/inbound.rs) passes no thinking-display flag. It forwards only thinking_delta text as agent_thought_chunk and drops block starts, signature_delta and redacted_thinking. So under display: "omitted", or with redacted thinking, nothing reaches the pane, or at most an empty thought, which now draws no row. Under "summarized", the text is Claude's summary, which can open with a line like "I am here". The "Thought " wording came from our side: an unfolded short thought drew the "Thought" label and then its text. It didn't come from the adapter or from thoughtHeader, which already defaulted to the duration. Both cases are covered: omitted or empty shows no row, and summarized shows a collapsed "Thought for Ns" that opens to the summary.

Gallery: agent-pane.transcript variants thought-row (collapsed), thought-expanded, thoughts-merged and thought-quiet each have a play, and test/transcript-thought.test.ts checks them in Chromium. test/agent-pane-step-rows.test.ts now expects the folded thought as a 26px row that opens to its text.

Changelog

Changed: an agent's finished thinking folds to one quiet "Thought for 12s" line that opens to its text; consecutive thoughts join, and empty or very short ones show nothing.

No capture: the only native file is AgentPaneTunables.swift, where Debug tunable defaults change and nothing is drawn natively. The visible change is webview UI, captured by the gallery variants above (the advisory gallery run).

Observed / Not run

  • Ran: python3 scripts/cmux-next/prepush-gate.py, no new violations. The release-notary checks (scripts/whats-new/test_digest.py, test_validate.py, test_community.py, tests/test_cmux_next_release_notes.py) pass after the highlight got its docs link (1fe60e101ce).
  • CI on a1e17b715c (after merging #23081's folded runs): every webview test that touches thoughts passes: ThoughtRow, TurnRows, thoughts, thoughtTiming, all five transcript-thought plays, agent-pane-step-rows and agent-pane-chat-column. The only red, agent-pane-bottom-stack, isn't related to this PR. 6b2e3c2b65 just merges base again (a conflict in a chat-column test helper).
  • Earlier reds this PR doesn't touch: defaults-snapshot (ChiefPaneTools.swift menu rows), the webviews type check (a warning in test/sidebar-rail-css.test.tsx) and gallery coverage (agent-pane.background-hint#claudeAcp).
  • Not run locally: bun test, bun run check/scripts/web-lint.sh, Swift tests. This Mac refuses heavy work, the fleet step refused the per-file selection env, and the pre-push hook isn't installed in this clone. CI's webviews lint and tests and the Swift CmuxNextAgentPaneTests are the evidence. The red commit 6a0566b84ca (tests only: ThoughtRow.test.tsx, TurnRows.test.tsx) precedes the fix.

Agent session: cosmic-gray

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.