Skip to content

[Windows] Empty desktop project cache hides intact database projects; restoring cache resolves it (26.1013.3656.0) #54538

Open

Description

@mutasimadil

What version of the Codex App are you using?

Windows package version: 26.1013.3656.0.
Bundled app-server reported version: 0.163.0-alpha.10.2.

What platform is your computer?

Windows 11 Professional, x64, OS build 10.0.22631.

What issue are you seeing?

All six existing local Codex projects disappeared from the desktop sidebar. The app's list_projects tool returned the ChatGPT projects but no local projects. Existing local chats were still discoverable.

The underlying data was present:

  • state_5.sqlite contained six rows in projects and seven project_roots rows (one project has two roots).
  • Every stored root folder existed.
  • PRAGMA quick_check returned ok.
  • The desktop global state file contained an empty local-projects object.
  • The database had no non-null threads.project_id values at the time of inspection. This was observed, but the earlier assignment state is not established.
  • Fully quitting and reopening the app did not restore visibility.

A startup log after restart reported:

[host-app-server-projects] Local app-server project migration completed projectCount=6

What steps can reproduce the bug?

The event that initially emptied the sidebar state is unknown. We cannot confirm that an update or crash caused it.

Observed sequence:

  1. Open the Windows desktop app and find all established local projects missing.
  2. Confirm that project/root rows and folders still exist.
  3. Confirm that local-projects in the desktop global state file is empty.
  4. Fully quit and reopen the app.
  5. Observe that startup reports six migrated projects but the local project list remains empty.

What is the expected behavior?

The desktop sidebar should retain existing local projects across restarts. If the sidebar cache is empty while the app-server/database contains valid projects, the app should reconcile the project catalog rather than silently showing no local projects.

Additional information: confirmed recovery

The user confirmed that project visibility returned after this local recovery:

  1. Fully quit the desktop app.
  2. Back up .codex-global-state.json.
  3. Reconstruct the six local-projects cache entries from the existing projects and project_roots database records.
  4. Recover the original legacy project IDs from project_idempotency_keys and restore app-server-project-id-by-legacy-project-id-by-host for the local host.
  5. Restore the corresponding project-order entries.
  6. Reopen the app.

The recovery did not modify the SQLite database or project folders. These cache/mapping/order changes were applied together, so this report does not isolate which individual field was sufficient.

Inspection of the installed build's code suggests the renderer obtains local projects through getLocalProjectsForRenderer() and the desktop project cache, while startup can enumerate server projects without repopulating missing ordinary cache entries. This is a diagnostic hypothesis, not a confirmed upstream root cause.

Related reports: #53251, #48501.

Private project names, absolute user paths, account identifiers, full state files, and conversation contents are intentionally omitted.

