openai / openai/codex

Codex App: subagent Last Turn diff drops the initial implementation after a follow-up

Open
#42,441 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.820.7780.0

What subscription do you have?

Unknown (signed in with a ChatGPT account; the plan is not exposed in the task context)

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

When a primary agent delegates implementation to a subagent and later sends a follow-up instruction to that same subagent, the Codex App's Last Turn review shows only the diff produced by the final follow-up.

The earlier, substantive implementation from the same delegated subagent task disappears from the review scope, even though those edits remain in the working tree.

In the reproduced case:

  • The subagent's first pass implemented a functional refactor across 11 files.
  • The primary agent then sent a follow-up asking only for whitespace cleanup.
  • The follow-up changed formatting in a small subset of those files.
  • Last Turn showed only the whitespace cleanup, not the functional implementation that the subagent interaction produced.

This makes the review misleading: the visible diff suggests the delegated task only changed whitespace, while most of its actual edits are hidden from that review surface. Switching to an ordinary working-tree diff is not equivalent because it can include unrelated edits and loses subagent-task attribution.

What steps can reproduce the bug?
  1. Open a Git repository in Codex App.
  2. Ask the primary agent to spawn a subagent for an implementation task.
  3. Let the subagent complete an initial turn that edits multiple files.
  4. Have the primary agent send a follow-up task to the same subagent, such as a small whitespace cleanup.
  5. Let that follow-up complete.
  6. Open the Review panel and select Last Turn, or open the changes associated with the completed delegated work.
  7. Observe that only the final follow-up's small diff is shown; the initial implementation diff from the same subagent task is absent.
What is the expected behavior?

Reviewing a completed delegated subagent task should show the cumulative diff produced across all turns in that subagent interaction.

If Last Turn must remain strictly turn-scoped, the UI should distinguish between:

  • Latest subagent turn
  • Entire delegated task

Clicking the completed subagent interaction should default to the entire delegated-task diff so a cleanup follow-up cannot hide the main implementation.

Additional information

The edits are not lost from disk; this is a review-boundary and attribution problem.

Related but not duplicate:

  • #17963 reports missing files from a single most-recent turn.
  • #40830 reports a historical turn showing a different worktree's newer diff.
  • This report concerns multiple turns within one delegated subagent task, where a follow-up replaces the substantive initial pass in the visible review scope.

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 by reproducing the delegated subagent flow and inspect the Review panel's Last Turn diff selection and subagent-task attribution. Trace how changes from the initial and follow-up turns are collected, then verify that the completed delegated task shows its cumulative diff while a latest-turn view remains distinguishable if retained.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.