openai / openai/codex

[Windows App 26.901.6511.0] Recent chat history disappears; read_thread stays stale while rollout retains newer messages

Open
#44,035 10 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Installed Windows package: OpenAI.Codex 26.901.6511.0 (queried with Get-AppxPackage; not copied from About).
The executable used by the running app server reports codex-cli 0.153.4.

What subscription do you have?

Not collected for this report.

What platform is your computer?

Windows x64, OS version 10.0.26200.
Local Codex task in a Git workspace; PowerShell.
Observed on 2026-09-09, UTC+08:00.

What issue are you seeing?

Recent conversation history disappeared from the user's view during a long-running local Codex Desktop task. A read-only check also found a concrete discrepancy: the app's read_thread tool returns an older task turn as the newest turn, while the indexed JSONL rollout for the same task still contains later user messages and continues receiving records.

The user can still send messages and the agent can continue work, but the returned history does not include the later conversation. This report establishes missing/stale exposed history, not confirmed deletion of the underlying conversation data.

Sanitized evidence

The task identifier was obtained from CODEX_THREAD_ID and used for both the app-tool read and the exact SQLite row lookup. Identifiers and message contents are omitted from this public report.

At 2026-09-09T03:39:16Z, a read without a pagination cursor returned:

{
  "request": {
    "turnLimit": 1,
    "includeOutputs": false
  },
  "threadStatus": "active",
  "page": {
    "order": "newest_first",
    "limit": 1,
    "hasMore": true
  },
  "newestReturnedTurn": {
    "status": "inProgress",
    "startedAtUtc": "2026-09-08T17:07:19Z",
    "completedAt": null
  }
}

The returned turn contains an older feature request and only its initial work items. A separate read with turnLimit: 3 returned that same stale newest turn and two earlier turns.

A read-only state_5.sqlite lookup and inspection of its referenced rollout showed:

  • The task row exists and archived = 0.
  • The referenced rollout exists and was approximately 54.7 MB.
  • A later user message is present as a top-level response_item user message at 2026-09-08T19:41:38.751Z, ordinal 3621.
  • The user's report of missing history is present as a top-level response_item user message at 2026-09-09T03:12:55.553Z, ordinal 6127.
  • The tail contains valid JSON records through 2026-09-09T03:39:22.786Z, ordinal 6186.

Those message checks inspected actual user-message records, not text quoted inside tool output. The full transcript was not uploaded.

What steps can reproduce the bug?

This is a captured occurrence, not yet a deterministic minimal reproduction:

  1. Use a local Codex Desktop task over an extended development session, with multiple follow-up messages and tool calls.
  2. Continue sending messages after earlier work.
  3. Observe that recent conversation history is missing from the task view.
  4. Read the same task with the app's read_thread tool, no cursor, and turnLimit: 1 or 3.
  5. Observe that the newest returned turn is from an earlier request.
  6. Inspect only that task's indexed rollout read-only; later user messages are still present.

The exact action that first triggered the divergence is unknown. A restart, update, compaction, or migration has not been established as the cause.

What is the expected behavior?

The task view and history-reading API should expose the latest persisted conversation in the correct order. If history loading or indexing fails, the app should show an actionable error and provide a safe way to reload/rebuild the visible history without losing the underlying transcript.

Additional information
  • Two app-tool reads showed the same stale latest-turn boundary.
  • No session files were moved, no SQLite records were edited, and the app was not restarted during this investigation.
  • The symptom suggests a divergence somewhere between persisted rollout data and exposed history, but the responsible layer has not been localized.
  • Related report #35746 concerns paginated history/projection inconsistencies. The same root cause has not been established here.
  • The task remains usable for new agent work; losing the conversation trail makes it difficult to review previous decisions and completion reports.

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 tracing the no-cursor read_thread path for the affected task and how it reads state_5.sqlite and the referenced JSONL rollout. Compare the latest persisted top-level user messages with the newest returned turn, then identify where the history diverges. Done means recent persisted messages appear in the correct order, with regression coverage for this stale-boundary case.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sqlite
Domain
backend-api-design, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.