Activity

  1. added
    bug
    app
    windows-os
    session
    on Oct 16, 2026
  2. github-actions commented on Oct 16, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. blackcometclub commented on Oct 18, 2026

    @blackcometclub

    I experienced a very similar incident on an earlier Windows build, although the recovery method was slightly different.

    Environment

    • Date observed: October 3, 2026
    • Codex Windows package: OpenAI.Codex_26.930.3930.0_x64
    • Codex data directory: %USERPROFILE%\.codex
    • The issue was discovered immediately after restarting Windows following a thunderstorm-related power outage.
    • However, I cannot establish whether the power interruption directly caused the loss of the project-related global-state fields.

    This appears to show that the problem existed in a Windows build older than 26.1013.3656.0.

    Symptoms

    All local projects disappeared from the Codex desktop sidebar. The sidebar showed that there were no projects, while recent chats remained accessible.

    Fully quitting and restarting Codex did not restore the projects. Restarting Windows did not help either.

    The project directories themselves had not been deleted or moved.

    Database inspection

    The underlying SQLite database was still intact:

    • state_5.sqlite contained 16 rows in projects
    • It contained 17 rows in project_roots
    • Every recorded project root still existed on disk
    • PRAGMA quick_check; returned ok

    Therefore, this was not a loss of the project directories or the primary project records.

    Global-state inspection

    The current .codex-global-state.json was compared with a known-good copy from the previous day.

    In the broken state:

    • local-projects existed but was empty
    • sidebar-project-thread-orders existed but was empty
    • active-workspace-roots was missing
    • electron-saved-workspace-roots was missing
    • app-server-project-id-by-legacy-project-id-by-host was missing
    • thread-project-assignments was missing
    • thread-project-membership-host-ids was missing
    • project-order was missing
    • Project selection, pinning, workspace-root hints, writable-root information, and several related project/thread fields were also missing

    The known-good state contained:

    • 16 local-projects entries
    • The legacy-project-ID to app-server-project-ID mapping
    • 133 thread-to-project assignments
    • Project ordering and sidebar ordering
    • Workspace-root information
    • A project migration checkpoint

    The migration-state object itself was still present in the broken state, but much of the state that the migration depended on was absent or empty.

    Recovery used in this case

    Unlike the recovery described in this issue, I did not reconstruct the project cache directly from the current database. A known-good .codex-global-state.json from the previous day was available, so I selectively restored only the project-related fields from that file.

    The recovery procedure was:

    1. Fully close Codex and verify that no Codex-related processes remained.
    2. Back up the current SQLite database, configuration, global-state file, and its backup.
    3. Record SHA-256 hashes of the recovery inputs.
    4. Verify SQLite integrity with PRAGMA quick_check.
    5. Verify that the current database still contained the expected 16 projects and 17 roots.
    6. Load the current global state and the known-good global state.
    7. Copy only the project/workspace and thread-membership fields from the known-good state into the current state.
    8. Preserve all unrelated current settings.
    9. Validate the merged JSON and verify the expected project and assignment counts.
    10. Write the merged state to a staging file.
    11. Move the pre-repair state into a timestamped rollback directory before installing the replacement.
    12. Restore the original files automatically if installation or validation failed.
    13. Start Codex manually.

    The restored migration checkpoint had:

    • projectsMigrated = true
    • threadAssignmentsMigrated = false

    After restoring these fields together, Codex reopened with the existing database project records intact and all 16 projects visible in the sidebar.

    The specific contribution of the migration checkpoint was not isolated.

    Important differences from this report

    This case restored several related fields together from a known-good backup. It therefore does not establish which individual field was necessary or sufficient to restore the sidebar.

    It also does not prove what originally removed those fields.

    The incident was discovered immediately after a thunderstorm-related power outage, but the exact failure mechanism remains unknown. An interrupted migration, failed state write, upgrade, or crash is possible, but none of those causes was confirmed.

    However, the result is consistent with the hypothesis in this issue:

    • Valid project records can remain in state_5.sqlite
    • The project folders can remain intact
    • The desktop sidebar can still show no local projects when its global cache, mappings, ordering, or migration-related state is absent
    • Restarting the application does not necessarily rebuild that state
    • Restoring the missing cache and mapping information makes the projects visible again

    Suggested improvement

    It would be safer if the desktop app detected this inconsistency and rebuilt or reconciled the sidebar catalog from valid projects and project_roots records instead of presenting an empty project list.

    A useful recovery UI could also distinguish between:

    1. No projects exist.
    2. Projects exist in the database, but the sidebar cache is empty.
    3. Project roots are recorded but are no longer accessible on disk.

    That distinction would avoid making an intact project catalog appear permanently deleted.

  4. XiaoTianFan commented on Oct 20, 2026

    @XiaoTianFan

    Independent confirmed recovery on Windows package OpenAI.Codex 26.1013.4894.0, observed October 20, 2026. This matches the empty local-project cache described here. All 19 local projects are visible again, and existing chats appear under their projects after restoring the desktop cache and membership state.

    This adds a case where an up-to-date complete global-state backup was unavailable: project identities came from the intact database, with older saved state and recorded workspace paths used to reconstruct membership.

    Before recovery

    • All local projects disappeared on launch; existing chats remained accessible in Recents and retained workspace context. A quit/relaunch did not restore them. An update was suspected, but the initial cause is not established.
    • state_5.sqlite: 19 projects, 22 project_roots, 1,159 thread records, and PRAGMA quick_check returned ok. All recorded project folders existed.
    • .codex-global-state.json and its .bak both had "local-projects": {}; the legacy/server project-ID map and several membership/order fields were missing.
    • The local migration checkpoint still had projectsMigrated: true, threadAssignmentsMigrated: false.
    • All threads.project_id values were null. This alone does not establish that membership was deleted from SQLite; the earlier database assignment state is unknown.
    • The app's list_projects returned cloud projects but zero local projects.

    Recovery procedure that worked

    The following describes this build's internal storage, not a supported cross-version repair API.

    1. Inspect and back up before writing. Read the SQLite schema and catalog in read-only mode, inspect current global-state JSON, and locate any valid historical JSON. We found an older surviving temporary state file containing some assignments and root hints; other temporary files were truncated and unusable. We did not replace the current state wholesale with that old file.

    2. Build a recovery manifest. Recover each original desktop/legacy project ID through project_idempotency_keys.key -> project_id -> projects.id, and join project_roots for all roots. In this database there was exactly one idempotency key per project; validate that relationship before treating a key as a legacy ID. Keep existing identities instead of generating new projects. Recover names, roots and ordering from the current database.

    3. Recover memberships separately. Prefer saved explicit assignments, preserving intentionally projectless chats. Then reconcile recorded workspace hints and thread working directories against the current project roots. Managed worktrees and moved repositories need explicit handling; a simple parent-directory match can associate a chat with the wrong enclosing project.

    4. Merge only the required fields into the current JSON. The fields restored together in our case were:

      local-projects
      app-server-project-id-by-legacy-project-id-by-host
      project-order
      electron-saved-workspace-roots
      thread-project-assignments
      thread-project-membership-host-ids
      thread-workspace-root-hints
      projectless-thread-ids
      app-server-projects-migration-by-host
      

      For this build, local-projects maps the original legacy ID to {id, name, rootPaths, createdAt, updatedAt}. The server-ID mapping is nested under the existing local host identity (local: plus the resolved Codex home). A local membership entry is {projectKind: "local", projectId: <legacy ID>}, with membership host "local". Do not confuse the legacy project ID with the database project's ID.

      We preserved unrelated current settings and rejected conflicting newer identities/memberships. The membership migration flag remained false, with recovered thread IDs pending; we did not mark the backend migration complete.

    5. Fully quit the desktop app, then apply from a separate PowerShell window. The script refused to write while this package's ChatGPT.exe was running. Immediately before applying, it rechecked the catalog/folders and saved fresh copies of both JSON files plus a consistent SQLite snapshot. It staged and validated replacement JSON, atomically replaced each JSON file, and would restore both before-images on an installation failure. The pair is not a single atomic transaction. The recovery script wrote only .codex-global-state.json and .codex-global-state.json.bak; it did not write SQLite, project files, or conversation contents.

    6. Reopen and verify the live app. A successfully written file is not sufficient evidence of sidebar recovery. Check the app's actual project listing and representative chat memberships, as well as the on-disk cache. To roll back this cache repair, fully quit and restore the two JSON before-images; there is no need to restore SQLite as part of this procedure.

    Useful read-only diagnostics for this schema, using a connection opened with mode=ro:

    PRAGMA quick_check;
    SELECT COUNT(*) FROM projects;
    SELECT COUNT(*) FROM project_roots;
    SELECT COUNT(*) FROM threads;
    SELECT COUNT(*) FROM threads WHERE project_id IS NOT NULL;

    Results and limits

    • The owner confirmed the sidebar was repaired. Live list_projects now returns all 19 original local project IDs.
    • All 19 sampled recent/pinned Codex thread records matched the recovery manifest, including two projectless records.
    • The restored cache contains 1,143 associations and 16 projectless records. These counts include archived and child-agent records; they are not counts of visible top-level conversations. All pre-repair thread records remained present, with zero archived-flag changes.
    • Membership evidence comprised 34 saved explicit assignments, 17 saved workspace hints, 1,013 current-root matches, 17 managed-worktree folder matches, and 62 historical-folder-alias matches. Those last two groups used unique folder names within known local layouts and are inferred associations, not an exact historical assignment backup. We would leave ambiguous cases unresolved rather than apply these heuristics indiscriminately.
    • After relaunch, database threads.project_id values were still null and the membership migration remained incomplete. Visibility recovery therefore does not establish that backend migration completed. The recovery script did not edit SQLite; subsequent app activity did change two project positions and one project timestamp.
    • We changed the listed cache fields together, so this does not isolate which individual field was necessary or sufficient, or establish what originally cleared them.

    One practical failure along the way: a hidden waiting helper launched from Codex did not survive quitting the app, so the first restart applied nothing. Its exact termination cause was not logged; Windows job membership was observed and is a plausible explanation. Running the repair synchronously in a separately opened PowerShell window succeeded. Do not assume a helper started by the app will remain alive after the app exits.

    The useful recovery boundary here is intact database project records and accessible folders, but missing desktop cache/membership state. Please consider startup reconciliation for that inconsistency, preserving original IDs, multiple roots, projectless/archived records, and worktree associations. This is related to #53832's history-visibility symptoms, but does not establish that its direct-link/list-refresh problem has the same cause.

    Private project names, user paths, thread IDs, raw state files, and the machine-specific recovery manifest are omitted.

  5. axioAction commented on Oct 26, 2026

    @axioAction
    1. OpenAI makes a good LLM.
    2. Why is the software engineering of the app so fragile?

    When is this going to be fixed?

  6. zoster81 commented on Oct 29, 2026

    @zoster81

    Confirmed recovery on Windows — OpenAI.Codex 26.1023.51421 (October 29–30, 2026)

    I encountered the same issue on Windows 11 with OpenAI.Codex 26.1023.51421. After a Windows restart for updates, config.toml failed to parse; the affected file contained 3,905 NUL bytes. Renaming it allowed Codex to start, but all seven local projects were missing from the sidebar. Recent chats remained visible and still showed their project context.

    I cannot establish whether the update, the damaged TOML file, and the empty project cache had a common cause.

    Read-only findings

    • PRAGMA integrity_check on state_5.sqlite: ok (including the current WAL).
    • projects: 7 records; project_roots: 7 records; all roots existed.
    • threads: 27 records; every threads.project_id was NULL.
    • All 27 thread rollout files existed; most were compressed .jsonl.zst files. An initial search for .jsonl alone had incorrectly reported them missing.
    • .codex-global-state.json had "local-projects": {} and lacked project ordering and thread assignments.
    • The existing migration checkpoint said projectsMigrated: true, threadAssignmentsMigrated: false.
    • A deterministic match of recorded thread working directories to project roots identified 23 assignments; 4 unmatched threads were left alone.

    Recovery performed

    1. Fully closed Codex and ran a standalone Python script from a separate PowerShell session.
    2. Re-read the live SQLite catalog in read-only mode and validated the expected counts, unique legacy IDs (from project_idempotency_keys), root paths, and unambiguous thread matches.
    3. Made a timestamped backup of .codex with Robocopy (excluding junctions), verifying the critical JSON/SQLite files and WAL/SHM copies.
    4. Rebuilt only four fields in the current desktop global-state JSON, using the existing project identities:
      • local-projects
      • project-order
      • app-server-project-id-by-legacy-project-id-by-host
      • thread-project-assignments
    5. Installed the validated JSON to .codex-global-state.json and .codex-global-state.json.bak, with rollback on installation failure.

    The script did not alter SQLite, rollout files, project directories, or migration checkpoints.

    Result: after reopening Codex, all seven projects and their corresponding conversations were visible again. The application is functioning normally.

    Unlike some earlier reports, this installation recovered with just those four state fields restored together. This does not establish which one was necessary, or prove why the fields were lost.

    Reproducibility artifact

    Attached: codex_project_cache_recovery_case.zip, containing the exact Python script used successfully (renamed only) and an explanatory README. The script embeds no machine-specific paths or credentials. It is intentionally case-specific, with safety checks requiring exactly 7 projects, 7 roots, 27 threads, 23 matches, and 4 unmatched threads. It should not be run unchanged on other installations. It is provided as a diagnostic/recovery reference, not a general-purpose repair tool.

    A startup reconciliation between intact SQLite project records and an empty desktop project cache would prevent this from looking like data loss.

    codex_project_cache_recovery_case_7projects.py
    codex_project_cache_recovery_case.zip

  7. CaptainVid commented on Nov 8, 2026

    @CaptainVid

    I experienced the same issue on my Windows PC: all local Codex projects disappeared from the sidebar, even though the underlying SQLite database and project directories were still intact.

    I managed to recover my projects by reconstructing the local project catalog using the surviving database records, original project identities, and saved project information.

    After successfully recovering my own projects, I created an unofficial open-source community utility to help other users diagnose and recover from this specific issue:

    GitHub: https://github.com/CaptainVid/codex-local-project-recovery

    The utility includes:

    • Automatic diagnostics and SQLite integrity checks.
    • Local project catalog reconstruction.
    • Recovery of safely identifiable conversation-to-project assignments.
    • Automatic backups before applying changes.
    • Preview mode and rollback support.
    • Detailed instructions and documented limitations.

    Important: This is an independent community workaround, not an official OpenAI solution or a permanent fix for the underlying Codex bug.

    The recovery procedure worked on my own installation. However, the packaged release has not yet been independently validated across different Codex versions and Windows configurations.

    Please read the documentation carefully and run the preview before applying any changes.

    I hope this helps someone else recover their missing projects!

  8. angrybirddd commented on Nov 10, 2026

    @angrybirddd

    I observed the same failure on November 10, 2026, on Windows x64 with Codex desktop package 26.1103.7773.0.

    After an unexpected shutdown and relaunch, the desktop logged [global-state] Failed to load global state with a JSON parse error involving NUL bytes. Seconds later, startup reported Local app-server project migration completed projectCount=27. The desktop project list returned zero local projects, while state_5.sqlite passed PRAGMA quick_check and retained all 27 project records and their original identity mappings. At inspection time, both the current global-state file and its immediate backup parsed successfully and had an empty local-projects registry. The operation that introduced the NUL bytes is unknown.

    After backing up the state and fully exiting Codex, I rebuilt only the desktop project registry, order, and desktop-to-server ID mapping from the current database. On relaunch, the desktop returned all 27 projects with their original IDs. The database project records matched the pre-repair snapshot. Some existing chats again appeared under their projects. I could not verify every historical chat assignment.

    Could startup preserve the last known-good state and reconcile a missing desktop project registry with the surviving app-server records, retaining the original project IDs and any existing chat assignments?

  9. Hkattelu commented on Nov 12, 2026

    @Hkattelu

    I ran into the same problem on Windows with desktop package 26.1106.6628.0: all six local projects disappeared from the sidebar, and restarting twice did not bring them back. The project folders and six project records were still present, local-projects was empty, and SQLite quick_check returned ok.

    A case-specific recovery restored project visibility for me: with the app closed and state backed up, a script rebuilt the desktop project catalog, order, and legacy-to-server ID mapping from the existing records. It also reconstructed 53 chat associations from exact working-directory matches, excluding explicitly projectless chats. After reopening, my projects are visible again and the app's project listing returns all six.

    The chat matches are inferred from folder paths; I haven't verified every original association. This is a workaround, not a confirmed fix for the underlying bug. I don't know what caused the project registry to become empty or whether it will recur.

  10. pjsinghmk2-sudo commented on Nov 12, 2026

    @pjsinghmk2-sudo

    Confirmed recurrence on Windows 11 x64 (build 26300) with desktop package 26.1103.7773.0 and bundled codex-cli 0.167.0-alpha.3.2. The updater reports no available update.

    On November 12, 2026, the user restarted Windows and reopened Codex without switching accounts or signing out. Projects showed “No projects” while existing chats were still visible in Recents. This recurred after the same projects and their active chat groupings had been restored on November 6.

    The November 12 startup logs show repeated global-state JSON parse failures involving NUL bytes at 03:31:38–03:31:52 UTC. Startup then logged project migration completion with seven database project records at 03:32:05 UTC. At inspection, both the current desktop global-state file and its immediate backup parsed successfully, but each had an empty local-projects registry. The database still contained the original project records and roots, and all four affected folders existed. The app’s project list returned zero local projects.

    Could the Windows desktop app retain a validated last-known-good copy of global state across restart and reconcile an empty sidebar registry with surviving app-server project records? Please preserve stable project IDs and chat assignments during recovery. The logs establish a startup parse failure, but the operation that introduced the NUL bytes is unknown.

    Submitted on the user's behalf. This report omits account details, private paths, screenshots, and chat contents.

  11. xcdhzm commented on Nov 12, 2026

    @xcdhzm

    Additional Windows recovery case — November 12, 2026

    This appears relevant to this issue: the desktop project catalog was empty while the database still contained the original projects and roots. The exact app package version was not recorded for this report.

    Observed failure sequence

    1. Codex initially failed to start with a config.toml parsing error.
    2. Renaming the affected configuration file allowed Codex to start.
    3. All five existing local projects were then missing from the sidebar, while existing conversations remained visible in Recent.

    This is the observed chronology, not evidence that renaming config.toml caused the missing projects. The initial cause of the empty project state is unknown, and I do not have a deterministic reproducer for it.

    Findings before recovery

    • SQLite PRAGMA quick_check returned ok.
    • The database contained 5 projects, 6 project_roots, and 118 threads records.
    • Every threads.project_id value was NULL at inspection time. The earlier assignment state is unknown, so this alone does not prove that assignments were deleted.
    • In .codex-global-state.json, local-projects and the project order were empty.
    • The global-state migration checkpoint had projectsMigrated: true and threadAssignmentsMigrated: false. These flags were observed state, not proof that all project and thread migrations had completed successfully.

    Recovery that succeeded in this case

    1. Fully closed Codex and passed the recovery script's process and database checks.
    2. Ran a preview, then created and verified a pre-repair backup before applying changes.
    3. Reconstructed the global-state local-projects catalog, project-order, and original desktop/legacy-to-server project ID mapping from the surviving database project records, roots, and original ID relationships. Existing project identities were preserved.
    4. Restarted Codex and checked the sidebar.

    The recovery script did not modify SQLite or rewrite chat assignments. All five original projects reappeared, and the conversations visible in the post-recovery UI appeared under their projects again. The owner confirmed recovery.

    Verification limits

    This confirms recovery of the five-project sidebar and the visible conversation groupings. It does not establish that all 118 thread records were individually checked or that every historical project assignment is correct. The catalog, order, and ID mapping were rebuilt together, so this case does not isolate which field was necessary or sufficient, establish the original cause, or prove backend migration completion. This is a case-specific workaround.

    Please consider detecting an empty desktop project catalog when valid database projects and roots survive, and reconciling that state while preserving original IDs, multiple roots, and existing conversation assignments.

    Private project names, full local paths, personal/account identifiers, raw state files, and private conversation contents are omitted.

  12. Slothswithaids commented on Nov 12, 2026

    @Slothswithaids

    Observed the same failure on November 12, 2026 with Windows package OpenAI.Codex version 26.1103.7773.0 and app-server 0.167.0-alpha.3.2 (Windows x64, OS build 10.0.26200).

    The Projects sidebar shows “No projects.” The app's list_projects tool returns cloud ChatGPT projects but no local Codex projects. Existing local chats remain discoverable.

    Read-only checks before recovery:

    • state_5.sqlite contains 19 project records and 20 root records. Some are older records with identical root sets; there are 11 distinct root sets, and all stored folders exist.
    • PRAGMA quick_check returns ok.
    • 677 chat records remain in the database; none currently has a non-null project_id. The earlier assignment state is unknown, so this does not establish that assignments were deleted.
    • .codex-global-state.json and its current .bak both contain "local-projects": {}.
    • The startup log at 2026-11-12T09:40:16.160Z reports [host-app-server-projects] Local app-server project migration completed projectCount=19.
    • The migration checkpoint says projectsMigrated: true, threadAssignmentsMigrated: false.

    Inspection of this installed build is consistent with the original report: the renderer reads the desktop project cache, while initialization enumerates the server projects without recreating missing ordinary cache entries. The event that emptied the cache is still unknown; an update, crash, or account switch has not been established as the cause.

    A local backup has been saved and cache restoration is being prepared. Recovery has not yet been verified. No project folders or database records have been modified. Private paths, project names, account identifiers, raw state files, and conversation contents are omitted.

  13. venanciotechsolution-dev commented on Nov 14, 2026

    @venanciotechsolution-dev

    I ran into this several times on Windows. I confirmed the sidebar was empty on November 12 and 14, 2026, on desktop packages 26.1106.6628.0 and 26.1111.2228.0. The startup logs included JSON parse failures involving NUL bytes, followed by Local app-server project migration completed projectCount=19. The desktop global state and its immediate backup later had an empty local-projects catalog. Meanwhile, a read-only check of state_5.sqlite still showed 19 projects, 22 folder associations, and 806 existing thread-to-project links (803 active, 3 archived). PRAGMA quick_check returned ok.

    What restored the sidebar in this case

    1. Fully quit the desktop app and backed up .codex-global-state.json and its .bak.
    2. Read the surviving project records, roots, and explicit thread-to-project links from SQLite in read-only mode. Used project_idempotency_keys to match the server project IDs to the original desktop project IDs.
    3. Rebuilt the local project catalog, project order, ID mapping, and thread assignments in both desktop state files. The assignments came from the database links. The database and conversation history were left untouched.
    4. Reopened the app and confirmed all 19 local projects were visible again. Both state files contained the original project IDs and all 806 matching thread assignments.

    This restored visibility, but the source of the NUL bytes is still unknown. Could the desktop app recover the sidebar from the surviving app-server records when the state files cannot be read or the catalog is empty, while preserving the original project IDs and thread assignments?

  14. lucasheusser commented on Nov 15, 2026

    @lucasheusser

    Additional Windows case — November 15, 2026

    Environment: Codex desktop for Windows, installed package OpenAI.Codex 26.1111.2228.0, Windows x64 build 26300.

    After an unexpected computer shutdown, 11 established local projects were missing from Projects. Three other local entries remained. The missing projects' folders and older chats were still accessible. Fully quitting and reopening the app did not bring the projects back. Manually reopening one original folder created a visible project entry without its prior conversations. This is the observed sequence. The initial cause has not been reproduced.

    Before recovery, a read-only check found the 11 missing project records and all 12 of their project roots in state_5.sqlite. Every root still existed. The desktop's local-projects registry contained only the three remaining entries and thread-project-assignments was absent. The relevant migration checkpoint reported projectsMigrated: true and threadAssignmentsMigrated: false.

    With the app fully closed and its configuration backed up, restoring the missing desktop registry entries and original ID mappings made all 11 affected projects appear in the sidebar. We reused the one project entry that had already been added back. The recovery recorded 354 chat associations using saved assignments and verified working-directory matches, leaving one conflicting case for review. We verified recent chats under the restored projects. The paginated history API still reported some older chats without a project despite the saved assignments, so full history regrouping was not verified. The recovery did not edit SQLite or chat transcripts.

    Could startup detect and reconcile a partial desktop project registry against surviving app-server project records, preserving stable IDs, multiple roots, and historical chat associations? A supported recovery path for already affected profiles would also help.

  15. Slothswithaids commented on Nov 16, 2026

    @Slothswithaids

    My local projects disappeared again on 16 November 2026 at 17:56 GMT+8, four days after the recovery described in my November 12 comment.

    The Projects sidebar was empty again, even though my folders and chats were still there. I’ve now restored the 11 local projects and confirmed they’re visible in the app.

    This happened on Windows app package 26.1111.2228.0, with bundled CLI 0.169.0-alpha.11.1. The previous incident was on package 26.1103.7773.0. The version changed between incidents, but I don’t know what cleared the project list.

    Closing and reopening the app didn’t fix it. I also reinstalled the Codex dependencies, force-closed the app through Task Manager, and restarted it. The projects were still missing.

    Before the repair:

    • local-projects in .codex-global-state.json was empty. The project order and legacy-to-server project ID mapping were also missing.
    • state_5.sqlite still had 19 project records and 20 root records. Several were older entries for the same folders; there were 11 distinct folder sets, and every folder existed.
    • All 682 chat records were still present, and PRAGMA quick_check returned ok.
    • The app’s list_projects tool returned my cloud projects but none of my local projects.

    How I got them back

    I backed up the state file and SQLite database, fully closed the app, and rebuilt the desktop project cache from the existing projects and project_roots records. For entries pointing to identical folder sets, I used the newest saved record. I recovered the original project IDs from project_idempotency_keys, then restored these three settings:

    • local-projects
    • app-server-project-id-by-legacy-project-id-by-host
    • project-order

    An initial repair attempt stopped without making changes because the app reopened before the write could happen. I then used a helper to close the app, apply the repair while it was stopped, and reopen it. That completed at about 18:06 GMT+8.

    After reopening, the app listed all 11 local projects, and sampled existing chats were grouped under their projects again. The restored entries and ID mappings matched the recovery plan. All 682 pre-repair chat IDs were still present; the project, root, and idempotency-key records were unchanged; and the database integrity check still passed. The repair did not edit any project files.

    This recovered the sidebar, but it hasn’t fixed whatever keeps clearing it. Please investigate why the desktop cache loses these entries and why the app doesn’t rebuild them from the project records it still has. Having to repeat this recovery four days later makes it difficult to trust the project list.

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

    appbugsessionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions