Skip to content

Windows desktop loses local project catalog after unexpected power restart; retained database projects are not restored in the sidebar #53305

Closed as duplicate

Description

@drakunov

Product and environment

  • Windows desktop application installed as OpenAI.Codex, package version 26.1007.2314.0.
  • Windows 10, build 19044.
  • Separately observed local CLI: 0.162.0-alpha.17.2. CLI findings are not assumed to diagnose the desktop catalog.
  • Executable file/product version: 155.0.8059.40; this is distinct from the package version.

Actual behavior and chronology

  1. An unexpected power-related restart occurred. No intentional state reset or cache clearing preceded this investigation.

  2. After startup, previously configured local project groups were missing from the desktop sidebar. Existing chats and their working directories remained available.

  3. A normal application restart did not restore the old project groups.

  4. The user created one new local project using an existing working directory, represented here as . Older chats did not automatically rejoin it.

  5. The project-selection menu showed existing ChatGPT projects and the single newly created local Codex project.

  6. One explicitly authorized supported-API move was attempted for a completed, idle older chat on host durable into the new project on host local. Its actual host was supplied without substitution. The API rejected the move with: "The task's source project could not be safely determined."

  7. Readback confirmed that this chat still had projectId=null, its original host and cwd, and idle status. There was no successful assignment mutation from this test. No other API move was attempted.

  8. Subsequently, the user manually moved a different older local chat into the new local project through the UI. Readback confirmed membership in the new project while cwd and execution host remained unchanged.

  9. A subsequent metadata-only inspection found one thread-project-assignments entry for that manually moved chat. Before the manual move, this key was absent. The projectless-thread-ids list changed from one entry to empty. The current project catalog still contains only the one new local project.

  10. The user then normally restarted the application. Readback confirmed that the successful manual local assignment persisted with unchanged host and cwd. The JSON still contains one local project and one assignment. The old project catalog did not reappear.

Expected behavior
Persisted local project records and their sidebar representation should reconcile through a supported recovery path. A newly assigned local chat should retain its membership across a normal application restart. If old membership cannot be recovered, the application should distinguish missing assignments, legacy-ID mapping, and execution-host restrictions.

Persisted-state findings

  • Selected project metadata was read without publishing the full global-state file.
  • The current .codex-global-state.json local-projects object contains one project, the new local project.
  • The neighboring .codex-global-state.json.bak was byte-identical to current JSON at each inspection. Both observed files postdate the unexpected restart; no pre-restart backup was found in the narrowly inspected neighboring candidates.
  • The local state_5.sqlite main file contains projects and project_roots records for several older projects as well as the new project.
  • The inspected threads table contains project_id. In the earlier inspection, all 146 thread records in that main-file view had project_id=NULL.
  • SQLite/app-server project IDs and desktop/legacy project IDs occupy different namespaces. The new project has an explicit legacy-to-server mapping. Earlier mapping entries were not present in the inspected JSON.
  • Before the manual move, thread-project-assignments, thread-project-membership-host-ids, and thread-workspace-root-hints were absent in both JSON files.
  • After the manual move, thread-project-assignments has one entry in both JSON files; the other two keys remain absent. The files remain byte-identical.
  • Migration state reports projectsMigrated=true, threadAssignmentsMigrated=false, and one pendingThreadAssignmentIds entry. Inspection of the installed application code shows that writes can intentionally invalidate this checkpoint. The flag is not proof of failed migration or corruption.
  • Installed-code inspection found initializeProjects, startConnectionSync, threadAssignments.migrate, syncAssignment, storeProject, and invalidateMembershipCheckpoints. Assignment synchronization uses saved assignment metadata; it does not reconstruct membership from cwd alone.
  • No supported general command for restoring arbitrary retained SQLite project records to local-projects was identified. The specifically named restoreChatGptProjects path is associated with ChatGPT backing and is not assumed to restore ordinary local projects.

Evidence limitations

  • The database was inspected using SQLite mode=ro&immutable=1 against the main file. This avoids normal reader lock interaction but is not a guaranteed atomic snapshot of a live WAL database. No database integrity or repair claim is made.
  • The non-archived list API exposes up to 50 recent entries plus pinned chats and has no pagination parameter. Its output is not a complete historical archive.
  • Available Codex archive pages were read to the end for local and durable hosts. The ChatGPT archive endpoint was unavailable from this execution context.
  • The actual desktop filter selection and account/workspace selection were not independently verified.
  • doctor --help is supported by the installed CLI and documents --summary and redacted --json output. The doctor self-check was not run because documented flags do not establish exclusion of authentication sources or session inventory. No --all, repair, fix, or reindex was run.
  • No authentication files, tokens, session transcripts, private logs, or unrelated work files were included.
  • In a narrow window around the unexpected startup, no Disk/Ntfs/storage-controller error events were found. Informational NTFS events described the inspected system and project volumes as healthy. This is not a full hardware test; Kernel-Power 41 alone does not establish disk failure.
  • The global-state JSON parsed successfully and the database main file was readable. This does not exclude missing or incompletely persisted metadata.

