Skip to content

Agent chat: a turn that ended on work folds its interim text under Worked for (cx-iwqox) - #20582

Merged
teamleaderleo merged 10 commits into
feat-cmux-nextfrom
transcript/worked-fold
Oct 14, 2026
Merged

teamleaderleo merged 10 commits into
feat-cmux-nextfrom
transcript/worked-fold

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When a turn finishes, everything between the prompt and the final answer should fold into one "Worked for Xs" row, as in the Codex and Claude desktop apps. That broke whenever a turn ended on work instead of text. The answer was simply the turn's last text, so:

  • A turn that ran a tool after its last text kept that interim text open as if it were the answer, with the later tool rows drawn unfolded below it.
  • A turn stopped mid-tool (text, tool, Stop) showed no fold at all: its text and tool rows stayed open.
  • An earlier turn without a summary that ended on a tool kept its interim text and tool rows open in the same way.

Now the answer is the last text only when no tool call follows it (decided per call, so a step that edited and then ran something counts as work) (answerAt in conversation/turns.ts, used by both shapeTurn and settledWithoutSummary). Otherwise the whole body folds, and its label reads "Worked for" or "You stopped after", as before. Other rows after the answer keep the answer open, as today: edits still join the turn's edit card, and render cards, plans, subagent groups, background tasks, notices and thoughts after it don't count as work. Running turns are unchanged.

Testing

  • webviews/test/transcript-worked-fold.test.ts (new) drives turnView, the transcript's turn-shaping seam. Covered:
    • answer after work folds the work (control)
    • ended on a tool: everything folds
    • stopped mid-tool: everything folds
    • an edit after the answer still joins the card
    • an earlier turn without a summary that ended on a tool folds
    • expanding shows the interim text and tools in order
    • a step that edits and then runs a command, in one activity row, still folds (added after review)
  • Red on each test commit (4 of 6 fail, then the mixed-step case alone), green on each fix (7/7), and green after merging current feat-cmux-next.
  • Known edges, left as is: a TodoWrite that clears the list after the final text arrives as a plain tool call, so it folds the answer; a render call still pending at turn end counts as work until its update lands.
  • Locally green: the jsdom transcript tests that use turnView (thread-turn-keys, long-chat-updates, range-content, minimap-current, jump-latest, viewport-resize, hidden-follow, scroll-restore, turn-error-details), plus the layers, type-scale, status-glyphs, system-blue and text-focus ratchets.
  • Not run locally: vp check and the browser tests (agent-pane-turn-footer, chat-find). Big-red is under memory pressure; CI runs them on this PR.

Changelog

Fixed: Agent chat folds a finished turn's work under "Worked for" even when the turn ended on a tool or was stopped mid-tool

Proof

Same fixture rendered on base and head through the transcript gallery (Chromium, page only).

before after
ended on a tool (text, tool, text, tool) before after
stopped mid-tool (text, tool, Stop) before after

Before, the interim text stands as the answer with a tool row open below it, and the stopped turn has no fold at all. After, only the fold row shows. Its time now spans the whole turn (36s against 24s, when the fold ended at the interim text). The footer drops Copy because the turn has no answer; before, Copy copied the interim text.

Bead: cx-iwqox

🤖 Generated with Claude Code

teamleaderleo and others added 3 commits October 14, 2026 04:10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rked for

A finished turn's answer was simply its last text, so a turn that went on
to a tool after that text (or was stopped mid-tool) kept the interim text
open as if it were the answer, with the later tool rows drawn unfolded
below it, and a cancelled turn showed no fold at all. The answer is now
the last text only when no tool call follows it; otherwise the whole body
folds, as the Codex and Claude desktop apps fold it. Edits after the answer
still join the turn's card, and render cards, plans, subagent groups and
notices after it leave it open.

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

cursor Bot commented Oct 14, 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.

@coderabbitai

coderabbitai Bot commented Oct 14, 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: 98da8691-9f07-40e1-971c-c535cc9e4d5b

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.

…m text (red)

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

This comment has been minimized.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

all web/size checks green

…t text

Calls after one text segment share an activity row, so the edit exemption
on the whole row kept the interim text as the answer whenever a step edited
and then ran something (the usual Claude Code ending). Work is now decided
per call: any call that is neither an edit nor a render call.

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

cursor Bot commented Oct 14, 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.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

