Skip to content

Retain Codex edit diffs from native session files - #1057

Merged
JacobStephens2 merged 5 commits into
issue-700from
issue-988
Oct 22, 2026
Merged

JacobStephens2 merged 5 commits into
issue-700from
issue-988

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Codex edits retain their native patch evidence in the Session trace, and the Console replaces each edit's placeholder when that evidence arrives.

Codex exits → thread ID → native session file
  current turn's edit order and paths match
    → amend existing apply_patch records, marked codex_session_file
    → replace the Console edit placeholder, including live readers
  unavailable, unreadable or mismatched evidence → keep streamed records

Closes #988
Closes #854

Evidence

  • Before: cargo test --test console codex_patches::each_codex_patch_keeps_its_own_diff_in_the_trace_and_console -- --exact failed: 0 retained diffs, expected 2.
    After: passes; cargo test --test console codex_patches passes 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.cjs failed in all 3 storage variants because the live placeholder remained.
    After: all 3 pass; npm test --prefix console includes 17 passing log-reader tests and 1 existing legacy-log skip.

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, and git diff --check origin/issue-700 pass.

  • Merge validation at efe898b, including upstream 0ef17c4: /usr/bin/time -p scripts/affected-tests origin/issue-700 selected cargo 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 console passes 56 tests and npm test --prefix console passes 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 -- --exact failed 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

  • Fixed point: remote issue-700, pinned at 39521ca6e44a9c131b3f4e268e22f8fdacb50fce.
  • Standards: S1 reproduced with the reviewer's exact command, 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.
  • Spec: 0 findings.
  • Both axes read all 9 changed files, including the deleted reproduction. Changed files left unread: none. Generated-output exclusions: none.
  • Final reports and each axis's files-read list are retained locally in .thirdshift-review-96Jd44/standards.md and .thirdshift-review-96Jd44/spec.md.

Unaddressed findings

Standards

None.

Spec

None.

CI notes

  • Original test failure at 47b6f0b: an existing Stop snapshot/process-exit race at tests/console/stop.rs:86; the failing test and Stop implementation are byte-identical to issue-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

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.
@JacobStephens2
JacobStephens2 merged commit 0a3dd0d into issue-700 Oct 22, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-988 branch October 22, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant