cmux NEXT: a folded long thought reads "Thought for 12s"
A long thought folded by #20948's fold now reads "Thought for 12s", the time from its first chunk to its latest, the way Codex's reasoning trace reads once it ends. A thought that's undated or under a second reads "Thought". The fold itself is still behind the Debug toggle agentPane.debug.foldLongThoughts.
#20948's folded line ("Thought" plus the thought's first line) is kept as a choice. Debug Settings > Pages > "Folded thought header" (agentPane.debug.thoughtHeader) offers duration (the default) or preview. When it's preview, the app sets data-thought-header="preview" on the agent page's <html>, the same way foldLongThoughts sets its attribute. New agent tabs read it.
thoughtDurationinThoughtRow.tsxclamps withMath.max(0, endedAt - startedAt), astoolGroups.tsdoes for tool calls, so out-of-order events never give a negative time.- The comments in
direct.tsandmodel.tsfrom #21630 now namethoughtDuration, which exists as of this PR. - The new string
tools.thoughtFor("Thought for {time}") is in all 21 pane locales. The English is translated; the other locales areneeds_review, like their neighbours. The translations come from #20963.generated/strings.jsonandhome-channels/generated/pane-strings.jsonare regenerated withgen-strings.mjs.
Part of #20963's split. The live viewport and the default-on fold come in later slices.
Freeze WINDOW areas: Packages/macOS/CmuxNext (Debug tunables in AgentPaneTunables.swift), and the agent pane string catalog webviews/src/agent-session/acpmux/Localizable.xcstrings.
Testing
bun test src/agent-session/acpmux/conversation/ThoughtRow.test.tsxpasses, 12 tests. They cover:- a folded thought reading "Thought for 12s" without its text, opened or closed;
- an undated thought, or one under a second, reading "Thought";
- the clamp on out-of-order dates;
- the
previewchoice reading "Thought" plus the first line.
bun run checkinwebviews/passes.gen-strings.mjs --checkis current.lint-ios-package-conventions.sh --namespace-fixis clean.- Localization audit: there's one new user-facing string,
tools.thoughtFor, with all 21 locales in the catalog and in both generated files.check-l10n.shreports no error for the agent pane catalog. The errors it does report are all inCmuxNextSidebar, which this PR doesn't touch. The Debug tunable's title and help are bare English, like every other Debug tunable. - Not run here (Linux):
AgentPaneThoughtTunablesTests.swift, which checks the tunable key, its default, itsdata-thought-headerattribute and its listing in Debug Settings, and the Chromium gallery lanes (no Chromium on this host). CI runs both.
Changelog
none
๐ค Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
A folded long thought now reads "Thought for 12s" โ the time from its first chunk to its latest, the way Codex's reasoning trace reads once it ends. An undated thought, or one under a second, reads "Thought". The branch also carries the merged feat-cmux-next work: evicted terminals show their last frame at once when shown again, workspaces record name provenance, acpmux starts no-ask modes by inherit or an approved preset, and indicators name their state under the static look.
Thought header
agentPane.debug.thoughtHeaderin Debug Settings keeps #20948's "Thought" plus first line as thepreviewchoice alongside thedurationdefault;previewsetsdata-thought-headeron the page's<html>for new agent tabs.- Duration clamps at zero so out-of-order events never show a negative time; new string
tools.thoughtForis in all 21 pane locales.
Merged feat-cmux-next work
- An evicted terminal's last IOSurface is kept volatile (no copy) and shows at once when the terminal is shown again, until its fresh surface draws; GhosttyNextKit is pinned to a19c884fa.
- Workspaces carry
name_sourceandname_revision;rename-workspacegainssource,expected_name_revisionandrelease, with name-pinned and revision-conflict fences. - acpmux starts a no-ask mode when a proven caller session runs that exact mode or a preset the person approved once; refusals name where to approve.
- Under the static look (or Reduce Motion) tabs draw still marks, the attention ring is steady, and every indicator's tooltip and VoiceOver label names its state.