codex - 💡(How to fix) Fix Codex sometimes returns a stale final answer from an earlier turn instead of answering the latest message [1 comments, 2 participants]

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…
GitHub stats
openai/codex#17301Fetched 2026-04-11 06:18:16
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3closed ×1commented ×1

Root Cause

This does not look like a UI-only display issue because the wrong final answer is already present in persisted session history for the affected top-level vscode thread.

RAW_BUFFERClick to expand / collapse

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

Version 26.406.31014 (1395)

What subscription do you have?

Business / Pro-style desktop usage

What platform is your computer?

macOS

What issue are you seeing?

In a long-running Codex Desktop conversation, Codex sometimes starts a new turn correctly, acknowledges the latest user request in commentary/planning, but then emits a final answer copied from an earlier completed turn instead of answering the current request.

Resending the same prompt in the next turn often makes Codex behave normally.

This does not look like a UI-only display issue because the wrong final answer is already present in persisted session history for the affected top-level vscode thread.

I have now seen multiple variants of this in the same conversation:

  • A task about update-host configuration was replayed when I asked for a swipe-back UI change.
  • The same update-host completion was replayed later when I agreed to proceed with websocket reconnect work.
  • A swipe-back completion was replayed later when I asked for websocket auto-reconnect and disconnect-status UX.

The strongest signal is that the bad turns often have only read/view tool activity, or very few tool events, yet the final answer claims code changes, tests, and release/publish steps that belong to an earlier completed turn.

That strongly suggests an old completed final answer is being attached to the wrong new turn.

What steps can reproduce the bug?

I do not have a short deterministic repro yet, but the observed pattern in one long-running desktop thread is:

  1. Ask Codex to do task A.
  2. The first response may incorrectly reuse a previous completed task's final answer.
  3. Resend task A.
  4. Codex then performs task A correctly.
  5. Ask Codex to do task B.
  6. Codex commentary/planning clearly starts task B.
  7. The final answer is not about task B. It replays a completion from task A or another older task.
  8. Resend task B.
  9. Codex then performs task B correctly.

Concrete examples I observed:

  1. Update-host config task
  2. Swipe-back/navigation task
  3. Websocket reconnect/disconnect-status task

In the reconnect example, Codex commentary started the correct reconnect/disconnect-status implementation lane, but the final answer replayed an older swipe-back completion instead.

What is the expected behavior?

Codex should always finalize the current turn using the current turn's request and state.

If the assistant starts the correct new task in commentary/planning, the final answer should not resolve using stale output from an earlier completed turn.

Additional information

This looks more like session/turn-final orchestration than simple model drift because:

  • the bad turn already contains the wrong final answer in persisted session history
  • the wrong final can reference old completed work products even when the current turn only performed read-only inspection
  • repeating the same user request in the next turn often succeeds immediately
  • different stale finals can be replayed, suggesting this is not limited to the immediately previous turn

Possibly related issues:

  • #15318 Codex suddenly outputs an identical response from a previous turn after completing several instructions
  • #14513 Codex stops execution mid turn and answer an old unrelated question
  • #13864 gpt-5.4 generates response to earlier messages not the last user message
  • #8648 Codex replies to earlier messages instead of latest one in conversations
  • #11174 When context is auto compacted, agent forgot question already answered in previous turn

I also have local redacted session-history evidence showing:

  • the bad turn started normally
  • the current prompt was recorded correctly
  • commentary referenced the current prompt correctly
  • the final answer matched a stale earlier completion instead

If useful, I can provide a private redacted evidence bundle with exact turn boundaries and examples.

extent analysis

TL;DR

The issue can be mitigated by resending the same prompt in the next turn, which often makes Codex behave normally.

Guidance

  • Review the session history to identify patterns in the incorrect final answers and their relation to previous turns.
  • Verify that the issue is not specific to a particular task or prompt by testing with different inputs.
  • Investigate the possibility of a caching or orchestration issue in the Codex App that causes stale final answers to be attached to new turns.
  • Consider providing the private redacted evidence bundle to help with further debugging and analysis.

Notes

The issue seems to be related to the session/turn-final orchestration in the Codex App, and the fact that repeating the same user request in the next turn often succeeds immediately suggests a potential workaround.

Recommendation

Apply workaround: Resend the same prompt in the next turn when the issue occurs, as this often resolves the problem and allows Codex to behave normally.

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