Skip to content

cmux NEXT: long thoughts fold by default; Codex's 140px threshold is a choice - #21661

Merged
teamleaderleo merged 7 commits into
feat-cmux-nextfrom
split/20963-thought-defaults
Oct 18, 2026
Merged

teamleaderleo merged 7 commits into
feat-cmux-nextfrom
split/20963-thought-defaults

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #21660, which is stacked on #21656. This branch includes both. Review only this PR's own commits: e5b2e49db7d6 and 7da4f34c3a36. Land this last.

Long thoughts in the agent chat now fold by default, as Leo asked on 2026-10-18. agentPane.debug.foldLongThoughts defaults to on, so in a new agent tab a long thought streams in the seven-line live viewport (#21660). Once the agent moves on, it folds to "Thought for 12s" (#21656). Turning the toggle off in Debug Settings > Pages still keeps every thought in full.

What counts as long:

  • Live viewport on (the default): a finished thought taller than the 140 px viewport folds, so a thought never grows after it streams. Before this, the threshold was max(400 px, transcript height). In an 800 px pane, a thought between 140 and 800 px streamed clipped, then expanded nearly a screen when it ended.
  • Live viewport off: a new Debug choice, "Long thought fold threshold" (agentPane.debug.thoughtFoldThreshold), decides.

Freeze WINDOW areas: Packages/macOS/CmuxNext (Debug tunables in AgentPaneTunables.swift, including a changed default).

Testing

  • bun test src/agent-session/acpmux/conversation/ThoughtRow.test.tsx passes, 19 tests. They include:
    • In an 800 px pane, a 300 px thought clipped while streaming folds once done. This test fails without 7da4f34c3a36's change, as e5b2e49db7d6 has it. Next to it, a 140 px thought stays in full and a 141 px one folds.
    • A thought over a minute reads "Thought for 1m 5s".
    • With the live viewport off, the 400 px and transcript-height rule holds, and codex folds past 140 px.
  • bun run check in webviews/ passes, and lint-ios-package-conventions.sh --namespace-fix is clean.
  • Added but not run here (Linux, no Swift; CI runs it): AgentPaneThoughtTunablesTests.swift checks each tunable's defaultValue, including the fold being on, plus the threshold's key and its codex attribute.
  • CI skips the webview tests until the base-red check:text-focus on feat-cmux-next is fixed.
  • Localization: no new user-facing strings in the page.

Changelog

Changed: A long reasoning trace in agent chat folds to "Thought for 12s" once the agent moves on

🤖 Generated with Claude Code

teamleaderleo and others added 3 commits October 18, 2026 13:48
A long thought folded once done (#20948, Debug toggle
agentPane.debug.foldLongThoughts) now reads how long the agent thought,
from its first chunk to its latest, clamped at zero for out-of-order
events. An undated thought, or one under a second, reads "Thought".

#20948's "Thought" plus first line stays as the Debug choice
agentPane.debug.thoughtHeader = preview, which the app sets on <html> as
data-thought-header. New string tools.thoughtFor in all 21 pane locales
(split from #20963).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the long-thought fold on (agentPane.debug.foldLongThoughts), a thought
taller than 140px that is still streaming reads "Thinking" and holds a
fixed 140px viewport (Codex's 8.75rem) with its newest line at the bottom
and older lines fading out over 16px. Once done it folds as before; the
fold measures the text's whole height, not the clip.

Debug toggle agentPane.debug.liveThoughtViewport, on by default; off sets
data-live-thought-viewport="off" and the thought streams in full (split
from #20963).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a choice

agentPane.debug.foldLongThoughts is now on by default (Leo 2026-10-18):
a finished long thought folds to "Thought for 12s" in new agent tabs.
Off still keeps every thought in full.

A new Debug choice, agentPane.debug.thoughtFoldThreshold, picks what
"long" means: viewport (default, #20948: taller than the transcript,
never under 400px) or codex (taller than seven lines, 140px), which the
app sets on <html> as data-thought-fold-threshold="codex" (split from
#20963).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Receipt for 81b7d63 (this PR's head; a new push replaces it)

  • Visual review: HQ feed card · gallery before/after runs
  • Checks: this head
  • App of this head (app.zip, kept 1 day): gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr21661 -f ref=split/20963-thought-defaults -f platform=macos -f backend_mode=local

@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5c8215f3-7e9f-47f4-8f55-057ea3340fe1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

red: web / Web status; do not merge until green; see lane-rules
red: web / react-apps-check; do not merge until green; see lane-rules
red: web / react-apps-check (2); do not merge until green; see lane-rules

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-vedm2 created for this PR by the cmux coordinator.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Unclear: web / react-apps-check (2) failed: no known signature; failed step: Test webviews.

CI failed on 81b7d63930 (run 39173320257 attempt 2): 2 unknown.
macOS jobs did not run: compile and app tests were skipped: Fast static checks skipped.

Job Verdict Why
web / react-apps-check (2) unknown no known signature; failed step: Test webviews
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Not re-run automatically: web / react-apps-check (2), web / react-apps-check are not machine failures.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

CI fast guards failed on 81b7d63930 (https://github.com/manaflow-ai/cmux/actions/runs/39173320257). It does not block the merge; a red guard merged into main breaks it for every open PR.
The log named no failed step; see the run.

Agents: python3 scripts/ci/guard_attribution.py fix applies the mechanical fixes locally. This comment is updated in place on each push.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

react-apps-check (1) and (2) fail on the same base-red check:text-focus problem as #21656 and #21660 (CmuxNextDaemonRecovery/DaemonRecoveryControls.swift:98, from #20765). That failure stops the job before Test webviews, so the webview tests haven't run here and need a rerun once the base is fixed. The other 92 checks pass.

🤖 Generated with Claude Code

The fold threshold was max(400px, transcript height), so in an 800px pane
a thought between 140px and the pane's height streamed clipped to the
live viewport and then grew to nearly a screen when it ended. While
agentPane.debug.liveThoughtViewport is on, a finished thought taller than
the 140px viewport now folds, so nothing grows after it streams;
agentPane.debug.thoughtFoldThreshold counts only with the live viewport
off. Review finding on #21661.

Also: a test for the minutes label ("Thought for 1m 5s"), and the Swift
tests check each tunable's defaultValue rather than its stored value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 18, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Closing and reopening to start a fresh CI run on the current base: #21679 fixed the base check:text-focus red, and a plain rerun would reuse the old merge commit. Head unchanged.

@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 18, 2026 15:54 — with GitHub Actions Inactive
@blacksmith-sh

blacksmith-sh Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Found 4 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp0t_8pcg9/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmph7ufrss2/summary-missing.json (live):/summary-missing.json (live): View Logs
test/narrow-layouts.test.ts/narrow-layouts.test View Logs
test/narrow-layouts.test.ts/narrow-layouts.test View Logs

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

… as a squash)

# Conflicts:
#	Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentPaneTunables.swift
#	Packages/macOS/CmuxNext/Tests/CmuxNextAgentPaneTests/AgentPaneThoughtTunablesTests.swift
#	webviews/src/agent-session/acpmux/conversation/ThoughtRow.test.tsx
#	webviews/src/agent-session/acpmux/conversation/ThoughtRow.tsx
#	webviews/src/agent-session/acpmux/conversation/conversation.css
@cursor

cursor Bot commented Oct 18, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

… as a squash)

# Conflicts:
#	Packages/macOS/CmuxNext/Sources/CmuxNextAgentPane/AgentPaneTunables.swift
#	Packages/macOS/CmuxNext/Tests/CmuxNextAgentPaneTests/AgentPaneThoughtTunablesTests.swift
#	webviews/src/agent-session/acpmux/conversation/ThoughtRow.test.tsx
#	webviews/src/agent-session/acpmux/conversation/ThoughtRow.tsx
@cursor

cursor Bot commented Oct 18, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo
teamleaderleo merged commit 5e7966c into feat-cmux-next Oct 18, 2026
157 of 173 checks passed
@teamleaderleo
teamleaderleo deleted the split/20963-thought-defaults branch October 18, 2026 23:23
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

teamleaderleo added a commit that referenced this pull request Oct 20, 2026
…rows

Base built its own design for the transcript features this PR touched:
long thoughts fold behind Debug toggles (#20948, #21656, #21661) and
Codex-style tool runs build on ToolRun (#20969). This merge takes base's
side in every conflict (ThoughtRow, TurnRows, turns, direct, model, the
permission panel, the transcript gallery), keeps ToolRun.tsx and
toolRunSummary.ts, drops the generated string tables (build output since
#21970), and adds this PR's new catalog strings beside base's. The
redesign on base's architecture follows in the next commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo added a commit that referenced this pull request Oct 20, 2026
…or lists every step (red)

On base's ThoughtRow fold (#20948, #21656, #21661): by default every done
thought folds to its "Thought for Ns" line, a streaming one reads
"Thinking", and a thought sent as one chunk lasts until the next step
starts. The Debug choices viewport and codex keep folding only long ones.

On base's tool runs (#20969): a live turn's Codex-style run still folds
under ToolRun, while an open "Worked for" lists every step unless the new
Debug toggle agentPane.debug.workedForFoldsRuns folds it again.

transcript-live-runs gives its calls ids apart from their titles: a title
equal to the call's id now reads as no title (toolKinds.ts isCallId).
agent-pane-step-rows goes back to base's: without the app's fold
attribute a thought shows in full.

Red at this commit: bun test ThoughtRow.test.tsx TurnRows.test.tsx
transcript-live-runs transcript-row-thought transcript-worked-steps:
25 pass, 10 fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant