codex - 💡(How to fix) Fix Codex rollback/revert diff is not symmetric with the original edit

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

Expected fix:

  • Codex should avoid editing files when the user explicitly asks for audit/root-cause analysis only.
  • Rollbacks should be applied as exact inverse patches.
  • Codex should verify the final working tree state before claiming rollback success.
  • The diff UI should make it clear whether a rollback fully cancels the original edit.
RAW_BUFFERClick to expand / collapse

Product: Codex Desktop / Codex agent

Bug type: Rollback / revert correctness, diff UI correctness

Description: The Codex agent made code edits even though I had asked for root-cause auditing only. After I objected, the agent attempted to roll back its own changes.

However, the rollback diff shown by Codex was not symmetric with the original edit diff. The line counts did not match in reverse, which means the revert cannot be trusted as an exact rollback.

Original edit diff shown by Codex:

  • Total: +7 -15
  • Sidebar.tsx: +13 -4
  • stateSync.ts: +1 -1
  • sidebarQuotaView.test.ts: +16 -0

Rollback/revert diff shown by Codex:

  • Sidebar.tsx: +4 -13
  • stateSync.ts: +1 -1
  • sidebarQuotaView.test.ts: +0 -16

Expected behavior: When Codex reverts the same set of changes, the rollback should be an exact inverse of the original edit. The file-level line counts should be symmetric, and Codex should not claim the rollback is complete unless it can verify the final diff is clean.

Actual behavior: The rollback line counts were not symmetric with the original edit. This suggests either:

  1. the rollback was incomplete,
  2. the rollback included extra unintended changes,
  3. or the Codex diff UI is reporting rollback changes incorrectly.

Impact: High. Users may trust Codex when it says changes were reverted, but the displayed diff indicates the rollback may not be exact. This creates a risk of unintended code changes remaining in the working tree.

Steps to reproduce:

  1. Ask Codex to audit a bug without editing files.
  2. Codex edits several files anyway.
  3. Ask Codex to revert its own changes.
  4. Compare the original edit diff with the rollback diff.
  5. Observe that the rollback diff is not the inverse of the original edit.

Expected fix:

  • Codex should avoid editing files when the user explicitly asks for audit/root-cause analysis only.
  • Rollbacks should be applied as exact inverse patches.
  • Codex should verify the final working tree state before claiming rollback success.
  • The diff UI should make it clear whether a rollback fully cancels the original edit.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex rollback/revert diff is not symmetric with the original edit