Skip to content

Codex App: allow staging only the Last Turn diff #34834

Description

@Falven

What variant of Codex are you using?

Codex App

What feature would you like to see?

The Last Turn review should support Stage all, Stage file, and Stage hunk actions that stage only changes introduced during that assistant turn.

Currently, Last Turn accurately communicates which edits belong to the latest turn, but it is read-only. Staging from the Unstaged view operates on the Git working tree instead, potentially including unrelated changes that existed before the turn.

Example:

  1. I have an unstaged manual edit in example.ts.
  2. Codex makes a separate edit to example.ts.
  3. Last Turn shows only the Codex edit.
  4. Staging the file from Unstaged stages both edits.

The desired action would apply the selected Last Turn patch to the Git index without staging or modifying unrelated working-tree changes.

Expected behavior:

  • Stage all stages only the latest turn's recorded patch.
  • File and hunk actions stage only the corresponding parts of that patch.
  • Existing staged changes remain staged and unchanged.
  • Pre-existing unstaged changes remain unstaged and unchanged.
  • If a patch overlaps with another edit and cannot be applied safely, the action fails atomically with a clear conflict message.
  • New files, deletions, and renames are handled consistently.

This would make Last Turn useful as an actionable change boundary instead of only a review boundary.

Additional information

The current workaround is to cross-reference Last Turn while using git add -p in a terminal. That loses the convenience and attribution information already available in the Codex review pane.

Related issues address the same underlying edit-isolation problem but not turn-scoped staging:

  • #15367 — isolate request-specific edits for Undo/Revert
  • #11626 — preserve unrelated local changes during checkpoint restoration
  • #17963 — Last Turn file attribution
  • #31424 — reliable review of agent-task changes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appcode-reviewIssues relating to code reviews performed by codexenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions