Repository navigation
cmux-next: edited files in the chat menu's Changes and the summary's Outputs (hq#2569 item 4) - #22166
Conversation
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Yours to fix: CI failed on
Failures:
Matched log linesNot re-run automatically: Written by red: web / Web status; NEW: green on the base af9b006; do not merge until green; see lane-rules
Agents: Tour of |
[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. FindingsSummaryReopened 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.
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]
Reviews (3) · Last reviewed commit: "Merge origin/fix/next-edited-files-card" · Reviewed by Greptile |
|
Bead |
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>
a83a298 to
f87fcbf
Compare
|
Found 16 test failures on Blacksmith runners: Failures
...and 6 more test failures. View all on Blacksmith
|
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>
…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); |
There was a problem hiding this comment.
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!
| "patch_apply_begin" => { | ||
| let id = s(payload, "call_id")?; | ||
| Some(( | ||
| Ok(codex_file_change(id, payload.get("changes")?, "completed", None, at)?), | ||
| false, |
There was a problem hiding this comment.
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.
… 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>
|
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
Bugbot needs on-demand usage enabledBugbot 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. |
|
owner: 01a15c03-03d0-7460-8bd4-cc70444781bd |
|
Shipped in:
|
|
Shipped in:
|
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".
turn.undorevert, 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 testinwebviews/and real Chromium:test/agent-pane-adopted-edited-files.test.ts(new). It loads acpmux's own replay of a Codex rollout (the fixture cmux-next: a reopened Codex or Claude chat shows each turn's tool calls #22155's Rust adoption test writes) into the pane's dev entry over a stand-in daemon. It checks the card's title and per-file rows, that View changes draws the hunks, that the chat menu lists Changes, and that Outputs lists both files with counts.test/chat-header-fold.test.tsxandtest/sources-files-once.test.tsx, updated for the new menu and Outputs behavior.sources-files-oncetests, and the firstchat-header-foldtest). The card test already passes there because cmux-next: a reopened Codex or Claude chat shows each turn's tool calls #22155 supplies the records.agent-pane-adopted-tool-calls.test.tsfrom cmux-next: a reopened Codex or Claude chat shows each turn's tool calls #22155 and the summary tests.bun run typecheckpasses.bun run lintreports 0 errors and 3 warnings, all insrc/motion/files this PR doesn't touch.scripts/verify-local.py --affected origin/feat-cmux-next: 9 of 10 checks pass.localizationfails onneeds_reviewstates in Swift catalogs (for exampleAccountsActions.xcstrings). Neither this PR nor cmux-next: a reopened Codex or Claude chat shows each turn's tool calls #22155 touches those catalogs.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) andcargo 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 1d3da29Changelog
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
header.changes)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith 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
tool_callandtool_call_updaterecords, so its "Worked for" line opens to its commands and edits.Written for commit 0e94a30. Summary will update on new commits.