Skip to content

Codex startup failure, missing projects, null values in codex.toml #57300

Open

Description

@Kaveendra

Subject: Formal complaint —

Date: 27 October 2026
Timezone: Australia/Sydney (AEDT)
Product: Codex desktop for Windows
Desktop version recorded in logs: 26.1021.31345
Windows package version: 26.1021.3705.0
Subscription: Pro

On opening Codex, I received this error:

“ChatGPT configuration could not be loaded”
C:\Users[username].codex\config.toml:1:7635:
key with no value, expected '='

I deleted config.toml to get the application running. Afterwards, all my local projects disappeared from the Projects tree.

The latest original configuration backup found during recovery was config.toml.vexp-bak, dated 4 October 2026. No newer original configuration backup was found in the locations searched.

The recovery investigation found that 20 original project records still existed in state_5.sqlite, while the separate “local-projects” list in .codex-global-state.json was empty. The desktop startup log reported loading the project records, but the sidebar remained empty.

During troubleshooting, the assistant made several unsuccessful changes and repeatedly asked me to restart Codex. It presented unverified explanations with excessive certainty. These attempts included changing migration flags, modifying chat-to-project assignments and the desktop catalog, and creating a temporary recovery project.

The successful recovery was performed with Codex fully closed. A launcher:

  1. Backed up the current global state and databases.
  2. Restored the 20 saved sidebar project entries from an older global-state snapshot.
  3. Matched those entries to existing database project IDs and restored associated sidebar metadata.
  4. Removed the temporary recovery project and corrected unintended remote-host catalog assignments from an earlier attempt.
  5. Verified the restored records before I reopened Codex.

I confirmed that the projects returned after this recovery.

Exact recovery launcher:
C:\Users[username]\Documents\Codex\2026-10-27\whe\outputs\Restore-Codex-Projects.cmd

Supporting recovery scripts, in the same folder:
Restore-Codex-Projects.ps1
restore_codex_projects.py

Recovery verification report:
C:\Users[username]Documents\Codex\2026-10-27\whe\outputs\recovery-result.json

Backup created by the successful recovery:
C:\Users[username].codex\sidebar-recovery-backup-20261027-094028

Snapshot used to restore the sidebar:
C:\Users[username].codex..codex-global-state.json.tmp-1790803971401-75c7a68f-5a34-498b-bfbf-02cebbdca74f

Affected sidebar state:
C:\Users[username].codex.codex-global-state.json

Recovery chat ID:
01a17a49-e475-7023-8a44-38061dc60052

Please investigate the original configuration failure, why existing database projects were not restored to the sidebar, and the quality of the assistant’s recovery guidance. The cause of the original configuration corruption was not established.

Please provide a complaint reference number, an engineering review, and guidance on preventing recurrence.