CI fast guards passes on 285bd23a0c (https://github.com/manaflow-ai/cmux/actions/runs/38592594265). This covers only the fast guards, not CI: CI's result is the ci-status check, and the CI failure attribution comment names any failing test.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Passes: CI passes on 285bd23a0c.

CI passes on 285bd23a0c (run 38592594265 attempt 1).

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

Copy link
Copy Markdown
Contributor

cmux-next tour of 819b902f9305945c12789864c882c2949af982ec (run)

The tour job failed before the tour ran (build or setup); the run log has the output.

The tour produced no media.

Tours are data in scripts/cmux-next/media/tours: add a step or a tour file to show your feature.

@github-actions

Copy link
Copy Markdown
Contributor

Gallery

Review in feed

212 states changed: agent-pane.transcript/long-code, agent-pane.artifact-panel/closed, agent-pane.artifact-panel/versions, pages.home-channels/channel, pages.settings/browser-group-8, ... · 4 new states · 47 broken states · 107 play checks failed

Diff page and renders (the run's gallery-pr artifact)

State Before · after
agent-pane.transcript/long-code (Apple System Colors, webkit)
agent-pane.artifact-panel/closed (Apple System Colors, chromium)
agent-pane.artifact-panel/versions (Apple System Colors, chromium)
pages.home-channels/channel (Apple System Colors, chromium)
pages.settings/browser-group-8 (Apple System Colors, webkit)
pages.settings/invalid-search-template (Apple System Colors, webkit)

206 more on the diff page.

Live preview (follows this branch; start it with scripts/gallery-live.sh up <branch> from an hq checkout):

  • agent-pane.transcript/long-code: /wt/transcript-worked-fold/?entry=agent-pane.transcript#/agent-pane.transcript/long-code
  • agent-pane.artifact-panel/closed: /wt/transcript-worked-fold/?entry=agent-pane.artifact-panel#/agent-pane.artifact-panel/closed
  • agent-pane.artifact-panel/versions: /wt/transcript-worked-fold/?entry=agent-pane.artifact-panel#/agent-pane.artifact-panel/versions
  • pages.home-channels/channel: /wt/transcript-worked-fold/?entry=pages.home-channels#/pages.home-channels/channel
  • pages.settings/browser-group-8: /wt/transcript-worked-fold/?entry=pages.settings#/pages.settings/browser-group-8
  • pages.settings/invalid-search-template: /wt/transcript-worked-fold/?entry=pages.settings#/pages.settings/invalid-search-template
  • 136 more on the diff page

Play checks failed (0 px anchor movement, 0 layout shift, no frame over 33 ms unless the entry gives a reason):

  • agent-pane.artifact-panel/versions (Apple System Colors, chromium): play: no element for button "Open preview"
  • agent-pane.artifact-panel/html (Apple System Colors Light, webkit): play: no element for button "Open preview"
  • agent-pane.artifact-panel/versions (Apple System Colors Light, chromium): play: no element for button "Open preview"
  • agent-pane.artifact-panel/markdown (Apple System Colors Light, chromium): play: no element for button "Open preview"
  • agent-pane.new-chat-no-shift/send-to-streaming (Apple System Colors, webkit): step 2 press Enter: anchor .acpmux-model moved 32.0 px (limit 1); anchor .acpmux-context moved Infinity px (limit 1)
  • agent-pane.new-chat-no-shift/send-to-streaming (Apple System Colors Light, webkit): step 2 press Enter: anchor .acpmux-model moved 53.4 px (limit 1); anchor .acpmux-context moved Infinity px (limit 1)
  • 600 more on the diff page

701 nondeterministic states differed from a second render of the same head (a clock or fixture leak) and are not counted as changes.

6584 unchanged · base 2834e65 · head 819b902

teamleaderleo and others added 5 commits October 14, 2026 05:53
- vp fmt webviews/src/pages/home-channels/AttachmentViews.tsx
- vp fmt webviews/src/pages/home-channels/Composer.tsx
- vp fmt webviews/src/pages/home-channels/HomeChannelsPage.tsx
- vp fmt webviews/src/pages/home-channels/attachmentService.ts
- vp fmt webviews/src/pages/home-channels/icons.tsx

Autofix-Run: https://github.com/manaflow-ai/cmux/actions/runs/38580078309
# Conflicts:
#	webviews/src/pages/home-channels/AttachmentViews.tsx
#	webviews/src/pages/home-channels/HomeChannelsPage.tsx
@teamleaderleo
teamleaderleo merged commit 9f108cd into feat-cmux-next Oct 14, 2026
95 of 107 checks passed
@teamleaderleo
teamleaderleo deleted the transcript/worked-fold branch October 14, 2026 16:55
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