cmux NEXT: a long live thought streams in Codex's seven-line viewport
Stacked on #21656. This branch includes #21656's commit. Review only the top commit, 6a72fb7a30b0, and land this after #21656.
When the long-thought fold is on (agentPane.debug.foldLongThoughts), a thought taller than 140 px that's still streaming now reads "Thinking" with the existing shimmer. It holds a fixed 140 px viewport, which is seven of its 20 px lines and the 8.75rem Codex gives a live reasoning trace. The newest line sits at the bottom, and older lines fade out at the top over 16 px. Once the agent moves on, the thought folds as before. A thought no taller than 140 px streams in full after "Thought".
- The fold's measurement now takes the larger of the drawn height and the text's whole height (
scrollHeight). Without that, a thought clipped to 140 px would measure 140 and never fold. - A Debug toggle in Debug Settings > Pages, "Live thought viewport" (
agentPane.debug.liveThoughtViewport), is on by default. When it's off, the app setsdata-live-thought-viewport="off"on<html>and a long thought streams in full, as onfeat-cmux-nexttoday. It only applies while the fold is on. - A thought between 140 px and the fold threshold (about one transcript viewport, never under 400 px) streams clipped, then shows in full once done, because it's too short to fold. The threshold choice comes in the next slice.
Freeze WINDOW areas: Packages/macOS/CmuxNext (Debug tunables in AgentPaneTunables.swift).
Testing
bun test src/agent-session/acpmux/conversation/ThoughtRow.test.tsxpasses, 16 tests. The new tests cover:- a long streaming thought holding the viewport and reading "Thinking";
- a 140 px thought streaming in full;
- either toggle off meaning no viewport;
- a clipped thought (140 px drawn, 900 px of text) still folding once done. That one fails without the whole-height measurement.
bun run checkinwebviews/passes, andlint-ios-package-conventions.sh --namespace-fixis clean.- Added but not run here, because this Linux host has no Chromium or Swift (CI runs them):
agent-pane-chat-column.test.ts: a live long thought's text box is 140 px, with its last line in view and its first line above it. With the toggle off, it's taller than 600 px.AgentPaneThoughtTunablesTests.swift: the toggle's key, its default, and itsoffattribute.
- Localization: no new user-facing strings. "Thinking" is the existing
thinkingkey.
Changelog
none
š¤ Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
With the long-thought fold on, a thought taller than 140 px that's still streaming reads "Thinking" and holds a fixed seven-line viewport, keeping its newest line in view and fading older lines out at the top. Once the agent moves on, it folds as before. A folded thought now reads "Thought for 12s" instead of a preview of its text.
- The fold measures the text's whole height, so a thought clipped by the live viewport still folds once done.
- A Debug toggle, "Live thought viewport" (
agentPane.debug.liveThoughtViewport), is on by default; off streams the thought in full. - A Debug choice, "Folded thought header" (
agentPane.debug.thoughtHeader), keeps the old preview style on "preview"; "duration" (default) adds the newtools.thoughtForstring in all 21 pane locales.
Picked up from feat-cmux-next via merges
- An evicted terminal now shows its last presented frame at once when shown again.
- The status indicator gains a static look covering tabs, the attention ring, and the agent pane.
- Workspaces record name source and revision; auto-renames never replace a person's name unless released.
acpmuxallows no-ask start modes when a caller session inherits the mode or a person approved the preset.