Skip to content

cmux-next: edited files in the chat menu's Changes and the summary's Outputs (hq#2569 item 4) - #22166

Merged
teamleaderleo merged 68 commits into
feat-cmux-nextfrom
fix/next-edited-files-card
Oct 21, 2026
Merged

teamleaderleo merged 68 commits into
feat-cmux-nextfrom
fix/next-edited-files-card

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #22155: it contains #22155's commits, so land that first. Only the last two of this PR's own commits are new (27c092b tests, cfe96e7 fix).

In the cmux NEXT agent pane, a Codex turn that edited files didn't match Codex desktop (manaflow-ai/cmuxterm-hq#2569, item 4). There was no "Edited N files" card on a reopened turn, the chat actions menu had no Changes entry, and the Summary panel said "Outputs: None".

  • Edited-files card: the card and its Settings > Agents > Edited Files Card setting already existed. It never drew on a reopened turn because adoption replayed no edit records. cmux-next: a reopened Codex or Claude chat shows each turn's tool calls #22155 replays them (each file's path, +/- counts and hunks), and with that the card draws "Edited 2 files +4 -1" with one row per file. Its View changes opens the existing changes view with the hunks. No change here beyond the test.
  • Changes in the chat menu: "..." now lists Changes while the chat has changes, even when its header button shows, as the Codex and Claude apps' chat menus do. Before, it was listed only when the button was hidden.
  • Summary Outputs: Outputs lists every file the chat changed. Before, it dropped the last turn's files and listed them only under Changes, so a chat whose one editing turn was the last said "Outputs: None". Changes is now the single row that opens the last turn's diff with its totals. Each Outputs file still opens the changes view at that file.
  • Undo: the card's existing Undo (the host's turn.undo revert, with a confirmation) is unchanged. A reopened Codex turn's edits carry hunks, not full file texts, so Undo isn't offered for them. No new revert path.

Testing

Failing tests first (27c092b), fix in cfe96e7. All on big-red, with CMUX_BROWSER_TESTS=1 bun test in webviews/ and real Chromium:

Observed / Not run

Observed: the red and green browser and jsdom results above, the typecheck, and the lint and verify-local output.
Not run: a cmux NEXT app build or live dogfood. In the browser host, View changes opens the diff in place; in the app it opens beside the chat, and that path was only read, not run.

Risk evidence (high tier)

Review: SHIP at 1d3da29 (cmux-review subagent; correctness first)
Runtime test: cargo test -p acpmux --lib adopt (8 pass) and cargo test -p acpmux --test hub_integration adopt (11 pass) on Huge Blue at 1d3da29; CMUX_BROWSER_TESTS=1 bun test test/sources-files-once.test.tsx (6 pass) on big-red at 1d3da29

Changelog

Fixed: In cmux NEXT, a reopened chat's edited files show in the chat menu's Changes entry and under the summary's Outputs, and the edited-files card draws for reopened Codex turns.

Proof

The browser test drives the pane over the replayed records. No screenshot.

Checklist

  • Behavior changes have added or updated tests
  • Localization: no new or changed strings (Changes reuses header.changes)

🤖 Generated with Claude Code


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


Summary by cubic

A chat adopted into the cmux NEXT agent pane now replays each past turn's tool calls and file edits, so a reopened Codex or Claude turn shows the commands it ran and the files it changed as they appeared live. New work since the last summary is limited to merges of feat-cmux-next; no behavior changes.

Bug Fixes

  • A reopened Codex or Claude turn replays its tool calls as tool_call and tool_call_update records, so its "Worked for" line opens to its commands and edits.
  • A failed or declined Codex edit shows its files but no diffs or counts; an unconfirmed Claude edit's proposed diffs wait for its result before any card or Outputs row counts them.
  • The chat menu now lists Changes while the chat has changes, beside its header button, as the Codex and Claude apps' chat menus do.
  • Outputs lists every file the chat changed, including files only the last turn's checkpoint knows (a shell command or formatter edited them); it previously dropped the last turn's files and said "Outputs: None".
  • A file the last turn changed again opens that turn's diff with its totals, listed once.
  • An Outputs row matches a last-turn file by its exact path first, so a same-named file in another folder keeps its own row and opens its own diff.
  • Replayed Codex hunks are marked as file fragments, so the edited-files card offers no Undo for them; the existing Undo path is unchanged.

