Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.1103.60933
What subscription do you have?
Codex desktop on Windows 11. The installed package inspected after the second incident was OpenAI.Codex_26.1103.7773.0_x64.
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Twice, after an unclean Windows restart, my local projects disappeared from the Codex Projects sidebar while existing conversations remained visible under Recents.
Timeline (SAST, UTC+02:00):
- 23 October 2026: Windows logged Kernel-Power Event 41 at 07:39:07. Codex logged NUL-byte JSON parse failures at 07:39:57.
- 10 November 2026: Windows logged Kernel-Power Event 41 at 08:12:28. Codex logged the same parse failures at 08:22:00.
Representative error excerpt:
[global-state] Failed to load global state
SyntaxError: Unexpected token '\u0000' ... is not valid JSON
After the second incident, the desktop registry contained only 1 of the 17 expected project registrations. The SQLite database still contained all 1,391 pre-incident chat IDs. Restoring the missing registrations and their original project ID mappings recovered the sidebar without editing SQLite or chat history.
Inspection of the installed desktop code showed that the app replaces .codex-global-state.json and its .bak sequentially using temporary writes and renames, with no explicit flush before replacement. If both files fail to parse, the app starts with an empty global state. An interrupted write is a plausible explanation, but the actual failing write was not captured.
Expected: preserve a separately validated last-known-good registry, flush and validate new state before replacing it, and show a recovery error if neither copy can be read rather than silently starting with empty state.
What steps can reproduce the bug?
Observed sequence; I do not have a deterministic reproduction:
- Use Codex desktop on Windows with existing local projects and conversations.
- Windows restarts unexpectedly. This occurred naturally on two occasions; I did not deliberately interrupt power or force a crash.
- Reopen Codex. The Projects sidebar loses its local registrations, but existing conversations remain visible under Recents.
- Check the desktop startup logs for
[global-state] Failed to load global statewith a\u0000JSON parse error.
This is a local startup and persistence issue. No specific prompt, session ID, token limit, or context-window size is known to trigger it.
Suggested engineering test: use a disposable Windows profile and inject interruptions at each temporary write, flush, and rename boundary. On restart, verify that the last valid registry, original project IDs, and chat associations survive.
What is the expected behavior?
After an unexpected Windows restart, Codex should retain existing project registrations, original project IDs, and chat associations.
If the primary registry is unreadable, Codex should recover from a validated last-known-good copy. If no valid copy is available, it should preserve the damaged files and show a clear recovery message instead of silently starting with an empty or incomplete registry.
Additional information
About Codex version: 26.1103.60933.
Installed Windows package version inspected after the second incident: 26.1103.7773.0.
Both incidents followed an unclean restart. An interrupted write is a plausible explanation, but the failing write was not captured and the issue has not been reproduced under controlled conditions.
Suggested fix: flush and validate new state before replacing the registry, and retain a separately verified last-known-good copy. Redacted desktop log excerpts and Windows event details are available on request.
Activity
growmachines commentedon Nov 10, 2026
The problem was caused by a power faileure.
LuminairPrime commentedon Nov 20, 2026
Bug report from the agent that repaired my Codex install after a power outage broke the projects: