openai / openai/codex

Codex Desktop: “Last turn” review shows the latest worktree diff instead of the selected historical turn

Open
#40,830 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug code-review session
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Codex App version

26.818.41509 (build 6962)

Platform

macOS, Apple Silicon

Severity

High — correctness and user-trust failure in the code-review surface.

This is not a cosmetic glitch. The review pane claims to show a selected historical turn while rendering a different, newer patch. A code-review tool must never mislabel the source of the code it is showing.

What issue are you seeing?

After completing multiple turns in separate Codex worktrees, clicking the file-change card from an older turn opens the Review pane with “Last turn” selected, but the pane displays the diff from the newest active worktree instead of the selected historical turn.

The selector/header and the backing diff source are out of sync.

In the observed case:

  • Historical turn A's card reported 5 files changed, +126 / -6.
  • Newer turn B reported 3 files changed, +13 / -1.
  • Clicking turn A's change card opened a pane labelled “Last turn”.
  • The pane actually showed turn B's +13 / -1 patch and paths from turn B's worktree.

This makes historical review unreliable and creates a real risk of reviewing, approving, reverting, staging, or committing the wrong changes.

Steps to reproduce
  1. Start a Codex Desktop task in a Git repository.
  2. Complete turn A in a Codex worktree and modify one set of files.
  3. Complete turn B in a different/latest worktree and modify a different set of files.
  4. Scroll back to turn A.
  5. Click turn A's “N files edited” card to inspect that historical change.
  6. Observe that Review opens with “Last turn” selected.
  7. Compare the file list, line counts, paths, and hunks with turn A and turn B.
Expected behavior

Opening a historical turn's change card must show the immutable diff associated with that exact turn/checkpoint/worktree.

The Review label, file list, diff stats, paths, and hunks must all refer to the same turn.

Actual behavior

The UI indicates that the historical/last-turn view is selected, while the Diff pane remains bound to the newest active worktree and renders the latest patch.

Why this needs urgent attention

Displaying the wrong patch under a historical-turn label is a data-integrity defect in the primary review workflow. It is worse than an empty or failed diff because the UI presents incorrect information as if it were authoritative.

Please treat this as a correctness bug, not a minor UX issue. Until the backing diff can be switched reliably, the app should fail closed—show an explicit error or disable the historical selector—instead of silently displaying another turn's changes.

Please also add a regression test that creates two turns with disjoint file sets/worktrees and verifies that opening each historical change card resolves to its own checkpoint.

A screenshot demonstrating the mismatch is available if maintainers need it; repository and file names have intentionally been omitted because they belong to a private codebase.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Codex Desktop Review pane flow for historical change cards and trace how the selected turn maps to its diff source and worktree. Add a regression test using two turns with disjoint file sets, then verify that each card shows its own checkpoint and that mismatches fail closed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.