Written for commit 0e94a30. Summary will update on new commits.

View guided diff Turn on auto-fix

@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 19, 2026 21:39 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 0e94a30: HQ feed card · gallery before/after runs · checks

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=pr22166 -f ref=fix/next-edited-files-card -f platform=macos -f backend_mode=local

Yours to fix: agent-pane-adopted-tool-calls.test.ts (a file this PR changes), agent-pane-adopted-tool-calls.test.ts (a file this PR changes). Seen on other PRs too (likely flaky): agent-pane-wheel-pass-through.test.ts, agent-pane-wheel-pass-through.test.ts, composer-location-strip.test.ts and 13 more. This PR merged before its CI finished: fix forward on main.

CI failed on 0e94a30cef (run 39535014825 attempt 1): 4 code, 1 unknown.

Job Verdict Why
web / react-apps-check (2) code a web test failed
web / react-apps-check (3) code a web test failed
web / react-apps-check (1) code a web test failed
web / react-apps-check (4) code a web test failed
web / react-apps-check unknown no known signature; failed step: Check webview test shards

Failures:

  • seen on other PRs agent-pane-wheel-pass-through.test.ts chromium > the wheel over a long draft stops at its ends and moves nothing else: failed (job)
  • seen on other PRs agent-pane-wheel-pass-through.test.ts webkit > the wheel over a long draft stops at its ends and moves nothing else: failed (job)
  • seen on other PRs composer-location-strip.test.ts the chat composer at 420 px: the strip's marks line up with the prompt's edges: failed (job)
  • seen on other PRs composer-location-strip.test.ts the chat composer at 760 px: the strip's marks line up with the prompt's edges: failed (job)
  • seen on other PRs composer-turn-cycle.test.ts at 420 px typing while the turn runs moves neither the mic nor Stop: failed (job)
  • seen on other PRs agent-pane-background-tasks.test.ts clicking a background task's end opens its terminal beside the chat: failed (job)
  • seen on other PRs composer-mention.test.ts @ then letters lists the chat's matching files and Return writes the path: failed (job)
  • seen on other PRs composer-mention.test.ts after picking a path markdown escapes, typing on leaves the picker closed: failed (job)
  • seen on other PRs composer-mention.test.ts @proje lists other chats, then folders, then the chat folder's files: failed (job)
  • seen on other PRs composer-mention.test.ts a chat named for a long prompt does not take @app from the file: failed (job)
  • ... 8 more in the job logs
Matched log lines
web / react-apps-check (2): (fail) chromium > the wheel over a long draft stops at its ends and moves nothing else [4062.25ms]
web / react-apps-check (3): (fail) clicking a background task's end opens its terminal beside the chat [944.03ms]
web / react-apps-check (1): (fail) the adopted turn's Worked for opens to its commands and edited files [31068.58ms]
web / react-apps-check (4): (fail) chromium: Full access draws in the model chip's color [2969.73ms]

Not re-run automatically: web / react-apps-check (2), web / react-apps-check (3), web / react-apps-check (1), web / react-apps-check (4), 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.

red: web / Web status; NEW: green on the base af9b006; do not merge until green; see lane-rules
red: web / react-apps-check; no finished base run on af9b006 to compare; do not merge until green; see lane-rules
red: web / react-apps-check (1); no finished base run on af9b006 to compare; do not merge until green; see lane-rules
red: web / react-apps-check (2); no finished base run on af9b006 to compare; do not merge until green; see lane-rules
red: web / react-apps-check (3); no finished base run on af9b006 to compare; do not merge until green; see lane-rules
red: web / react-apps-check (4); no finished base run on af9b006 to compare; do not merge until green; see lane-rules