Activity

  1. added
    bug
    app
    windows-os
    config
    session
    model-behavior
    on Oct 26, 2026
  2. github-actions commented on Oct 26, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. Kaveendra commented on Oct 26, 2026

    @Kaveendra
    Author

    This is the recover script which solved my issues.

    Restore-Codex-Projects.zip

  4. charleswanghc commented on Nov 18, 2026

    @charleswanghc

    Additional independent report (November 18, 2026, Asia/Taipei) from an affected Windows Codex Desktop user. Reporting on the user's explicit request; no personal projects, account details, or conversation contents are included.

    Observed sequence

    1. The Windows laptop shut down unexpectedly and restarted.
    2. Opening Codex produced a modal saying the ChatGPT configuration could not be loaded, with:
      C:\Users\User\.codex\config.toml:1:6995
      key with no value, expected `=`
      
    3. Following troubleshooting guidance, the user renamed the damaged config.toml to config.toml.bak (did not delete the backup).
    4. Codex then opened successfully, but all previously listed local projects had disappeared and previous conversations were no longer grouped under their respective Recent/Projects entries.

    Not yet verified

    • Exact Codex Desktop package/build and Windows build have not yet been collected.
    • Whether the damaged TOML contains NUL bytes remains unverified.
    • We have not inspected the user's state_5.sqlite, session transcripts, or .codex-global-state.json; therefore this is a reported UI/project-association loss, not a confirmed deletion of chats or source files.
    • The chronological sequence does not prove that renaming the config caused the project metadata loss.

    Expected behavior / request
    A malformed config.toml or unexpected system shutdown should never cause Codex Desktop to silently lose its local project registry, pinned/recent project organization, or chat-to-project associations. Please provide an in-app, supported recovery/reindex mechanism to reconcile existing SQLite project records and surviving session rollouts against an empty/corrupted desktop registry, preserving original project IDs, grouping, and last-known-good metadata. Also investigate crash-safe writes and backup/validation for both the config and global project state.

    Related recovery analysis: #54538 (projects in SQLite survive while the sidebar cache is empty), #60541 (unclean restart and global-state corruption).

  5. charleswanghc commented on Nov 18, 2026

    @charleswanghc

    Follow-up diagnostic evidence from the same affected Windows user (November 18, 2026, UTC+08:00). The user ran read-only PowerShell inventory commands, with the following confirmed file metadata:

    • .codex-global-state.json: 99,714 bytes, modified 2026-11-18 11:24:27 local time.
    • .codex-global-state.json.bak: same size and timestamp as primary.
    • PowerShell Get-Content -Raw | ConvertFrom-Json failed on both files. The exception details / independent JSON parser results have not yet been captured, so the precise corruption mode is unverified.
    • state_5.sqlite exists and is 17,391,616 bytes (2026-11-18 11:01:21).
    • session_index.jsonl exists and is 69,748 bytes (2026-11-17 14:45:49).
    • Both sessions and archived_sessions directories exist; their contents have not yet been enumerated.
    • Numerous historic ..codex-global-state.json*.tmp-* files survive; among nonempty candidates, one main-state snapshot from 2026-10-18 is 451,678 bytes, plus backups from earlier dates. Their JSON validity and project registry content are pending inspection.

    This strengthens the case that an unclean reboot can leave both current global-state files unparseable while an existing SQLite database and older snapshots survive. It does not establish deletion of project rows or chat transcripts. We are doing read-only snapshot validation before any restore, to avoid overwriting original IDs or newer sessions. Please prioritize a safe built-in recovery/reindex workflow and preservation of distinct last-known-good state snapshots.

  6. charleswanghc commented on Nov 18, 2026

    @charleswanghc

    Further diagnostic follow-up from the same affected Windows user (2026-11-18, UTC+08): a local Python read-only inventory has now verified the current global-state JSONs are syntactically valid, not malformed: both primary and .bak have local-projects = {} (0 entries). The earlier PowerShell ConvertFrom-Json errors were not reliable proof of damaged JSON.

    Other verified facts: SQLite PRAGMA quick_check = ok, projects = 44, project_roots = 47, threads = 767; all SQLite threads.project_id values are NULL. The sessions directory contains 772 files and archived_sessions 2 files (contents not yet verified). Among valid global-state snapshots, 2026-10-18 retained 18 legacy project registrations, 2026-10-02 and 2026-09-24 each retained 11 (a subset of those 18), and 2026-09-03 retained 11 different legacy project IDs. Across valid historical snapshots there are 29 distinct legacy project registration IDs, including IDs from projects the user repeatedly manually re-added after earlier sidebar losses. An existing SQLite database may therefore contain multiple generations of the same working-directory roots and project IDs.

    Recovery needs to reconcile the historical registration IDs and chat grouping with the 44 newer database rows, rather than blindly restoring one prior full global-state file. Please consider a built-in version-aware project registry restoration/reconciliation and crash-safe history. No private paths, project names, or thread contents are shared here.

  7. charleswanghc commented on Nov 18, 2026

    @charleswanghc

    Further read-only reconciliation results for the same Windows user's November 18 incident (no personal project names, paths, or thread IDs included):

    • Examined 33 global-state files; 12 are valid JSON; 9 valid historical snapshots retain local project registrations.
    • Identified 29 historical legacy desktop project IDs across the surviving snapshots, representing 22 distinct historical normalized root-path sets. The same root set can have multiple re-created legacy IDs due to earlier sidebar-loss/re-add cycles.
    • SQLite still reports quick_check=ok, 44 project rows, 47 project_root rows, 767 thread rows, and 0 non-NULL thread.project_id rows.
    • Every one of the 29 legacy IDs occurs in the surviving idempotency-key data; 25 legacy IDs have multiple SQLite project-row matches by path, emphasizing the need to resolve aliases using original idempotency keys rather than a naive path match.
    • Three SQLite project records have root paths not represented by the historical snapshot registry; some represent projects created after the last usable snapshot. Blind rollback would drop them from the sidebar.
    • 53 unique historical thread IDs have explicit project assignments in at least one snapshot. 18 have changing assignments across snapshots; of these, 11 are between aliases of identical root sets, while 7 involve distinct or overlapping root sets and require extra review.
    • A read-only working-directory aggregate indicates a large number of extant threads whose cwd exactly matches a known project root, but those matches are inference, not proof of original user-assigned grouping.

    We are preparing a case-specific two-stage preview/restore process which preserves the current global-state owner atoms, original legacy identity mapping, and all SQLite/session files; it explicitly flags non-identical-root conflicts rather than silently merging them. Request to upstream: support first-party reconciliation of duplicate historical project registrations, existing idempotency-key relationships, missing sidebar cache, and chat associations after interrupted restarts.

    No definitive root cause or complete UI restoration is claimed yet.

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

    appbugconfigmodel-behaviorsessionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions