Codex Desktop leaves rollout files unindexed in state DB, including current Windows/WSL Desktop sessions

Open 💬 4 comments Opened Jul 7, 2026 by atlantho

What version of Codex CLI is running?

codex-cli 0.142.5

What platform is your computer?

Windows 11 Pro, x64, OS build 10.0.26200, locale de-DE.

Codex is installed with the standalone Windows installer. The Windows Codex Desktop app is configured to run the agent in WSL:

[desktop]
runCodexInWindowsSubsystemForLinux = true
integratedTerminalShell = "wsl"

The WSL-side CLI is also installed as standalone and available through a compatibility wrapper:

/usr/local/bin/codex -> /home/<wsl-user>/.local/bin/codex
codex-cli 0.142.5

What issue are you seeing?

codex doctor reports that rollout files are missing from the state DB thread inventory, even though the state databases are healthy and the rollout files exist on disk.

This is not limited to old archived sessions. The missing set includes recent/current Codex Desktop sessions from the same day, including a large active Desktop thread in the current workspace.

There is no codex doctor repair, reindex, or equivalent command exposed by the CLI, so there does not appear to be a safe supported way to reconcile the state DB with the existing rollout files.

Doctor report excerpt

Codex Doctor v0.142.5 · windows-x86_64

Environment
  ✓ state        databases healthy
      state DB                 C:\Users\<USER>\.codex\state_5.sqlite (file) · integrity ok
      log DB                   C:\Users\<USER>\.codex\logs_2.sqlite (file) · integrity ok
      goals DB                 C:\Users\<USER>\.codex\goals_1.sqlite (file) · integrity ok
      memories DB              C:\Users\<USER>\.codex\memories_1.sqlite (file) · integrity ok
      active rollouts          166 files · 371.13 MB
      archived rollouts        12 files · 313.32 MB

  ⚠ threads      rollout files are missing from the state DB
      rollout DB active files  166
      rollout DB archived files 12
      rollout DB rows          121
      rollout DB active rows   116
      rollout DB archived rows 5
      rollout DB missing active rows 50
      rollout DB missing archived rows 7
      rollout DB stale rows    0
      rollout DB scan errors   0
      rollout DB malformed file names 0
      rollout DB duplicate rollout thread ids 0
      rollout DB duplicate DB paths 0
      rollout DB sources       subagent:other=56, vscode=46, subagent:thread_spawn=12, cli=7

Local reconciliation results

I compared the filesystem rollout files with references in state_5.sqlite in read-only mode. The result exactly matches codex doctor:

Rollout files total: 178
Indexed according to DB comparison: 121
Missing according to DB comparison: 57

Missing by kind:
  active: 50
  archived: 7

Missing by month:
  2026-05: 13
  2026-06: 34
  2026-07: 10

A deeper read-only analysis of the 57 unindexed rollout files shows they are not just old cleanup leftovers:

Top source groups:
  47x Codex Desktop=1
  8x vscode=1; Codex Desktop=1
  1x vscode=10; Codex Desktop=10
  1x vscode=4; Codex Desktop=4

Top model groups:
  28x codex-auto-review=2
  10x codex-auto-review=4
  4x gpt-5.5=2
  2x gpt-5.5=20
  1x gpt-5.5=456

Recent examples from July 2026 include current/recent Desktop sessions:

2026-07-07 18:26:53  active  3.42 MB  2121 lines  model gpt-5.5=456
cwd: C:\Users\<USER>\Documents\Codex\2026-07-07\i

2026-07-07 14:19:57  active  0.71 MB  310 lines  model gpt-5.5=20
cwd: /home/<wsl-user>/work/journal

2026-07-07 16:12:00  active  0.15 MB  12 lines  model codex-auto-review=2
cwd: C:\Users\<USER>\Documents\Codex\2026-07-07\i

Steps to reproduce / observed workflow

  1. Use Codex Desktop on Windows with WSL agent mode enabled:

``toml
[desktop]
runCodexInWindowsSubsystemForLinux = true
integratedTerminalShell = "wsl"
``

  1. Work normally across Windows Desktop sessions and WSL-backed sessions.
  2. Run:

``powershell
codex doctor --summary
``

  1. Observe:

``text
⚠ threads rollout files are missing from the state DB
``

  1. Run:

``powershell
codex doctor --all --no-color
``

  1. Observe that the missing rollout files include recent/current Desktop rollouts, not only old archived history.

Expected behavior

Either:

  1. Every valid rollout file written by Codex Desktop/CLI should have a matching row in the state DB thread inventory, or
  2. Codex should provide a supported repair/reindex command that can safely reconcile state_5.sqlite with existing rollout files, or
  3. codex doctor should classify known intentionally-unindexed internal rollouts separately instead of warning that thread inventory differs.

Actual behavior

  • Rollout files exist on disk.
  • State databases pass integrity checks.
  • codex doctor reports 57 rollout files missing from the state DB.
  • Missing files include current/recent active Desktop sessions.
  • There is no exposed repair/reindex command:
codex doctor --help     # diagnostics only
codex --help            # resume/archive/delete exist, but no repair/reindex command

Why this matters

This leaves users with a degraded doctor report and no clear safe remediation. Moving or deleting rollout files can hide the warning but risks losing recent/current chat history. Editing SQLite manually is unsafe and likely to be overwritten or made inconsistent by the app.

A supported reconciliation path would be useful, especially for active Windows Desktop + WSL users.

Related issues

This looks related to, but distinct from, the stale-row side of thread inventory drift reported in:

  • #31074 — state DB/session index rows pointing at missing rollout files

This report is the opposite direction: rollout files exist, but state DB rows are missing. It also appears in a Windows Desktop + WSL setup where recent Desktop rollouts are affected.

There is also a separate Windows/WSL MCP path issue where Desktop rewrites node_repl to a /mnt/c/.../node_repl.exe path that native PowerShell codex doctor cannot resolve; that appears to be a separate WSL/Desktop config issue and is not the main focus of this report.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