CI fast guards failed on 94b1359872 (https://github.com/manaflow-ai/cmux/actions/runs/39532485894). 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.

Tour of 0e94a30cef (run): no media. The tour did not run: only webview code changed (13 path(s)), which the gallery advisory run checks in Linux Chromium on the pull request (its artifact holds any captures); add the media-tour-mac label to tour it on a Mac.

@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 2/5

[Medium impact] The changes affect reopened chat history and file-change navigation in the agent pane.

The output deduplication must meet the repository's complexity requirement before merging.

Findings

  1. P0 Large summaries repeatedly scan files ▶
  2. P2 Unfinished patches look applied ▶

Summary

Reopened chats now replay tool calls and edited-file details. The chat menu keeps Changes beside its header button, and Outputs includes the last turn's files.

  • Reopened Codex and Claude chats show the work from each turn.
  • The chat menu and summary give changed files clear places to open.

Review checks were limited to source inspection; no tests or browser captures were run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Saved Codex or Claude transcript] --> B[Parse past turns and tool calls]
  B --> C[Append adopted history]
  C --> D[Edited-files card]
  C --> E[Chat Changes menu]
  C --> F[Summary Outputs]
  F --> G[Open the selected file's changes]
Loading

Reviews (3) · Last reviewed commit: "Merge origin/fix/next-edited-files-card" · Reviewed by Greptile

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

teamleaderleo and others added 8 commits October 19, 2026 19:16
A reopened Codex turn that ran commands and edited two files replays only
its prompt and final answer (hq#2569 item 3). Boundary tests: a Codex
rollout fixture and a Claude Code transcript through adoption, and a pane
browser test over the daemon's own replayed records (generated from the
Rust test; this commit's copy is the base's output, without tool calls).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adopting a chat replayed each past turn as its prompt and final answer
only, so a turn that ran commands and edited files showed the answer and
a Worked for footer that opened nothing (hq#2569 item 3).

adopt_replay now also reads the turn's tool calls (adopt_tools.rs): Codex
item_completed commands, file changes, MCP calls and web searches (and the
older exec_command_end and patch events), and Claude Code tool_use with
its tool_result through the live path's own tool_call builder. replay_adopted
appends each as a tool_call and its settling tool_call_update before the
answer, so the pane folds them under Worked for as it does a live turn's.
A file change keeps each hunk as a diff and names each file with its +/-
counts, for the edited-files card. The settled run's summary counts edited
files rather than edit calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- cargo clippy --fix cmux-tui/crates/acpmux/tests/hub_integration/fork_through.rs

Autofix-Run: https://github.com/manaflow-ai/cmux/actions/runs/39325739748
…whole-file Undo, a multi-file patch counts each file

A reopened chat's failed or declined Codex file change keeps its files and
its error text but no diffs or +/- counts: they never applied. Each
replayed hunk is marked as part of its file (_meta.acpmux.fragment), and the
edited-files card's Undo refuses a fragment. The folded run summary counts a
diff-less edit by the files its input names (toolPaths editedPaths).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Outputs (failing)

A reopened Codex turn that edited two files (hq#2569 item 4): the card
lists each file with its counts and View changes opens the hunks (both
already drawn now that #22155 replays the edits), the chat menu lists
Changes, and the summary's Outputs lists the edited files.

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

The chat actions menu now lists Changes while the chat has changes, beside
its header button, as the Codex and Claude apps' chat menus do. The
summary's Outputs lists every file the chat changed: it used to drop the
last turn's files (listing them only under Changes), so a chat whose one
editing turn was the last said "Outputs: None". Changes is now the one row
that opens the turn's diff with its totals (hq#2569 item 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and a reopened Codex hunk offers no Undo

A file a shell command or formatter edited is in the last turn's checkpoint
but in no tool diff: it is listed under Outputs too and opens that turn's
diff at the file, as its Changes row did. Every Outputs file row is a
summary file row, so the fourteen-file stage reads its files there. The
adopted edited-files card offers no Undo for replayed Codex hunks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo force-pushed the fix/next-edited-files-card branch from a83a298 to f87fcbf Compare October 20, 2026 02:40
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 20, 2026 02:40 — with GitHub Actions Inactive
@blacksmith-sh

blacksmith-sh Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Found 16 test failures on Blacksmith runners:

Failures

Test View Logs
test/agent-pane-adopted-tool-calls.test.ts/agent-pane-adopted-tool-calls.test View Logs
test/agent-pane-adopted-tool-calls.test.ts/agent-pane-adopted-tool-calls.test View Logs
test/agent-pane-background-tasks.test.ts/agent-pane-background-tasks.test View Logs
test/agent-pane-background-tasks.test.ts/agent-pane-background-tasks.test View Logs
test/agent-pane-wheel-pass-through.test.ts/agent-pane-wheel-pass-through.test View Logs
test/agent-pane-wheel-pass-through.test.ts/agent-pane-wheel-pass-through.test View Logs
test/composer-history.test.ts/composer-history.test View Logs
test/composer-history.test.ts/composer-history.test View Logs
test/composer-location-strip.test.ts/composer-location-strip.test View Logs
test/composer-location-strip.test.ts/composer-location-strip.test View Logs

...and 6 more test failures. View all on Blacksmith

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

teamleaderleo and others added 3 commits October 19, 2026 20:43
adopt.rs: keep both the replayed tool-call tests and the base's finished-run reopen tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-edited-files-card

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo and others added 2 commits October 19, 2026 20:47
…turn changed again opens that turn's diff

A Claude Code edit cut off before its result, or refused, changed nothing: its proposed diffs wait
in PastTool.proposed and settle only with a result that did not fail, so the edited-files card and
Outputs never count them. An output the last turn changed again (a shell command after an earlier
edit tool) now opens the last turn's diff with its counts, listed once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
...lastTurn.filter((file) => !changedByTools(file, summary.outputs)).map((file) => ({ file, inTurnDiff: true })),
];
// Two outputs the agent wrote differently (`~/x/a.ts`, `/Users/me/x/a.ts`) are one checkpoint file.
const outputs = rows.filter((row, index) => rows.findIndex((other) => other.file.path === row.file.path) === index);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Large summaries repeatedly scan files

SummaryBody now scans all of rows for every output to remove duplicates. With 1,000 changed files, this can make about 500,000 path comparisons on each render, even without a loaded checkpoint. The repository's Algorithmic Complexity rule forbids nested scans over growing user-owned collections. Use a Set of paths to keep the first row in one pass.

Rule Used: Flag production code that adds nested full-collection scans, per-target rescans for batch actions, repeated sort/filter/map work in hot UI/socket/search/process paths, in-memory joins that belong in the data store, or unbenchmarked slower algorithms ... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +451 to +455
"patch_apply_begin" => {
let id = s(payload, "call_id")?;
Some((
Ok(codex_file_change(id, payload.get("changes")?, "completed", None, at)?),
false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unfinished patches look applied

patch_apply_begin is replayed as a completed edit before patch_apply_end confirms it. If an older Codex process stops between those records, reopening the chat shows the proposed diff and line counts as applied changes. Keep the begin record's edits pending and publish them only after a successful end record, as the Claude replay already does.

teamleaderleo and others added 2 commits October 20, 2026 04:14
… saturate a Codex duration

feat-cmux-next dropped the backdate helper when finished CLI chats began reopening directly
(#22139), so the merged tests no longer compiled. A malformed duration no longer overflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 20, 2026 19:39 — with GitHub Actions Inactive
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 20, 2026 19:55 — with GitHub Actions Inactive
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 20, 2026 20:13 — with GitHub Actions Inactive
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 20, 2026 20:27 — with GitHub Actions Inactive
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

owner: 01a15c03-03d0-7460-8bd4-cc70444781bd

…opted-tool-calls

# Conflicts:
#	cmux-tui/crates/acpmux/src/adopt_replay.rs
#	webviews/src/agent-session/acpmux/conversation/toolRunSummary.ts
@cursor

cursor Bot commented Oct 21, 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 temporarily deployed to cmux-tui-merge-tree October 21, 2026 02:20 — with GitHub Actions Inactive
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 21, 2026 02:47 — with GitHub Actions Inactive
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

owner: 01a15c03-03d0-7460-8bd4-cc70444781bd

@github-actions

Copy link
Copy Markdown
Contributor

Shipped in:

@github-actions

Copy link
Copy Markdown
Contributor

Shipped in:

This branch was previously deployed

3 inactive (2 outdated) deployments
cmux-tui-merge-tree — 0e94a30c Deployed Oct 21, 2026 by teamleaderleo
ci-routing-agent — 8431509b Deployed Oct 20, 2026 by github-actions[bot]
artifacts — 84cb9782 Deployed Oct 20, 2026 by teamleaderleo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-land Reviewed at this head; next-autoland merges it into feat-cmux-next when its only reds are base reds

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant