Skip to content

Recover Codex diffs from FileChange session records - #1117

Merged
JacobStephens2 merged 3 commits into
mainfrom
issue-1085
Oct 23, 2026
Merged

JacobStephens2 merged 3 commits into
mainfrom
issue-1085

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Recover the diffs missing from current Codex Session traces and log conversion, preserving legacy support and edit matching.

 on Codex completion
-  read patch_apply_end
+  read patch_apply_end or item_completed(FileChange)
+  retain unified diffs for updates, adds and deletes
   amend only when every streamed edit matches

The Codex 0.147.0 host inspection remains with the Day shift, as #1085's scope clarification specifies. Both native formats have fake-session coverage.

Closes #1085

Test seams

  • The thirdshift harness codex command, its Session trace, and the Console Logs page, with a fake Codex native session file.
  • The thirdshift logs --convert command, its conversion report, and the resulting Session trace, with a fake Codex native session file.

Evidence

  • Before: cargo test --test console codex_patches::current_codex_file_changes_keep_update_add_and_delete_diffs failed with 0 recovered diffs, expected 2.
    After: the same test passes, preserving each update/add/delete diff and Console escaping.
  • cargo test --test console codex_patches::: 6 passed, including old-format diffs, current-format diffs, Resume selection, and declining incomplete or missing evidence.
  • cargo test --test convert_logs: 10 passed, 1 ignored fixture entry point; both native formats recover diffs, and historical conversion selects the original turn.
  • cargo check --all-targets, cargo fmt --check, and git diff --check: passed.
  • /usr/bin/time -p scripts/affected-tests main: passed; selected cargo nextest run, with 2,361 passed and 56 skipped. Wall time 2,715.69s, including compilation and Cargo lock waiting; nextest test execution 2,292.447s.

Merge Danger

Door: two-way

The reader change is reversible; conversion still preserves original Session logs.

Blast Radius: Codex

Optional patch evidence in live Session traces and historical conversion.

Unaddressed findings

  • Standards: none; 0 findings.
  • Spec: none; 0 findings.
  • Security: none; 0 findings. Guidance-mode review of the FileChange recovery path: new unified_diff input reaches the Console through the existing escaped renderer, the live-script payload test passes, session-file lookup stays fail-closed, no fix needed.

Security review outcome

No unaddressed introduced findings.

Review coverage

Standards and Spec each read every changed file: src/harness/codex/patches.rs, tests/console/codex_patches.rs, and tests/convert_logs.rs. Unread changed files: none. Generated-output exclusions: none.

Built with codex · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 merged commit ac3ee7a into main Oct 23, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1085 branch October 23, 2026 00:44
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 23, 2026
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.

Codex diff recovery finds nothing: codex-cli 0.163.0 records patches as FileChange items, not patch_apply_end

1 participant