Codex Desktop conversations become empty and resume fails with stale Windows path

Open 💬 4 comments Opened May 23, 2026 by Solitmag
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

On Windows, many Codex Desktop conversations gradually become unavailable or show as empty / "No conversation" in the UI, even though the local SQLite database and rollout JSONL session files still exist.

Reinstalling Codex Desktop did not fix the issue.

A related resume failure shows that the app treats two equivalent Windows paths as different paths:

cannot resume running thread 019e49af-8706-7773-b282-4be83c769e19 with stale path:
requested `\\?\C:\Users\<USER>\.codex\sessions\2026\05\21\rollout-2026-05-21T16-38-23-019e49af-8706-7773-b282-4be83c769e19.jsonl`,
active `C:\Users\<USER>\.codex\sessions\2026\05\21\rollout-2026-05-21T16-38-23-019e49af-8706-7773-b282-4be83c769e19.jsonl`

These two paths refer to the same file on Windows, but Codex appears to compare them as raw strings and rejects the resume as stale.

Symptoms

  • Many old project conversations appear as empty / "No conversation" in Codex Desktop.
  • Some project folders previously had visible conversations, but over time the conversations disappeared from the UI.
  • Some conversations from around one month ago are no longer accessible from the UI.
  • Reinstalling Codex Desktop did not restore the missing/empty conversations.
  • The underlying rollout files still exist on disk.
  • state_5.sqlite still contains thread records, but session_index.jsonl appears incomplete/out of sync.

Environment

  • OS: Windows 11 Pro
  • OS version: 10.0.26200
  • Build: 26200
  • Architecture: x64
  • Filesystem: NTFS
  • Codex App package: OpenAI.Codex_26.519.3891.0_x64__2p2nqsd0c76g0
  • Codex executable version shown by Windows: 0.133.0.0
  • CPU: AMD Ryzen 9 8945HX
  • RAM: 32 GB
  • GPU: NVIDIA GeForce RTX 5070 Ti Laptop GPU + AMD Radeon 610M
  • Reinstall attempted: yes, issue persisted after reinstall

Local diagnostic findings

The following checks were performed without modifying the Codex data directory.

Thread database

state_5.sqlite still contains thread records:

threads_total: 277
active_threads: 269
archived_threads: 8

Most thread cwd values use the extended Windows path prefix:

cwd starts with \\?\ : 273
rollout_path starts with \\?\ : 3

Path prefix distribution:

cwd_prefix  rollout_prefix  count
\\?\        C:\             270
D:\         C:\             3
\\?\        \\?\            3
C:\         C:\             1

Rollout files

Rollout files still exist:

sessions rollout files: 270
archived rollout files: 10
session_index.jsonl lines: 175
missing rollout files referenced by state_5.sqlite: 0

This suggests the data files are present, but the UI/index layer is not showing or loading many of them correctly.

Example affected thread

For the thread that failed to resume:

thread id: 019e49af-8706-7773-b282-4be83c769e19

cwd:
\\?\C:\Users\<USER>\Documents\.Projects\<PROJECT>

rollout_path:
C:\Users\<USER>\.codex\sessions\2026\05\21\rollout-2026-05-21T16-38-23-019e49af-8706-7773-b282-4be83c769e19.jsonl

A later thread recording the failure has:

cwd:
\\?\C:\Users\<USER>\Documents\Codex\2026-05-21\cannot-resume-running-thread-019e49af-8706

rollout_path:
\\?\C:\Users\<USER>\.codex\sessions\2026\05\21\rollout-2026-05-21T17-57-40-019e49f8-2759-7fa0-909b-4d87a3339733.jsonl

So the local database contains a mixture of normal C:\... paths and extended \\?\C:\... paths.

Expected behavior

  • Codex Desktop should normalize equivalent Windows paths before comparing them.
  • C:\Users\<USER>\... and \\?\C:\Users\<USER>\... should be treated as the same path.
  • Conversations should not show as empty if the corresponding rollout JSONL file exists and is referenced by state_5.sqlite.
  • Reinstalling the app should not leave the history UI in a broken state if the local session data remains intact.
  • If session_index.jsonl is stale or incomplete, Codex should be able to rebuild it from state_5.sqlite and existing rollout files, or expose a repair command.

Actual behavior

  • Resume can fail with stale path even when requested and active paths point to the same file.
  • Many conversations appear empty or disappear from UI.
  • state_5.sqlite and rollout files still exist, but session_index.jsonl appears out of sync.
  • Reinstalling Codex Desktop does not resolve the issue.

Privacy note about logs

I am not attaching raw logs_2.sqlite publicly because it appears to contain sensitive data.

A quick local scan found occurrences of sensitive-looking strings such as:

NVIDIA_API_KEYS
api_key
API_KEY
Bearer
user.email
auth.json
phone-number-like strings
private URLs

However, diagnostic terms are also present in the logs:

cannot resume running thread
stale path
session_index
state_5.sqlite
No conversation / empty conversation UI text

I can provide a redacted diagnostic excerpt if maintainers specify what fields are safe and useful.

Related issue

This may be related to the Windows/path identity class of issues, especially:

That issue describes thread/resume rejecting equivalent rollout paths as stale when the same file is represented by different path spellings.

Requested help

Could Codex Desktop:

  1. Normalize Windows paths before stale-session comparison?
  2. Add a safe repair/reindex command for session_index.jsonl based on state_5.sqlite and existing rollout files?
  3. Recover/show conversations when rollout files exist but the UI displays them as empty?
  4. Document which local files should be backed up before reinstalling?
  5. Provide guidance for safely sharing logs without leaking credentials or personal data?

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #23900
  • #22971
  • #23803
  • #23311
  • #23979

Powered by Codex Action

