Repository navigation
cmux NEXT: a one-file Edited card expands to its diff; View changes shows new and out-of-repo files - #23161
Conversation
… View changes
A one-file edited-files card ("Edited l-setup.txt +9 -0") has no chevron
and nothing to click, View changes goes to the chat folder's git diff
(which holds no /tmp file), a loaded checkpoint drops files outside its
repository, and an edit call whose content has no diff item loses its
change. Covers a new file (Write), a file outside the repository and an
Edit with old and new strings, inline and through View changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray
…shows files outside the repo "Edited l-setup.txt +9 -0" could not be expanded: a one-file card drew no rows and no chevron. Its title and a new chevron now open the file's diff in the card (EditDiff, the transcript's edit view), built from the tool calls, so a new file shows as all added lines. View changes went to the chat folder's git diff beside the chat, which holds nothing outside the folder (a new /tmp file). A turn that wrote outside the folder now opens its own diff in place. A loaded turn checkpoint replaced the tool calls' files with its repository's, which dropped such a file from the card's counts and the view; it now keeps tool-call files at absolute paths outside the checkpoint's root. An edit call whose content carries no diff item (Claude Code's Write, Edit, MultiEdit) now takes its change from its input, marked fragment so Undo never writes a file back from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray
… diff
The reported card ("Edited l-setup.txt +9 -0") came from a Write whose
ACP content carried a diff with no old text; the test now runs that shape
and the input-only shape.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray
… first import The inline diff's Pierre lines watch their size, which jsdom cannot, and the first card's import of the pane and Pierre's chunk took over five seconds on a loaded host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray
|
Owned by projects-ba on cosmic-gray · session |
|
Owned by projects-ba on cosmic-gray · session |
|
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)
Unclear: CI failed on
Failures:
Matched log linesNot re-run automatically: Written by red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base 1c367bb; does not block
Agents: Tour of |
|
Found 14 test failures on Blacksmith runners: Failures
...and 4 more test failures. View all on Blacksmith: run 39590918970, run 39590919111
|
|
Bead |
…er, MultiEdit and path aliases Review of #23161: a Write built from its input read as a new file even when it overwrote one; a chat folder that is not a repository still sent View changes to the folder's diff beside the chat; a /tmp vs /private/tmp alias listed a file twice. Also covers MultiEdit, a later input replacing an earlier one, and Undo staying off for a Write built from its input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray
… chat only in a repository - A Write's input becomes a diff only when Claude Code's result says it created the file; an overwrite lists its path without counts, as before. A fragment never reads as a new file (toolFiles `created`). - A later input replaces diffs built from an earlier one; a diff item in the content still wins over the input. - View changes goes beside the chat only when the folder's git.status names a repository root and every changed file lies under it; else the turn's own diff opens in place (a non-repo folder showed the viewer's repository picker). - A tool file a checkpoint file already matches (a /tmp vs /private/tmp alias) is not added again as outside the repository. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray
… input can fix its diff Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray
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. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review (independent subagent, claude-opus-5-5): SHIP at b2f2417 Re-review of 51fb59b returned SHIP; b2f2417 is that commit plus a clean merge of feat-cmux-next (the PR's own diff is identical apart from hunk offsets; base's new
Follow-ups, not blocking:
Agent session: cosmic-gray |
acpmux sends a Claude Write as a fragment with no old text until its result confirms a create or carries the old text (#23187). One that stays a fragment (an overwrite without originalFile, an oversized one, no result yet, a cut-off adopted Write) read as a new file: "+N -0" on the Edited card, all added lines in its inline diff and in View changes. model.ts `contentsUnknown` names that diff (oldText null, fragment, not read from the input). `turnFiles` leaves it out, so nothing counts, diffs or undoes it, and `plainEditLabels` lists its path without counts, the path #23161 gives an overwrite built from the input. The card keeps such a path when no listed file is it, and once a checkpoint loads keeps an absolute path none of its files is (a /tmp file), as `outsideRepository` does for diffs. Edit and MultiEdit fragments keep their hunks and counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray
…the tool calls' change
With the unknown Write left out of the turn's files, a loaded checkpoint
marked the file it rewrote as changed outside the tool calls ("Includes
changes outside tool calls"). diff.ts `turnPathsOnly` names the paths the
turn's edits changed without a counted diff (an edit with no diff, as #23161
lists, and a Write whose old contents are unknown); `turnDisplay` and
`turnCounts` take them so a checkpoint file there is not `outside`. The pane
passes them for View changes, the header's Changes and the card.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray
…s, chevron or Undo (#23419) * test: a Write whose old contents are unknown lists without counts A translator Write that stays a fragment (oldText null, `_meta.acpmux.fragment`) reads today as a new file, "+9 -0", with a chevron. These cases pin the card, its inline diff, Undo and View changes for it, a fragment Edit beside it, the checkpoint-loaded case outside the repository, and the same Write once its result confirmed a create. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray * cmux NEXT: a Write whose old contents are unknown lists without counts acpmux sends a Claude Write as a fragment with no old text until its result confirms a create or carries the old text (#23187). One that stays a fragment (an overwrite without originalFile, an oversized one, no result yet, a cut-off adopted Write) read as a new file: "+N -0" on the Edited card, all added lines in its inline diff and in View changes. model.ts `contentsUnknown` names that diff (oldText null, fragment, not read from the input). `turnFiles` leaves it out, so nothing counts, diffs or undoes it, and `plainEditLabels` lists its path without counts, the path #23161 gives an overwrite built from the input. The card keeps such a path when no listed file is it, and once a checkpoint loads keeps an absolute path none of its files is (a /tmp file), as `outsideRepository` does for diffs. Edit and MultiEdit fragments keep their hunks and counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray * cmux NEXT: an unknown Write makes its whole file unknown; checkpoint keeps only paths outside the repository Review follow-ups: - A file a Write rewrote with unknown old contents is unknown as a whole: an Edit to the same file no longer lends it counts. - A pending or failed Write lists nothing. - Once the checkpoint loads, the card keeps a path without counts only when it lies outside the checkpoint's repository (turnCheckpoint.ts `outsideRepository`, now shared, with `turnCounts` naming the root), so an in-repo path the checkpoint skipped does not reappear. - The row height estimate counts a path once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray * cmux NEXT: a checkpoint file a Write rewrote without counts is still the tool calls' change With the unknown Write left out of the turn's files, a loaded checkpoint marked the file it rewrote as changed outside the tool calls ("Includes changes outside tool calls"). diff.ts `turnPathsOnly` names the paths the turn's edits changed without a counted diff (an edit with no diff, as #23161 lists, and a Write whose old contents are unknown); `turnDisplay` and `turnCounts` take them so a checkpoint file there is not `outside`. The pane passes them for View changes, the header's Changes and the card. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d24-cf0a-7373-a03a-75491e4d724a&host=cosmic-gray --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
Shipped in:
|
A Claude Code turn that wrote one new file outside any repository (
/tmp/l-setup.txt) ended with "Edited l-setup.txt +9 -0 [View changes]", and the card couldn't be expanded. Clicking the card's title or its new chevron now opens that file's diff inside the card, so a new file shows as all added lines. View changes opens a diff that includes the file.What was wrong, and what changed:
collapsedmode. Now a one-file card gets a chevron (and the title also toggles it). It opens the file's tool-call diff inline, usingEditDiff, the same view the transcript uses for an edit. The open state is kept per row in the existingopenStore.git.statusnames a repository root and every file the turn changed is under that root. Otherwise the turn's own diff opens in place (turnChanges/viewChanges.ts, used bydiffBeside). That diff is built from the tool calls.turnDisplaynow keeps tool-call files at absolute paths outside the checkpoint's root, unless a checkpoint file already matches them (a/tmpvs/private/tmpalias), so no file lists twice.diffitem lost their change. When an edit call's content has nodiffitem, the change is now read from its latest input: Editold_string/new_stringand MultiEditedits. A Write's input is used only when Claude Code's result says it created the file ("File created successfully at: …"). A Write over an existing file has no old text, so it still lists its path without counts. These diffs are markedfragment, so Undo never writes a file back from them, and a fragment is never marked as a new file.The full diff viewer's internals aren't touched. This only changes the card and what the card hands to the viewer.
Changelog
Tests
webviews/test/agent-pane-edited-card-expand.test.tsx(jsdom, the same style aspermission-edit-diff.test.tsx) covers the three cases, each opened inline and through View changes:diffwith no old text) and an input-only Write whose result says it created the file. The input-only form offers no Undo./tmpvs/private/tmpalias that lists onceold_string/new_string, and a MultiEdit whose later input replaces its first oneIt also covers a Write over an existing file (path only, no counts, no View changes), and a chat folder that isn't a repository (in place, even for a file inside it).
Command, from
webviews/:bun test test/agent-pane-edited-card-expand.test.tsxa3e14d3a9e0source with the first version of the test: 0 pass, 7 fail. The failures read "Edited 1 file" / "Edited 0 files" instead of the file name, and there is no chevron.7a497fe8f99): 6 of 11 fail. These are the overwrite, alias, non-repo and View-changes cases. The MultiEdit latest-input case fails on8885e264503too ("+1-1" instead of "+3-2").51fb59b9e71: 11 pass, 0 fail, exit 0.Observed / Not run
51fb59b9e71, 17 neighbouring jsdom tests that import the changed modules all pass, includingpermission-edit-diff,transcript-steer-continuous,agent-pane-turn-tokensandagent-pane-merge-restore.changes-file-review.test.tsxtimes out the same way at base on that loaded host.scripts/web-lint.shreports 0 errors; its 2 warnings are in untouched files.check-layers,check-text-focus-ringsandcheck-system-bluepass.51fb59b9e71:agent-pane-edited-card-expand,permission-edit-diffand the browser-laneagent-pane-edited-side,agent-pane-edit-awaiting-permission,agent-pane-edited-calm,agent-pane-diff-findandagent-pane-edited-copy-overlappass. The red webviews files there are composer and peer-chat tests (composer-mention,composer-history,composer-location-strip,composer-suggested-prompt,composer-claude-split,quiet-access-chip,agent-pane-peer-chat,agent-pane-working-counts), which this PR doesn't touch. The red cmux-next check is "Script tests (pin-cmux-tui, embed-cef, ensure-cef store)", including FIRST-TURN-COST for Chief, also untouched here.Agent session: cosmic-gray
🤖 Generated with Claude Code