Repository navigation
cmux-next: a reopened Codex or Claude chat shows each turn's tool calls - #22155
teamleaderleo wants to merge 34 commits into
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)
Pending: CI is running on Last result: Yours to fix: Written by red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 67eea14 to compare; do not merge until green; see lane-rules
Agents: |
This comment has been minimized.
This comment has been minimized.
[Medium impact] The changes affect adopted agent-chat history and its pane display. Add support for Codex’s saved Findings
SummaryRestores tool calls when reopening Codex and Claude chats.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Saved transcript] --> B[Read turns and tools]
B --> C[Append tool_call]
C --> D[Append tool_call_update]
D --> E[Append answer and turn end]
E --> F[Worked for disclosure]
Reviews (4) · Last reviewed commit: "Merge feat-cmux-next into fix/next-adopt..." · Reviewed by Greptile |
|
Bead |
|
Visual preview of ea0ba51: in the maintainers' private review feed. |
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. |
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>
122b32e to
68edd1d
Compare
… 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>
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>
| if s(record, "type") != Some("event_msg") { | ||
| return None; |
There was a problem hiding this comment.
Saved Codex commands stay hidden
codex_tool rejects every response_item, but Codex records tool calls in that format too. The checked-in Codex 0.142.2 rollout records commands as function_call and function_call_output, with no matching tool events. Reopening those chats still shows no commands under “Worked for.” Read these call/result pairs by call_id and add coverage using that rollout format.
… 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>
|
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
|
owner: 01a15c03-03d0-7460-8bd4-cc70444781bd |
…Outputs (hq#2569 item 4) (#22166) * acpmux: test that an adopted chat replays its tool calls (failing) 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> * acpmux: a reopened Codex or Claude chat shows each turn's tool calls 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> * acpmux: cargo fmt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(next): PR autofix at 2c2b9a6 - cargo clippy --fix cmux-tui/crates/acpmux/tests/hub_integration/fork_through.rs Autofix-Run: https://github.com/manaflow-ai/cmux/actions/runs/39325739748 * acpmux: a failed Codex patch replays no edits, a replayed hunk is no 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> * cmux-next: test the edited-files card, Changes menu entry and summary 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> * cmux-next: list Changes in the chat menu and the edited files under Outputs 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> * cmux-next: Outputs keeps the files only the turn's checkpoint knows, 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> * cmux-next: an unconfirmed Claude edit shows no diff; a file the last 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> * acpmux: adopt replay tests need no backdated transcript after #22139; 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> * cmux-next: Outputs matches a last-turn file to an output by exact path first Review on #22166: a turn file's bare name ('index.ts') or a checkpoint's root file ('package.json') matched any output ending in it, so a same-named file in another folder lost its row and opened the wrong turn's diff. A turn file now takes the output with its own path, and a checkpoint file the shortest output path ending in its path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * style: vp fmt Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: cmux-autofix[bot] <cmux-autofix[bot]@users.noreply.github.com>
|
Closing: this change is already on feat-cmux-next. #22166 carried this branch, and it merged as b69093a. Merging base into this branch now leaves no diff. Closed by backlog-sweep, which adopted the PR. Agent session: cosmic-gray |
Summary
Reopening a Codex chat in the cmux NEXT agent pane showed each past turn as its final message and a "Worked for 1m 32s" footer that opened nothing, even when the turn ran commands and edited files (manaflow-ai/cmuxterm-hq#2569, item 3). Codex desktop shows that work under a collapsible "Worked for".
The calls were lost in acpmux's adoption replay.
adopt_replay::readturned the harness transcript into prompt and answer pairs only, soHub::replay_adoptednever appended atool_call. The webview was fine: with no tool rows, a settled turn has nothing to fold.Now the replay reads each turn's tool calls too (
adopt_tools.rs) and appends atool_callplus its settlingtool_call_updatebefore the answer, the same records a live turn leaves:item_completedcommands, file changes, MCP calls and web searches from current rollouts, andexec_command_endand patch events from older ones. A file change keeps each hunk as adiffand lists every file with its +/- counts inrawInput.changes. That's the data the edited-files card (item 4) needs.tool_useand itstool_resultgo through the live path's own builder.claude_stdio::tool_call_fieldsis now shared byinbound.rsand the replay.In the pane, "Worked for" now opens through the existing settled-run line ("Edited files, ran commands") to "Ran 3 commands" and "Edited 2 files +4 -1", and each command opens to its line. No new chrome. The one webview change: the run summary counts edited files rather than edit calls, so one Codex change over two files reads "edited files".
Testing
Failing tests first (6931c71), fix after:
cargo test -p acpmux --test hub_integration adopt_replays(Huge Blue): on the base, both new tests fail. Codex replaysturn_started, user_message, agent_message_chunk, turn_end, turn_resultand no tool calls. At 2c2b9a6 all 9adopttests pass.adopt_replays_a_codex_turns_commands_and_file_editsadopts a Codex Desktop-shaped rollout fixture (tests/fixtures/codex-rollout-tool-calls.jsonl).adopt_replays_a_claude_turns_tool_callsadopts a Claude Code transcript through the fake Claude harness, including a failed call.webviews/test/fixtures/adopted-codex-turn.events.json, the daemon's own replayed records (ACPMUX_UPDATE_FIXTURES=1rewrites it).agent-pane-adopted-tool-calls.test.tsloads those records into the pane.CMUX_BROWSER_TESTS=1 bun test test/agent-pane-adopted-tool-calls.test.ts(big-red, Chromium): on the red commit there is no "Worked for" disclosure. At 190f2a4 it passes, together withagent-pane-turn-footerandagent-pane-step-rows(6 pass).cargo test -p acpmux --lib claude_stdio(24 pass),--test chats_transcript --test chats_open(pass),cargo clippy -p acpmux --all-targetswith no warnings, andcargo fmt. On big-red:tsc --noEmit,vp lint/vp fmton the changed TS, andcheck:browser-lanes.Observed / Not run
Observed: the red and green results above, at the named commits.
Not run: a cmux NEXT app build or live dogfood of adopting a real Codex chat (no Swift builds here). The full acpmux suite was not run; CI covers it.
Risk evidence (high tier)
Review: SHIP at 924fc9f (cmux-review subagent; correctness first)
Runtime test:
cargo test -p acpmux --test hub_integration adopton Huge Blue at 924fc9f (11 pass;cargo clippy -p acpmux --all-targetsclean)Changelog
Fixed: Reopening a Codex or Claude Code chat in cmux NEXT shows each turn's commands and file edits under "Worked for", not only the final message.
Proof
The browser test drives the pane over the daemon's replayed records: "Worked for 1m 32s" expands to "Edited files, ran commands", then to "Ran 3 commands" and "Edited 2 files +4 -1", and each command line shows. No screenshot.
Checklist
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Reopening a Codex or Claude chat in the cmux NEXT agent pane now shows each turn's tool calls under the "Worked for" fold, where before the adoption replay kept only prompt and answer pairs.
Bug Fixes
adopt_replayreads tool calls from the harness transcript, andHub::replay_adoptedreplays them astool_callandtool_call_updaterecords before the answer, matching a live turn.item_completedevents (and olderexec_command_end/patch events); Claude Code turns readtool_use/tool_resultvia the sharedclaude_stdio::tool_call_fields.Written for commit 8181f41. Summary will update on new commits.