Hypotheses, not established causes

  • An interrupted metadata write during the power event may have lost catalog or assignment state.
  • Catalog reconciliation or legacy-to-server migration may explain the discrepancy between retained database records and the desktop catalog.
  • The rejected API move could reflect missing source membership, execution-host rules, or another safety precondition. Its error does not establish that all transfers are unsupported.
  • The manual local-to-local success establishes only that particular operation; it does not demonstrate durable-to-local support.

Already checked
Normal app restart; metadata project/chat enumeration; existence of previously used directories; selected JSON keys and narrowly scoped backup candidates; SQLite schema and project-only records; actual package/CLI versions; installed-code migration semantics; narrowly filtered system storage events; one authorized API move with readback; one user-performed UI move with readback.
No SQL/JSON edits, migration-code execution, flag changes, cache clearing, reinstall, update, permission changes, or environment handoff were performed.

Safe optional reproduction / persistence check
Do not reproduce by cutting power.
After active work has finished and with explicit approval:

  1. Record the new local project's membership for the successfully moved local chat, along with unchanged host/cwd and counts of local-projects and thread-project-assignments.
  2. Normally close and reopen the application.
  3. Read the same metadata again and compare membership, host/cwd, catalog counts, and assignment count.
    This tests persistence of the successful manual assignment, not automatic recovery of the older catalog. The user has now performed this normal restart: the manual assignment persisted, and older project groups did not return.
    A separate disposable-project test may be used only with explicit approval; no additional project is needed for the existing persistence check.

Questions for maintainers

  1. What is the supported recovery/reconciliation procedure when projects/project_roots retain old entries but desktop local-projects lacks them?
  2. Which source of membership does the desktop move safety check require when it reports "The task's source project could not be safely determined"?
  3. How should pendingThreadAssignmentIds and the read/write migration checkpoints converge after a successful manual local assignment?
  4. Can the legacy-to-server mapping be safely reconstructed through a supported API without editing persisted files?
  5. Does the normal shutdown/startup path validate or preserve a previous valid catalog after interrupted writes?
  6. What metadata-only diagnostic export is recommended for Windows, without transcripts or authentication information?

Reporting channel
The official desktop troubleshooting documentation describes in-app feedback via / in the composer and explicitly links the Codex GitHub repository for issue reporting:
https://learn.chatgpt.com/docs/reference/troubleshooting
https://github.com/openai/codex/issues
In-app feedback may offer session sharing; this draft does not authorize sharing a session or logs. This report is prepared for public issue submission; no session or logs are included.

Privacy
Project/person names, computer names, actual user paths, account IDs, chat IDs, project IDs, work content, authentication data, and private logs are omitted. is a generic placeholder. Technical key/table/function names and versions are retained for diagnosis.

Activity

  1. added
    bug
    app
    windows-os
    session
    on Oct 12, 2026
  2. drakunov commented on Oct 12, 2026

    @drakunov
    Author

    Closing this report to consolidate the primary local-project catalog-loss symptom with #53092 (same desktop package and retained SQLite projects versus missing desktop catalog). #52713 is also closely related to the unexpected-shutdown scenario, but JSON parse/NUL errors were not established in this case, so a common root cause is not claimed.

    The additional observations remain in this report for reference: a manual local-to-local assignment persisted across a normal restart with unchanged host/cwd; the separate durable-to-local move rejection matches the error discussed in #52489 and should not be assumed to have the same cause as catalog loss. No unofficial repair scripts or database/global-state edits were applied.

  3. drakunov commented on Oct 12, 2026

    @drakunov
    Author

    In-app feedback was submitted successfully. The confirmation dialog provided the following ID for referencing the feedback in a GitHub issue:

    01a11c6b-b2f3-7582-8f62-443c919b20f2

    Sharing this identifier only to help maintainers correlate the submitted diagnostics; no conversation contents or logs are attached here. The primary catalog-loss report remains consolidated with #53092 as noted above.

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