jshaofa-ui · 3 months ago

Solution: Codex #24178 — Conversations Empty + Stale Windows Path

Issue: https://github.com/openai/codex/issues/24178
Labels: bug, windows-os, app, session
Competition: 1 comment (low competition)
Estimated Value: $1,000–$3,000
Created: 2026-05-23

---

Problem Summary

On Windows, Codex Desktop conversations become empty/unavailable over time. The underlying SQLite database and rollout JSONL files still exist, but the UI shows "No conversation." A related resume failure shows that Codex treats two equivalent Windows paths as different:

cannot resume running thread 019e49af-... with stale path:
requested `\\?\C:\Users\<USER>\.codex\sessions\...\rollout-....jsonl`,
active `C:\Users\<USER>\.codex\sessions\...\rollout-....jsonl`

These two paths refer to the same file on Windows, but Codex compares them as raw strings.

Environment: Windows 11 Pro 26200, Codex 0.133.0.0, NTFS filesystem

---

Root Cause Analysis

Root Cause 1: Windows Path Normalization (Primary)

Windows supports multiple equivalent path formats:

| Format | Example | Description |
|--------|---------|-------------|
| Standard | C:\Users\foo\.codex\... | Standard Windows path |
| UNC/Extended | \\?\C:\Users\foo\.codex\... | Extended-length path (32767 char limit) |
| UNC Network | \\server\share\... | Network path |
| Short name | C:\Users\FOO\APPD~1\... | 8.3 short name |

The \\?\ prefix is automatically added by:

  1. Windows API functions when paths exceed 260 characters
  2. Node.js fs module when using certain operations
  3. Electron's native modules when resolving paths

The bug: Codex stores paths in one format (e.g., C:\Users\...) but later resolves them in another format (e.g., \\?\C:\Users\...). The string comparison fails, causing:

  1. Resume failures ("stale path")
  2. Conversation lookup failures (path doesn't match database record)
  3. Session index desynchronization

Root Cause 2: Session Index Desync (Secondary)

The session_index.jsonl file appears to be incomplete or out of sync with the SQLite database. This could be caused by:

  1. Crash during index write: If the app crashes while writing to the index, the index becomes corrupted
  2. Concurrent writes: Multiple processes writing to the index without proper locking
  3. Path mismatch: The index stores paths in one format, but lookups use another format

---

Proposed Fix

Fix 1: Path Normalization Utility (Primary)

// src/common/path-normalizer.ts

import path from 'path';
import fs from 'fs';

/**
 * Normalize a Windows path to a canonical form.
 * Handles: \\?\ prefix, forward/backward slashes, case sensitivity,
 * short names, and trailing separators.
 */
export function normalizeWindowsPath(inputPath: string): string {
  if (process.platform !== 'win32') {
    return path.resolve(inputPath);
  }
  
  let normalized = inputPath;
  
HeyDachui · 3 months ago

Additional Windows reproduction from another local Codex Desktop install.

I am seeing the same stale-path class of failure, but with one extra data point: offline normalization of the local state database does not persist after restarting Codex.

Symptom

Codex repeatedly fails to resume a running thread with a stale path error where the requested and active paths differ only by the Windows extended-path prefix:

requested: C:\Users\<USER>\.codex\sessions\...
active:    \\?\C:\Users\<USER>\.codex\sessions\...

These point to the same file on Windows, but the resume guard appears to treat them as different paths.

Scope observed

This is not limited to one old or very large conversation. I have seen it affect:

  • newly created threads
  • threads already marked task_complete
  • currently running threads
  • session JSONL files that are not unusually large

Local repair attempted

With Codex fully exited, I performed two offline repair passes:

  1. Backed up and repaired state_5.sqlite
  2. Normalized threads.rollout_path and threads.cwd
  3. Backed up and reset Session Storage
  4. In the second pass, also backed up and reset Local Storage
  5. Did not delete any session JSONL files
  6. Did not clear the logs database
  7. Did not modify Codex configuration

Immediately after the offline repair, the database looked clean:

{
  "after": {
    "rollout_path_extended": 0,
    "cwd_extended": 0,
    "integrity_check": "ok"
  }
}

However, after restarting Codex, extended-path prefixes were written back into local state again:

rollout_path_extended: 1
cwd_extended: 77

Interpretation

This suggests the root cause is not only stale local user data. Codex itself appears to write some Windows paths back using the \\?\ form while resume requests may use the regular C:\... form. If the resume comparison happens before Windows path normalization, equivalent paths can be rejected as stale.

Suggested product-side fix

It would help if Codex normalized path identity before comparing:

  • threads.rollout_path
  • threads.cwd
  • active running thread path
  • branch/session restore path
  • recent/session restore path

At minimum, if two paths differ only by \\?\ vs regular drive-letter form and resolve to the same file, resume should not be blocked as stale.

I am not attaching raw logs or session files publicly because they may contain private local paths or credentials. I can provide redacted diagnostics if maintainers specify what would be useful.

shleder · 14 days ago

This is a strong local-state mismatch: 270 active rollout files still exist, SQLite references none as missing, but equivalent C:\... and \\?\C:\... spellings make resume reject the same file as stale and many chats appear empty.

I’m testing Codex Rescue against this boundary. It scans rollouts independently and leaves SQLite, session_index.jsonl, and source files untouched. It cannot fix Codex’s Windows path comparison or rebuild the Desktop UI, but it may identify the durable sessions and report their state safely.

Could you try:

pipx install codex-rescue==0.1.0a3
codex-rescue sessions
codex-rescue doctor --latest

Sanitized output is enough—please don’t share raw rollouts, databases, logs, usernames, prompts, paths, API keys, or secrets.

https://github.com/shleder/codex-rescue