Repository navigation
Retain Codex edit diffs from native session files - #1057
Merged
Merged
Conversation
Keep upstream normalized message snapshots and retained Codex edit replacements together. Route normalized Codex apply_patch starts, completions and native amendments through the edit renderer; otherwise patches become serialized JSON after the merge. The existing Codex patch regression reproduced this loss before the resolution and now passes.
This was referenced Oct 22, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Codex edits retain their native patch evidence in the Session trace, and the Console replaces each edit's placeholder when that evidence arrives.
Closes #988
Closes #854
Evidence
Before:
cargo test --test console codex_patches::each_codex_patch_keeps_its_own_diff_in_the_trace_and_console -- --exactfailed: 0 retained diffs, expected 2.After: passes;
cargo test --test console codex_patchespasses all 5 tests, covering separate edits to the same file, additions/deletions, shell edits, mismatches, unreadable/missing files, custom Codex home, resumed turns and ambiguous native files.Before:
node --test --test-name-pattern='native Codex patches' console/tests/logs.test.cjsfailed in all 3 storage variants because the live placeholder remained.After: all 3 pass;
npm test --prefix consoleincludes 17 passing log-reader tests and 1 existing legacy-log skip.cargo fmt --check,cargo clippy --all-targets -- -D warnings, andgit diff --check origin/issue-700pass.Merge validation at
efe898b, including upstream0ef17c4:/usr/bin/time -p scripts/affected-tests origin/issue-700selectedcargo nextest run: 2,296 passed; 3 existing skips. Wall time: 1,590.28 s, including compilation (38.08 s); nextest execution took 1,550.007 s.After reconciliation,
cargo test --test consolepasses 56 tests andnpm test --prefix consolepasses 52 browser tests, with 1 existing skip.Merge regression:
cargo test --test console codex_patches::each_codex_patch_keeps_its_own_diff_in_the_trace_and_console -- --exactfailed after the mechanical merge because normalized tool events displayed patches as serialized JSON; routing Codex patch events through the edit renderer restores the diffs and passes the existing regression.Test seams: fake Harness execution observed through on-disk Session traces, Console HTTP rendering, and the live Console reader in a browser.
Review
issue-700, pinned at39521ca6e44a9c131b3f4e268e22f8fdacb50fce.python3 .thirdshift-review-96Jd44/repros/standards/native-ambiguity.py(exit 1 before, exit 0 after). Fixed ambiguous native-file selection across date folders and retained the reproduction plus a binary-level regression. No outstanding findings..thirdshift-review-96Jd44/standards.mdand.thirdshift-review-96Jd44/spec.md.Unaddressed findings
Standards
None.
Spec
None.
CI notes
testfailure at47b6f0b: an existing Stop snapshot/process-exit race attests/console/stop.rs:86; the failing test and Stop implementation are byte-identical toissue-700(0ef17c4), and the focused original-head test, base Console suite (49/49), 16 repeated base runs, and merged Console/full Rust suites all passed locally.Merge Danger
Door: two-way
Blast Radius: Recording
Changes Codex patch evidence and Console edit rendering. The native format is unpublished; unsupported or mismatched evidence falls back to the existing edit record.
Built with codex · gpt-6.1-sol · xhigh