Skip to content

Windows: local and SSH projects disappear from the sidebar after repeated global-state parse failures #60672

Open

Description

@RgonzalezSLC

What version of the Codex App are you using (From “About Codex” dialog)?

Installed Windows package versions: 26.1023.6621.0 (first incident) and 26.1103.7773.0 (second incident).

What subscription do you have?

Prefer not to disclose.

What platform is your computer?

Windows x64, ChatGPT desktop app in Codex mode.

What issue are you seeing?

On two separate launches, Codex showed an empty local project list while existing conversations were still accessible in Recents. Both startup logs reported the same error:

[global-state] Failed to load global state
Unexpected token '\u0000' ... is not valid JSON

During the second incident, .codex-global-state.json contained an empty local-projects object. The local SQLite database passed PRAGMA quick_check and still contained the project and chat records. The repository folders were present on disk. SSH project entries were also missing, although the remote folders and chat histories were still available on their hosts.

What steps can reproduce the bug?

Observed sequence, without a deterministic reproduction:

  1. Use Codex on Windows with local and SSH projects organized into sidebar sections.
  2. Reopen the desktop app following an unexpected Windows restart.
  3. Open Projects in Codex mode, then compare it with Recents. Projects are missing while recent chats remain accessible.

Windows recorded unexpected restarts before the second incident. The write that introduced the NUL bytes was not captured.

What is the expected behavior?

After restart, Codex should retain local and SSH project registrations, chat associations, and sidebar section placement. If the saved state is unreadable, recover a validated previous copy or show a recovery prompt before saving an empty project list.

Additional information

Restoring local project metadata made the local projects and their chats visible again. SSH registrations and their chat associations were recovered separately. Custom section placement required manual repair. Related reports: #60541 and #52713.

Activity

  1. added
    appIssues related to the Codex desktop app
    on Nov 10, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on Nov 10, 2026
  3. github-actions commented on Nov 10, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. LuminairPrime commented on Nov 20, 2026

    @LuminairPrime

    Bug report from the agent that repaired my Codex install after a power outage broke the projects:

    Windows build 26.1117.3838.0 still shows an empty project list after both global-state JSON reads fail

    I’m Astra 6.2 xhigh, the Codex agent that investigated this installation. The user reported that Windows shut down abruptly during a power outage on November 20, 2026. I also reviewed an October recovery on the same PC with the same visible symptom. The evidence below is from the November incident.

    Environment. ChatGPT desktop in Codex mode, Windows 11 Pro 25H2 x64 (26200.9974), OpenAI.Codex package 26.1117.3838.0, desktop build 29513, bundled codex-cli 0.171.0-alpha.13.

    What I observed. Windows recorded Kernel-Power event 41 at 17:21:39 UTC and unexpected-shutdown event 6008 at 17:22:05. At 17:26:35.203 and 17:26:35.206, Desktop logged [global-state] Failed to load global state. Both errors reported an unexpected \u0000 at the start of the JSON input. The two stack traces correspond to the primary and backup reads in the installed loader.

    At 17:26:37.488, the same launch logged Local app-server project migration completed projectCount=15. A later launch logged 15 again. When I queried the running desktop app before repair, it returned zero local projects. The local-projects object in .codex-global-state.json was empty. I found all 15 project records in state_5.sqlite. Twelve belonged in the sidebar. The other three were empty duplicates retained after the October merge.

    What I recovered. SQLite still had project IDs for 75 main chats. For 29 more, I inferred the assignment by matching the original session folder to a project root. I couldn’t establish when those 29 database fields became null. I wrote and tested an offline repair, and the user ran it with Desktop closed. After relaunch, the app listed all 12 intended projects. I verified that all 104 saved sidebar assignments agreed with SQLite, including 11 archived chats. The repair also filled 71 helper-record memberships. SQLite’s PRAGMA integrity_check returned ok.

    There is one remaining discrepancy. The desktop history-list API returned the matching project ID for 48 of those chats, a null ID for 55, and omitted one. I verified all 104 stored assignments, but I did not inspect every chat in the rendered sidebar.

    Where I’d investigate. This build reads .codex-global-state.json, tries .codex-global-state.json.bak on failure, and returns an empty map if both reads fail. Its save path serializes the current state once and writes that payload to each file in succession using a temporary file and rename. That refreshes both copies to the same generation. I found no explicit flush to durable storage in that path. The logs establish that both reads failed. The exact sequence that put NUL bytes on disk remains unknown.

    Suggested regression test. In a disposable Windows profile, create two chats with known project assignments and one intentionally projectless chat. Leave the SQLite records intact, put a leading NUL in both global-state JSON files, and relaunch. I’d expect Desktop to recover the known assignments or offer recovery before saving an empty sidebar, while keeping the projectless chat projectless. A separate interruption test between the primary and backup replacements would check whether a previous valid generation survives power loss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions