openai / openai/codex

[Bug] Paginated thread history projection stops at a token_count record

Open
#40,342 25 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug session
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)?

Bundled runtime: codex-cli 0.145.0 (desktop build not included), 0.149.0 same

What subscription do you have?

Not disclosed for privacy

What platform is your computer?

Linux x86_64 (host and kernel identifiers omitted)

What issue are you seeing?

Several completed local chats display only the initial user message and the assistant's first progress update. Later tool activity, turns, and final answers are missing from the conversation pane even though the durable rollout still contains the complete transcript.

The failure occurs while materializing paginated thread history. The projection stops at an early token_count record and does not process later rollout records.

Sanitized errors:

invalid type: map, expected f64
thread history projection expected ordinal 17, got 18
failed to project durable rollout during shutdown

What steps can reproduce the bug?
  1. Use Codex App with the bundled codex-cli 0.145.0 runtime and paginated thread history.
  2. Run a local task that emits a token_count event containing structured rate-limit data.
  3. Allow the task to continue through later turns and produce a final answer.
  4. Close and reopen the chat.
  5. Observe that the conversation pane contains only the messages before the rejected token_count event.

In the observed cases, restarting the app retries projection but does not repair the incomplete history.

What is the expected behavior?

The complete conversation, including later turns and final answers, should be reconstructed from the durable rollout and displayed after reopening the chat.

Additional information

History mode: paginated.
The projection cursor remains at ordinal 17. The next record is skipped, producing the subsequent ordinal-gap error.
The durable session data remains present; this appears to be a history-index/projection failure rather than transcript deletion.
The same failure pattern was observed in multiple local chats.

Privacy: No transcript, prompt, screenshot, filesystem path, account identifier, task/thread/session ID, repository name, hostname, raw log, token usage value, or private project information is attached or included.

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 paginated thread-history projection and the token_count record deserialization path, reproducing the issue with structured rate-limit data as described. Trace why projection stops at ordinal 17 and produces the ordinal-gap error; done means durable rollouts reconstruct completely after reopening, including later turns and final answers.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
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.