openai / openai/codex

macOS Desktop: orphaned turn hides later completed turns and falsely exhausts pagination

Open
#40,836 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app app-server bug
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)?
  • Codex Desktop: 26.818.61809 (build 7019)
  • Bundled Codex CLI/app-server: 0.149.0-alpha.4.3
What subscription do you have?

ChatGPT Pro

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

A local Desktop thread has one old turn with task_started but no terminal event. All later turns in the same rollout have their own turn_id, items, and task_complete, but thread/read returns only the orphaned turn:

page.hasMore = false
page.nextCursor = null
turns = [old turn only]
old turn.status = interrupted

The later conversation is therefore absent from the Desktop transcript, even though the raw rollout is intact and parseable.

Observed on one local macOS thread:

  • rollout: 24,457 JSONL records / 144.7 MB;
  • 46 task_started, 45 task_complete;
  • exactly one unmatched start;
  • orphan turn starts at 2026-08-21T20:51:33.638Z, has 288 item_completed records, and has no terminal event;
  • successor starts 100 seconds later, completes normally, and subsequent turns—including deployment and follow-up reports—also complete normally.

This is a history projection/read failure, not evidence of lost raw transcript data. The thread metadata points at the correct rollout and uses history_mode='paginated'.

What steps can reproduce the bug?

A minimal event fixture should be sufficient:

task_started(A)
item_completed(A)
# no task_complete(A): interruption/process loss

task_started(B)
item_completed(B)
task_complete(B)

task_started(C)
item_completed(C)
task_complete(C)

Then read the thread through Desktop or app-server thread/read.

On the affected real thread, B/C and many later turns are omitted even though their item_completed and task_complete payloads carry the correct distinct turn_id values.

What is the expected behavior?
  • B and C must remain separate completed turns, newest first.
  • A may be represented as interrupted/incomplete, or implicitly closed when B starts.
  • A must not absorb or hide B/C items.
  • hasMore and nextCursor must reflect the actual indexed turn count.
  • Existing normal completed and currently active threads must continue to render normally.
Additional information

A likely fix is to group persisted items by explicit payload.turn_id rather than a prior open-turn accumulator, and to close/mark an older open turn interrupted when a newer task_started arrives. A rebuild of the affected paginated projection may also be required.

This is related to #37577 (paginated history reconstructing turns as interrupted), but differs in the deterministic failure mode: an orphaned earlier turn acts as a barrier that hides later independently completed turns and falsely reports pagination exhaustion.

I have not attached the full rollout because it contains private prompts, paths, and tool output. I can provide a sanitized event trace or fixture privately if useful.

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 Desktop or app-server thread/read handling and the paginated history projection, using the minimal A/B/C event fixture described in the issue. Verify that an orphaned A cannot absorb later turns, that B and C remain separate and newest first, and that hasMore and nextCursor match the indexed turns while normal and active threads still render correctly.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.