Codex Desktop corrupts local history on Windows: project sessions disappear and UTF-8 Chinese history becomes mojibake

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

Codex Desktop history corruption / project conversations disappear on Windows

Summary

Codex Desktop on Windows corrupted or failed to render local conversation history after an app update. Multiple historical conversations either disappeared from project-scoped history or opened as mojibake/garbled text. Some conversations also fail with the Desktop error page:

糟糕,出错了
检查更新
重试

Clicking retry opens a new conversation window instead of reliably loading the old thread.

Environment

  • OS: Windows
  • Codex Desktop app path observed:

C:\Program Files\WindowsApps\OpenAI.Codex_26.513.3673.0_x64__2p2nqsd0c76g0\app\Codex.exe

  • Codex Desktop version observed from install path: 26.513.3673.0
  • Local history root:

C:\Users\Administrator\.codex\sessions

  • Local history index:

C:\Users\Administrator\.codex\session_index.jsonl

  • Logs root:

C:\Users\Administrator\AppData\Local\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs

Affected thread IDs

  • 019e344f-b3f0-79b2-872f-cfa151775bbc
  • 019dde0b-5967-7313-813c-e103d1e2cea1
  • 019e1228-ddec-7230-adfa-fcc0dcce6b87

Symptoms

  1. Project-scoped histories disappeared for multiple projects, including:
  • D:\projects\量化
  • D:\projects\video_play
  • D:\projects\submox
  1. Some local rollout JSONL files still exist and are indexed, but Codex Desktop does not show them under the correct project.
  2. Some conversations open as garbled mojibake text.
  3. Some conversations fail to open entirely and show the generic Desktop error screen.
  4. One observed project path was corrupted from:

D:/projects/量化
to:
D:/projects/閲忓寲
which caused project grouping/history filtering to fail.

  1. Logs showed a renderer/parser failure in LocalConversationPage with an error similar to:

invalid syntax at line 1 col 5: cwd="D:\projects\..."

Local checks

  • session_index.jsonl had 319 valid JSON lines and no JSON parse errors after validation.
  • The affected project sessions existed on disk under ~\.codex\sessions.
  • Some active rollout files were corrupted/garbled, but earlier backups contained cleaner versions.
  • Example: 019e1228-ddec-7230-adfa-fcc0dcce6b87
  • Active file became garbled and shorter.
  • A cleaner backup existed under:

C:\Users\Administrator\.codex\tmp\codex-history-sanitizer-backups\20260517-150540-manual\...

Expected behavior

  • Codex Desktop should preserve local JSONL history as UTF-8.
  • Project-scoped history should group conversations by the correct cwd, including Unicode paths such as D:\projects\量化.
  • A malformed or unrenderable message should not crash the whole conversation page.
  • The app should provide a recovery path when a local conversation record contains invalid markdown/directive syntax.

Actual behavior

  • Project history disappears or is grouped under corrupted paths.
  • Conversations open as garbled text.
  • Some conversations crash the local conversation renderer.
  • Clicking retry opens a new window instead of recovering the selected thread.

Impact

This blocks real work in Codex Desktop. The user cannot reliably access historical project conversations, and new conversations may also become affected after app updates or history rewriting.

Request

Please investigate Codex Desktop local history handling on Windows, especially:

  • UTF-8 preservation for JSONL history files.
  • Unicode project paths in cwd.
  • Project-scoped history grouping from session_index.jsonl and rollout JSONL metadata.
  • Robust rendering of local conversation history when a message contains directive-like text or Windows paths.
  • Recovery tooling for corrupted local history.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 3 months ago

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

  • #23054
  • #23046
  • #23060
  • #23013
  • #22963

Powered by Codex Action

boombx403-byte · 9 days ago

Hi @addincaoy1981, your report looks related to a local session discovery/inventory gap rather than necessarily a lost rollout. I've released Codex Rescue Alpha5, a local read-only diagnostic tool that performs filesystem-first discovery across active and archived rollouts and cross-references SQLite/index metadata without modifying any state.

If you still have the affected local Codex directory, you can inspect it via:

pip install codex-rescue==0.1.0a5
codex-rescue sessions --json

No raw files or databases are needed. If you choose to share output, please review and sanitize any private repository paths or names first.

shleder · 4 days ago

For the Windows local-history corruption report, please test the accessible .codex session root and report whether Vetto finds intact JSONL even when the desktop UI does not.

Thanks for the detailed report. This is a good candidate for a bounded recovery check. Vetto 0.2.0-alpha.2 is available from npm and adds a read-only, copy-only Codex rescue adapter. It does not resume Codex, edit rollout files, or write vendor SQLite. On a disposable copy, try: npm install --global @shleddy/vetto@next; vetto rescue --adapter codex --root <CODEX_HOME> --json scan; then use the exact returned key with diagnose and snapshot ... --output ./vetto-recovery/session.jsonl. Please report OS, Codex/Vetto versions, sanitized JSON, and source SHA-256 before/after; never upload raw transcripts, auth/config, prompts, or tokens. An explicit unavailable/unsupported result is useful too.