codex icon indicating copy to clipboard operation
codex copied to clipboard

Bug report: Local projects disappear from sidebar after Windows desktop update

Open rizal281065 opened this issue 2 months ago • 87 comments

Bug report: Local projects disappear from sidebar after Windows desktop update

Summary

After updating the Codex/ChatGPT Windows desktop app, the Projects section shows No projects. Existing chats remain visible under Recents, and all source folders still exist on disk.

Environment

  • OS: Windows 11
  • Installed Windows package: OpenAI.Codex_26.901.4073.0_x64
  • App-server client version observed in logs: 26.901.31953
  • Bundled Codex CLI: codex-cli 0.153.1

Steps to reproduce

  1. Have multiple local Codex projects with chats assigned to them.
  2. Update the Windows desktop app.
  3. Launch Codex.
  4. Inspect the left sidebar under Projects.

Actual result

  • Sidebar displays No projects.
  • Clicking Choose project opens Create project, requiring projects to be recreated manually.
  • Restarting the app and restarting Windows do not restore the projects.
  • Closing the visible app window does not terminate all ChatGPT.exe background processes.

Expected result

Existing local projects and their chat assignments should be migrated and remain visible after an update.

Diagnostic evidence

The underlying data was checked locally:

  • state_5.sqlite still contains 14 project records and 14 project roots.
  • All 14 source folders still exist.
  • 54 of 62 local threads have a non-null project assignment.
  • The desktop global-state file is rewritten on startup with:
    • local-projects: {}
    • thread-project-assignments: null
    • migration state projectsMigrated: true
    • migration state threadAssignmentsMigrated: false
  • Reconstructing the sidebar registry while the app is running is overwritten by the app's in-memory state when it closes.
  • A recovery helper waiting for the app to exit timed out after 30 minutes because background ChatGPT.exe processes remained active after the window was closed.

This looks like a Windows desktop migration/regression where the durable SQLite project records survive, but the sidebar registry and thread-assignment migration do not load or complete.

Data-loss impact

No source folders appear to be deleted, but project organization is effectively lost in the UI. Manually recreating the projects would also require users to remember which chats belonged to each project.

rizal281065 avatar Sep 04 '26 11:09 rizal281065

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

  • #41874

Powered by Codex Action

github-actions[bot] avatar Sep 04 '26 11:09 github-actions[bot]

I can confirm the same issue on app-server version 26.901.31953.

My local read-only diagnostics show the same incomplete migration state:

projectsMigrated: true threadAssignmentsMigrated: false

In my case:

  • 6 project definitions still exist in state_5.sqlite
  • all 6 project roots still exist
  • all 1,115 thread rows survived
  • all threads retain their original cwd
  • however, all 1,115 threads currently have project_id = NULL
  • local-projects is empty
  • thread-project-assignments is missing

A valid pre-migration snapshot still contains the original 6 projects and 89 exact thread-to-project assignments.

So this appears to be the same migration regression, but in my case the thread-assignment migration failed completely rather than partially.

Takanashi-Rikka1 avatar Sep 04 '26 22:09 Takanashi-Rikka1

Independent reproduction on Windows, with a more severe thread-assignment outcome.

Environment:

  • Codex Desktop app-server version before restart: 26.901.31953
  • Version after the restart/update: 26.901.41123
  • Windows local Codex workspace

Observed:

  • All local projects disappeared from the Projects section.
  • A full application restart did not restore them.
  • The SQLite database passes PRAGMA quick_check (ok).
  • state_5.sqlite still contains 11 project records and 29 project-root records.
  • All project folders and durable session files remain present.
  • The database contains 66 local threads, but 0 now have a non-null project_id.
  • Global state has an empty local-projects registry.
  • Migration state remains:
    • projectsMigrated: true
    • threadAssignmentsMigrated: false

The state was inspected read-only and a verified backup was made before any recovery attempt. No database or history record has been modified.

Impact: the underlying work is still present, but all local project organization and chat-to-project associations are unavailable in the UI. This is a high-severity data-integrity and recovery issue because manual re-creation risks losing the original mapping.

Please provide or implement a supported way to re-run/repair this migration from the durable SQLite project and session records.

Vitorrro avatar Sep 04 '26 23:09 Vitorrro

Additional deterministic evidence from the same Windows reproduction (sanitized):

  • After a full Desktop restart on client build 26.901.41123, the host log reports: [host-app-server-projects] Local app-server project migration completed projectCount=11.
  • A direct project/list control returns the same 11 projects and 29 roots, while the Desktop sidebar still renders no local projects. This isolates a post-load visibility/gating failure rather than missing project records.
  • Separately, all 66 threads still have project_id = NULL. A recovery rehearsal on a disposable copy, using the supported thread/metadata/update API and deepest-root matching, restored 47 unambiguous thread associations with 0 errors. Counts remained 11 projects / 66 threads and PRAGMA quick_check remained ok; all non-project thread fields, project rows, and roots were byte-for-byte/value identical.

No live user database has been modified. The UI visibility defect must be resolved (or a supported bypass provided) before this recovery can produce the expected sidebar state.

Vitorrro avatar Sep 04 '26 23:09 Vitorrro

Update after installing today's Windows package: the issue persists on OpenAI.Codex_26.901.5280.0_x64 with bundled codex-cli 0.153.4.

Fresh startup evidence:

  • Host log again reports [host-app-server-projects] Local app-server project migration completed projectCount=11.
  • Sidebar still shows no local projects.
  • The live state database remains healthy (PRAGMA quick_check = ok) with 11 projects, 29 roots, and 66 threads, but 0 thread project assignments.
  • Static inspection of the newly installed renderer bundle still contains the showLocalProjects, adminWorkLocalEnabled, workspace-disabled, admin_work_local_enabled, and feature-gate 1463309241 code paths.

So package 26.901.5280.0 does not repair the migration or the post-load sidebar visibility failure. No live database/history records were modified during this verification.

Vitorrro avatar Sep 05 '26 12:09 Vitorrro

Final recovery evidence on Windows package 26.901.5280.0:

  • After a verified backup, 47/47 unambiguous thread associations were restored through the supported thread/metadata/update app-server method while Desktop was fully closed.
  • After reopening Desktop, the live database still has 11 projects, 29 roots, 66 threads, and 47 non-null project assignments; PRAGMA quick_check remains ok.
  • Nevertheless, the Desktop-facing project inventory still exposes only ChatGPT projects and no local projects, and .codex-global-state.json still has an empty local-projects object with no thread-project-assignments entry.

This confirms two independent regressions: (1) thread-project assignments were lost during migration, and (2) even after supported assignment recovery, the renderer/sidebar continues to suppress all durable local projects. The remaining blocker is the post-load local-project visibility/gating path, not the data layer.

Vitorrro avatar Sep 05 '26 12:09 Vitorrro

Additional Windows reproduction on Codex Desktop 26.901.51231, with one potentially useful migration edge case.

I had the same user-visible symptom: Projects → No projects, while local source folders and conversations remained present.

Forensics

Pre-migration global-state snapshot:

  • 9 project definitions
  • 9 project roots
  • 45 legacy thread-project-assignments

Current state_5.sqlite after migration:

  • 9/9 projects successfully created
  • 9/9 roots successfully created
  • 9/9 legacy project IDs mapped to new app-server project UUIDs through project_idempotency_keys
  • initially 0 threads had project_id

Migration marker was:

  • projectsMigrated: true
  • threadAssignmentsMigrated: false

Potentially important edge case

Of the 45 legacy thread assignments:

  • 43 referenced project IDs that had successfully migrated.
  • The remaining 2 referenced the same legacy project ID.
  • That legacy project ID no longer had a corresponding definition in the same pre-migration local-projects snapshot.
  • It therefore had no mapping in project_idempotency_keys.

Those two stale assignments belonged to old automation threads rooted in a local repository that was no longer registered as a project.

This suggests the assignment migration may be failing all-or-nothing when it encounters a stale project reference, rather than migrating the 43 valid mappings and leaving only the 2 unresolved/projectless.

Recovery experiment

After making a complete backup of the Codex state directory:

  • Restored only the 43 unambiguous thread assignments.
  • Used the existing project_idempotency_keys table as the authoritative legacy-ID → new-project-UUID mapping.
  • Left the 2 stale/orphaned assignments projectless.
  • state_5.sqlite retained all 9 projects and roots.
  • 43 threads then had valid non-null project_id values.
  • Desktop still rendered No projects.

Additional Desktop-state evidence

The separate Desktop catalog database under the Codex state directory contained:

  • local host: 212 threads
  • local project assignments: 0
  • ChatGPT-hosted catalog: 246 threads
  • ChatGPT-hosted project assignments: 162 across 12 projects

Of the 43 repaired state-database threads:

  • 19 were also present in the Desktop local catalog.
  • All 19 still had project_id = NULL there.
  • None of the new app-server project UUIDs appeared anywhere in the local Desktop catalog.

Desktop did issue project/list requests during startup, and no project-specific app-server error was found around those requests.

Interpretation

This reproduction appears to show the same two independent failures already discussed here:

  1. Legacy thread-project assignment migration can fail while project creation succeeds.
  2. Even after durable SQLite thread assignments are repaired, Desktop continues to suppress the valid local project inventory.

The potentially new detail is the presence of 2 stale legacy thread assignments referencing a project that no longer existed in the legacy project registry.

A useful migration regression test could seed:

  • several valid legacy projects and assignments;
  • one stale thread-project-assignment referencing a deleted/nonexistent project;
  • then verify that valid assignments still migrate and only the stale mapping remains unresolved.

Disclosure: this comment was drafted and worded by ChatGPT based on my local diagnostics; I reviewed and approved the content before posting.

juerghegglin avatar Sep 06 '26 05:09 juerghegglin

使用codex,我临时解决了。如下:

临时解决方法:local-projects 数据不完整导致本地项目消失

我的测试环境:

  • Windows
  • Codex Desktop OpenAI.Codex 26.903.8094.0
  • Desktop 捆绑的 Codex CLI / app-server 0.153.4

问题表现

  • state_5.sqlite 执行 PRAGMA quick_check 返回 ok

  • project/list 可以正常返回全部本地项目

  • Desktop 日志显示:

    Local app-server project migration completed projectCount=<正确数量>
    
  • 已分配到项目的历史会话从 Recent 消失

  • 真正无项目的会话仍然显示在 Recent

  • 左侧 Projects 区域为空

我这里的根因

这个案例中,我之前使用自定义迁移脚本重建了:

$CODEX_HOME/.codex-global-state.json

其中 local-projects 下的项目对象只有:

{
  "id": "...",
  "name": "...",
  "rootPaths": ["..."]
}

但当前版本的 Desktop 还要求每个本地项目包含数字类型的时间戳:

{
  "id": "...",
  "name": "...",
  "rootPaths": ["..."],
  "createdAt": 1234567890000,
  "updatedAt": 1234567890000
}

当项目对象缺少 createdAt 或 updatedAt 时,前端 schema 校验会静默丢弃该项目,没有明显的 React/schema 报错,因此最终只表现为 Projects 为空。

这也解释了为什么项目中的会话会从 Recent 消失:会话分配关系仍然存在,但对应的项目容器已经被前端过滤。

如何确认是否属于同一种问题

首先以只读方式打开 state_5.sqlite,执行:

PRAGMA quick_check;

应返回:

ok

然后检查旧项目 ID 与 core project 的映射:

SELECT
    pik.key AS legacy_project_id,
    p.id AS core_project_id,
    p.name,
    p.created_at_ms,
    p.updated_at_ms
FROM project_idempotency_keys AS pik
JOIN projects AS p
    ON p.id = pik.project_id;

需要确认:

  1. 每个 local-projects 的 key 都能匹配 project_idempotency_keys.key
  2. 每条映射只对应一个 core project
  3. thread-project-assignments 引用的项目 ID 都存在于 local-projects
  4. local-projects 项目缺少的确实只是 createdAt 和 updatedAt

修复方法

重要:必须先完全退出 Codex Desktop,并在任务管理器中确认没有 ChatGPT.exe 进程。

如果在 Desktop 运行期间修改文件,退出时它可能用内存中的旧状态覆盖修复结果。

  1. 备份:

    $CODEX_HOME/.codex-global-state.json
    $CODEX_HOME/state_5.sqlite
    
  2. 不要修改 SQLite。

  3. 对 local-projects 下的每个项目,使用对象的 key 作为 legacy project ID。

  4. 通过以下关系查找时间戳:

    local-projects 的项目 key
        → project_idempotency_keys.key
        → project_idempotency_keys.project_id
        → projects.id
    
  5. 把数据库中的时间戳添加到对应项目对象:

    "createdAt": 1234567890000,
    "updatedAt": 1234567890000
    

    值分别来自:

    projects.created_at_ms
    projects.updated_at_ms
    

    必须写成 JSON 数字,不能写成字符串。

  6. 不要修改:

    • 项目 ID
    • 项目名称和 rootPaths
    • thread-project-assignments
    • project-order
    • SQLite 中的 project_id
    • sessions 或 rollout 文件
    • migration flags
  7. 验证 JSON 格式正确后,再启动 Codex Desktop。

在我的环境中,离线补齐这两个字段后,所有本地项目以及对应的历史会话都重新恢复显示。

注意

这是针对内部 Desktop 状态文件的应急恢复方法,不是官方公开接口。

只有同时满足以下特征时才建议尝试:

  • SQLite 项目目录完整且健康
  • project/list 能正常返回项目
  • local-projects 中仍有项目记录
  • 项目对象只缺少 createdAt / updatedAt
  • legacy project ID 可以通过 project_idempotency_keys 唯一映射

如果数据库损坏、项目已经被删除、ID 无法唯一匹配,或者故障特征不同,请不要直接套用此方法。

另外需要特别说明:这个案例是因为自定义迁移脚本生成了不完整的 local-projects 状态对象,因此并不代表 Codex Desktop 在正常使用、没有手工修改内部状态的情况下也一定会出现同样的问题。

OpenAI 官方文档说明 CODEX_HOME 是 Codex 状态目录,默认是 ~/.codex;但其中各内部状态文件的 schema 并不是公开稳定接口:

https://learn.chatgpt.com/zh-Hans/docs/config-file/environment-variables

cwr256 avatar Sep 10 '26 12:09 cwr256

Additional Windows reproduction, still present on OpenAI.Codex 26.908.4834.0 (desktop release reported in logs: 26.908.40834; bundled app-server: 0.153.4). Windows 11 build 26200.

Read-only diagnostics establish this sequence:

  • A valid September 3 local state snapshot contains 16 local project definitions, the legacy-to-server project ID map, and 263 explicit thread-to-project assignments.
  • On September 9 at 08:03:12 UTC, desktop version 26.901.6511.0 logs two Failed to load global state warnings with a JSON parse error identifying a NUL (U+0000) character. This resembles the state-load failure in #43661.
  • A September 10 snapshot and the current global state have local-projects: {}. The legacy project ID map and explicit thread-project assignment registry are absent. The migration state says projectsMigrated: true, threadAssignmentsMigrated: false.
  • The current state_5.sqlite passes read-only PRAGMA quick_check with ok. It retains 16 project records and 16 project roots. All 16 root directories exist.
  • At the diagnostic snapshot, the database contains 1,714 thread rows (including internal/subagent rows), with 0 non-null project_id values. This is not a count of user-visible conversations. A historical user task remains readable through the desktop task-reading tool, and archived-task listing works.
  • Startup logs on the current desktop release still report Local app-server project migration completed projectCount=16, while the desktop list_projects tool returns only ChatGPT projects and zero local projects. No unavailable host/source is reported by list_threads.

There is an operational impact beyond the sidebar: three scheduled-run failures across September 9 and 12 report Automation project no longer exists, affecting two existing automations. Their target project records and directories still exist. Static inspection of the installed current desktop bundle shows that the automation project resolver reads LOCAL_PROJECTS from global state and throws this error if the legacy entry is missing. This is consistent with the empty registry causing those failures; no automation was manually triggered during diagnosis.

The earliest confirmed failure in this environment predates today's update. The NUL corruption's underlying cause is unknown, and I am not attributing that write failure to a specific updater operation. The current state file parses successfully but has lost the legacy registry. Project/source-file deletion is not supported by the checks above; full integrity of every historical session and source file has not been established.

Please investigate recovery after a global-state parse failure, reconciliation with the durable SQLite project inventory and legacy ID mappings, completion of thread assignment migration, and the automation resolver's dependency on the missing legacy registry. A supported recovery path that preserves existing project identities and history would be preferable to recreating projects.

No live state/configuration/history files were edited, no projects were recreated, and no schedules were changed. This report intentionally excludes account identifiers, local paths/project names, session identifiers, raw logs, credentials, screenshots, and conversation contents.

TTTIII2025 avatar Sep 12 '26 11:09 TTTIII2025

Additional diagnostic for Windows users seeing “Projects disappeared”

I had almost identical symptoms: all of my normal local Projects and chats disappeared, while a different set of imported Projects appeared. My original state_5.sqlite, sessions, project records, and conversation history were all still intact.

In my case this was not ultimately caused by deleted history or the project migration itself.

A recently installed tool had set a persistent Windows user environment variable:

CODEX_HOME=G:\Hermes\codex

Codex Desktop inherited that variable on restart and therefore opened an entirely different Codex state directory. The alternate CODEX_HOME had its own state_5.sqlite, Projects, and thread history, which exactly matched what the Desktop UI was showing.

Useful diagnostic on Windows:

"Process = $([Environment]::GetEnvironmentVariable('CODEX_HOME','Process'))"
"User    = $([Environment]::GetEnvironmentVariable('CODEX_HOME','User'))"
"Machine = $([Environment]::GetEnvironmentVariable('CODEX_HOME','Machine'))"

Also compare:

%USERPROFILE%\.codex\state_5.sqlite

against the state DB under whatever CODEX_HOME reports.

After removing the unintended user-level CODEX_HOME, fully terminating Codex/ChatGPT background processes, and starting Codex Desktop normally, all of my original Projects immediately returned.

So for anyone seeing this symptom, I strongly recommend checking CODEX_HOME before modifying SQLite, rebuilding indexes, reinstalling, or assuming the sessions were deleted.

This does not prove that CODEX_HOME is the cause of the migration issue reported here. It is a separate cause that produces an almost identical user-visible symptom.

kmich avatar Sep 14 '26 21:09 kmich

Follow-up from the same Windows reproduction: the user-facing environment is now stable after a backup-first, ID-preserving offline recovery. This was a local recovery, not a product-provided repair flow.

Current environment:

  • Windows package: OpenAI.Codex 26.908.4834.0
  • App-server reported by the latest available startup log: 0.154.0-alpha.6.2
  • CODEX_HOME is unset at Process, User, and Machine scope. Therefore, the alternate-state-directory cause described in the latest comment does not explain this reproduction.

Recovery and validation:

  • Offline backups were created before modification.
  • 16 legacy project registry entries and 263 known historical thread-to-project assignments were restored from the last valid pre-failure snapshot and reconciled to the existing durable project IDs.
  • No projects were recreated, no project IDs were replaced, and no automation was manually triggered during recovery.
  • Current state_5.sqlite: 16 projects, 16 roots, 1,772 thread rows, and 263 non-null project_id values.
  • Read-only database checks currently return PRAGMA quick_check = ok and no foreign_key_check rows.
  • Current global state contains 16 local project registry entries. It now contains 271 thread assignment entries; all 271 thread IDs exist in SQLite, 263 have a non-null canonical project_id, and 8 still have a NULL canonical project_id.
  • The desktop-facing project tool improved from 0 to 14 local projects. The current sidebar inventory contains 15 Codex local-project items, and all 11 pinned Codex threads currently have a project ID.
  • One genuine local project remains present in global state, SQLite, the sidebar inventory, and historical assignment data, but is still omitted from the desktop list_projects result.
  • No unavailable local host or source is reported.
  • In the available September 13-15 desktop logs, I found no new Failed to load global state or Automation project no longer exists entry. Automations were not manually rerun, so this is not a complete end-to-end scheduler verification.

The remaining migration state is still incomplete:

projectsMigrated = true
threadAssignmentsMigrated = false
pendingThreadAssignmentIds = 11

The practical sidebar failure is mostly recovered, but the list_projects/sidebar count mismatch, the 8 global-assignment versus canonical-DB mismatches, and the 11 pending migration IDs remain. A supported reconciliation/retry mechanism is still needed so users do not have to repair internal state files offline.

No account identifiers, project names, local paths, thread or project IDs, conversation contents, credentials, screenshots, or raw logs are included in this update.

TTTIII2025 avatar Sep 15 '26 01:09 TTTIII2025

补充一个 Windows 恢复案例:更新到 Codex Desktop 26.909.22227 后,侧栏显示 No projects,原有任务仍在 Recent,本地项目文件夹也仍然存在。完全退出并重启未能恢复。 通过 Codex 辅助生成恢复清单,再进行先备份、后写入的离线恢复,目前侧栏项目已恢复显示。这是本地临时恢复方案,并非产品提供的官方修复流程。 恢复与验证:

  • 恢复前,只读检查 state_5.sqlite,PRAGMA integrity_check 返回 ok,foreign_key_check 无异常。检查时数据库包含 22 条项目记录、469 条任务记录。
  • 根据现有数据库记录及历史 global-state 备份中的明确关联,生成了 20 个本地项目、43 条任务归属的恢复清单,并先进行 dry-run 和冲突检查。
  • 独立脚本等待 Codex Desktop 及相关后台进程全部退出后,创建并校验离线备份。
  • 复用数据库中已有的项目 ID,重建 Desktop 项目目录、任务关联、排序和项目 ID 映射。项目对象包含数字类型的 createdAt 和 updatedAt。
  • 将修复结果写回 .codex-global-state.json 及其 .bak 副本。最终离线脚本没有直接修改 SQLite;此前排查曾通过应用接口恢复部分任务关联。
  • 重启 Codex 后,多次检查确认恢复的项目登记和任务关联仍然保留,并人工确认侧栏项目已恢复显示。 这次结果确认了本机侧栏恢复,但尚不能确定最初故障的根因,也不代表所有迁移步骤都已完成。希望官方提供 Repair/Rebuild Projects 功能,帮助用户恢复已有项目及任务关联,避免手动修改内部状态文件。

JiangLing-js avatar Sep 16 '26 07:09 JiangLing-js

Successfully restored missing local Projects on Codex Desktop for Windows

I recovered my missing local Projects with the help of ChatGPT in a chat, using a backup-first and read-only diagnosis before changing anything.

Just ask CHATGPT in WEB to read this and help you to repair step by step:

When this recovery applies

My broken state looked like this:

state_5.sqlite: projects: 12 project_roots: 12 project_idempotency_keys: 12 quick_check: ok

.codex-global-state.json: local-projects: 1 thread-project-assignments: 2

migration: projectsMigrated: true threadAssignmentsMigrated: false

So the canonical projects still existed in SQLite, but the Desktop project registry and thread assignments were mostly gone.

Recovery procedure Verify SQLite first: PRAGMA quick_check;

SELECT * FROM projects; SELECT * FROM project_roots; SELECT * FROM project_idempotency_keys;

Do not continue if the DB is damaged or the canonical projects are missing.

Reconstruct each Desktop project using the existing legacy project ID from: project_idempotency_keys.key

Do not generate a new UUID.

The relationship is:

project_idempotency_keys.key ↓ project_idempotency_keys.project_id ↓ projects.id Rebuild these keys in a separate candidate .codex-global-state.json: local-projects project-writable-roots thread-project-assignments sidebar-project-thread-orders thread-workspace-root-hints project-order

For local-projects and thread assignments, use the existing:

project_idempotency_keys.key

as the local/Desktop project ID.

Match threads to projects using the canonical paths from project_roots.

Normalize Windows paths such as:

\?\C:\CODEX_NEW%Project_name%

and resolve Codex Git worktrees back to their canonical repository root when necessary.

Preserve projectless-thread-ids, and do not force unmatched threads into a project.

Set project sidebar mode: "flat-project-sidebar-preferences-v1": { "chatSortMode": "priority", "initialized": true, "mode": "project", "projectSortMode": "priority" } Check session_index.jsonl.

In my case 13 active threads were missing from it. I preserved the existing file and appended only missing active threads:

{ "id": "", "thread_name": "", "updated_at": "<UTC timestamp>" } Fully close Codex Desktop and background ChatGPT.exe / Codex.exe processes.</p> <p>Create a fresh backup containing:</p> <p>.codex-global-state.json session_index.jsonl state_5.sqlite Replace only: .codex-global-state.json session_index.jsonl</p> <p>I did not modify state_5.sqlite.</p> <p>My final validation was:</p> <p>SQLITE CHECK : ok PROJECTS : 12 ASSIGNMENTS : 100 ACTIVE REAL COVERED : 104 / 104 SQLITE MODIFIED : NO</p> <p>After reopening Codex Desktop, all local Projects appeared again with their old chats.</p> <p>Why my first recovery attempt failed</p> <p>The first recovery generated new UUIDs from project paths.</p> <p>Those IDs were not present in:</p> <p>project_idempotency_keys</p> <p>For example, the generated WEB_PHOTO ID was unmapped, while the original legacy ID still had a valid mapping to the canonical SQLite project.</p> <p>The working approach was therefore:</p> <p>existing SQLite project → existing project_idempotency_keys.key → existing root → restore Desktop registry → restore thread assignments</p> <p>rather than:</p> <p>cwd → generate new project UUID → create new sidebar project</p> <p>This is not an official OpenAI recovery procedure. It worked for my specific failure state, so verify your SQLite/project mappings and make a full backup before changing anything.</p> </p> <div class="body-meta"> <div class="owner-info float-right"> <img class="owner-avatar" src="https://avatars.githubusercontent.com/u/64978869?v=4" alt="maksud1899 avatar" width="48" height="48" title="Published by a pub.dev verified publisher"/> <span class="w3-opacity w3-small"> Sep 17 '26 15:09 </span> <a class="owner-name" href="http://gitmemories.com/maksud1899"> maksud1899 </a> </div> </div> <div class="clear-both"></div> </div> <div class="issue-body"> <p> <p>Additional Windows reproduction with a successful narrow, backup-first recovery on Codex Desktop <code>26.911.7940.0</code>.</p> <h3>Failure state</h3> <ul> <li>The Projects view showed zero local projects, while Recent chats and project references in some move/selection menus were still available.</li> <li>A prior startup had logged global-state JSON parse failures caused by an unexpected NUL (<code>U+0000</code>) character. The subsequently recreated global-state file parsed successfully but had an empty <code>local-projects</code> object and no legacy thread-assignment registry.</li> <li>The active <code>config.toml</code> remained valid; this incident did not require rebuilding configuration or MCP entries.</li> <li>Read-only SQLite validation returned <code>PRAGMA integrity_check = ok</code>.</li> <li><code>state_5.sqlite</code> still contained 29 projects, 40 ordered roots, and 29 one-to-one legacy-to-core mappings in <code>project_idempotency_keys</code>.</li> <li>All 40 root directories still existed.</li> <li>The thread rows survived, but none had a non-null canonical <code>project_id</code>.</li> </ul> <p>This is distinct from the recovery case where <code>local-projects</code> exists but individual objects merely lack <code>createdAt</code> / <code>updatedAt</code>: here the entire Desktop registry was empty.</p> <h3>Narrow recovery that worked</h3> <p>After fully exiting Codex Desktop and making two independently hash-verified snapshots plus a same-volume rollback copy, only <code>local-projects</code> in <code>.codex-global-state.json</code> was reconstructed from the current SQLite database:</p> <pre><code class="language-text">Desktop project key / object.id = project_idempotency_keys.key name = projects.name rootPaths = project_roots.path ordered by position createdAt = projects.created_at_ms (JSON number) updatedAt = projects.updated_at_ms (JSON number) </code></pre> <p>Safety checks required a unique mapping for every project, the expected project/root counts, existing root directories, valid JSON before and after, and equality of every unrelated global-state field. The candidate was then promoted atomically while Desktop was closed.</p> <p>The recovery did <strong>not</strong> modify <code>state_5.sqlite</code>, sessions, rollouts, <code>session_index.jsonl</code>, <code>config.toml</code>, migration flags, thread assignments, project ordering, or sidebar ordering.</p> <h3>Result after restart</h3> <ul> <li>The Projects UI returned.</li> <li>The Desktop project-list API changed from zero local projects to all 29 local projects, alongside the existing cloud projects.</li> <li>The live global-state registry contains 29 projects and 40 roots.</li> <li>SQLite still contains the same 29 projects and 40 roots.</li> <li>The rollback copy and both offline snapshots remain available.</li> </ul> <p>This restores project containers only. Historical thread-to-project assignments remain incomplete because the current database no longer contains authoritative assignments, so no CWD/path heuristic was applied. A historical snapshot could restore only previously known mappings and would not prove assignments created after that snapshot.</p> <h3>Requested product behavior</h3> <p>Please make global-state parse-failure recovery reconcile an empty Desktop project registry from the durable SQLite project inventory when <code>project_idempotency_keys</code> provides a complete unique mapping. Thread-assignment repair should be a separate, partial-failure-tolerant phase. A supported backup-first <strong>Repair/Rebuild Projects</strong> action would be safer than requiring users to edit an internal, undocumented state file offline.</p> <p>No account identifiers, project names, local paths, project/thread IDs, prompts, credentials, screenshots, raw logs, or database files are included. This comment was drafted by Codex from local diagnostics and reviewed for privacy before posting.</p> </p> <div class="body-meta"> <div class="owner-info float-right"> <img class="owner-avatar" src="https://avatars.githubusercontent.com/u/1101084?v=4" alt="gNikro avatar" width="48" height="48" title="Published by a pub.dev verified publisher"/> <span class="w3-opacity w3-small"> Sep 17 '26 21:09 </span> <a class="owner-name" href="http://gitmemories.com/gNikro"> gNikro </a> </div> </div> <div class="clear-both"></div> </div> <div class="issue-body"> <p> <p>Additional Windows reproduction from OpenAI Support Case #15269457 (also previously #14590680).</p> <p>Session ID requested by Support: <code>no-active-thread-01a0af77-0ea6-7e92-bae1-650de0ab3dd7</code></p> <h3>Current environment</h3> <ul> <li>Codex Desktop package: <code>26.915.4065.0</code></li> <li>Windows 11 Pro 25H2</li> <li>Affected normal profile: <code>%USERPROFILE%\.codex</code></li> </ul> <h3>Durable data is intact</h3> <p>The live SQLite DB passes <code>PRAGMA quick_check = ok</code>.</p> <p>Immediately before the latest isolation test I took a cold backup, then compared backup vs current DB read-only. These were exact matches:</p> <ul> <li>projects: <code>6</code> vs <code>6</code> — exact match</li> <li>project_roots: <code>6</code> vs <code>6</code> — exact match</li> <li>assigned threads: <code>12</code> vs <code>12</code> — exact match</li> <li>assigned threads: <code>12</code> vs <code>12</code> — exact match</li> </ul> <p>The original project is still present with the same ID: <code>01a05dcb-31fb-71b1-b040-6780c7e93374</code></p> <p>All 12 thread-to-project associations are still preserved.</p> <p>So this is not SQLite corruption or loss of the durable project/thread records.</p> <h3>UI symptom</h3> <p>The Desktop sidebar does not hydrate/render the original local projects. At one point the sidebar showed only a disposable isolation-test project, while the original projects remained present in <code>state_5.sqlite</code>.</p> <p>The visible disposable project page showed 0 chats. Settings > Archived chats, searching for ``, returned no matching archived chats.</p> <p>Fresh Desktop logs have also shown a <code>Conversation state not found</code> hydration symptom.</p> <h3><code>CODEX_HOME</code> isolation test did not take effect</h3> <p>Support asked me to test a separate existing <code>CODEX_HOME</code>.</p> <p>Launch method:</p> <ol> <li>Fully terminate all <code>ChatGPT</code> / <code>Codex</code> processes.</li> <li>Verify the isolation directory already exists.</li> <li>Set process-scoped <code>CODEX_HOME</code> to the isolation directory.</li> <li>Launch <code>ChatGPT.exe</code> directly via <code>System.Diagnostics.ProcessStartInfo</code> with <code>UseShellExecute = false</code> and explicitly inject <code>CODEX_HOME</code> into <code>EnvironmentVariables</code>.</li> <li>Do not interact with the UI until checking the fresh Desktop log.</li> </ol> <p>Despite that, the fresh Desktop log still read from the normal profile, including paths under:</p> <ul> <li><code>%USERPROFILE%\.codex\vendor_imports\skills</code></li> <li><code>%USERPROFILE%\.codex\.tmp\bundled-marketplaces\...</code></li> <li><code>%USERPROFILE%\.codex\plugins\cache\...</code></li> </ul> <p>and the app-server migration reported the normal-profile project count (<code>projectCount=6</code>).</p> <h3><code>CODEX_SQLITE_HOME</code> isolation test also did not take effect</h3> <p>Support then suggested isolating SQLite specifically with <code>CODEX_SQLITE_HOME</code>.</p> <p>I confirmed that neither the normal nor isolation <code>config.toml</code> contains <code>sqlite_home</code> or <code>CODEX_SQLITE_HOME</code>.</p> <p>Test method:</p> <ol> <li>Fully terminate Desktop processes.</li> <li>Take a cold backup.</li> <li>Pre-create a fresh SQLite isolation directory.</li> <li>Explicitly inject both <code>CODEX_HOME</code> and <code>CODEX_SQLITE_HOME</code> into the same <code>ProcessStartInfo</code> launch environment.</li> <li>Do not interact with the UI.</li> </ol> <p>Result:</p> <ul> <li>no <code>state_5.sqlite</code> was created under <code>CODEX_SQLITE_HOME</code></li> <li>the isolation SQLite directory remained unused</li> <li>the normal <code>%USERPROFILE%\.codex\state_5.sqlite</code> was modified during startup</li> <li>before: <code>3,584,000</code> bytes, mtime <code>10:53:22</code></li> <li>after: <code>3,657,728</code> bytes, mtime <code>11:00:57</code></li> </ul> <p>A subsequent read-only comparison confirmed that the project/root/thread-assignment records themselves remained unchanged.</p> <h3>Support status</h3> <p>Support confirmed there is currently no documented profile reconcile/rebuild procedure that guarantees preserving existing Project IDs and thread-to-project associations. The documented Remove + re-add flow also does not guarantee ID/association preservation, so I have not used it on the affected original projects.</p> <p>This continues to look like a Windows Desktop local-project/sidebar hydration or post-load visibility issue, with a separate problem where <code>CODEX_HOME</code> / <code>CODEX_SQLITE_HOME</code> are not reliably honored by Desktop launch isolation.</p> <p>Please let me know if there is a supported reconciliation/migration retry path that preserves the existing project IDs and thread associations, or if any additional diagnostics from this profile would help.</p> </p> <div class="body-meta"> <div class="owner-info float-right"> <img class="owner-avatar" src="https://avatars.githubusercontent.com/u/254722186?v=4" alt="yujiaoki1026-hub avatar" width="48" height="48" title="Published by a pub.dev verified publisher"/> <span class="w3-opacity w3-small"> Sep 19 '26 02:09 </span> <a class="owner-name" href="http://gitmemories.com/yujiaoki1026-hub"> yujiaoki1026-hub </a> </div> </div> <div class="clear-both"></div> </div> <div class="issue-body"> <p> <h3>Successful Windows recovery without modifying <code>state_5.sqlite</code></h3> <p>I was able to recover the missing local Projects on Windows while preserving the existing Project IDs and thread data.</p> <p>The durable core database was healthy:</p> <pre><code class="language-text">state_5.sqlite projects: 6 project_roots: 6 project_idempotency_keys: 6 threads: 29 PRAGMA quick_check: ok </code></pre> <p>However, Desktop global state had collapsed to:</p> <pre><code class="language-text">local-projects: 1 project-order: 1 thread-project-assignments: missing </code></pre> <p>The important mapping was:</p> <pre><code class="language-text">project_idempotency_keys.key = Desktop / legacy Project ID project_idempotency_keys.project_id = current/core projects.id </code></pre> <p>I rebuilt only the Desktop-side Project registry using the surviving SQLite records.</p> <p>The recovery procedure was:</p> <ol> <li>Fully terminate all ChatGPT/Codex processes.</li> <li>Create a cold backup of the complete <code>.codex</code> directory.</li> <li>Verify SQLite integrity and exact expected counts.</li> <li>Build an offline candidate <code>.codex-global-state.json</code>.</li> <li>Reconstruct <code>local-projects</code> from <code>projects</code>, <code>project_roots</code>, and <code>project_idempotency_keys</code>.</li> <li>Use <code>project_idempotency_keys.key</code> as the Desktop Project ID rather than <code>projects.id</code>.</li> <li>Reconstruct <code>project-order</code> using those existing Desktop IDs.</li> <li>Restore <code>thread-project-assignments</code> only for threads that already had an explicit non-null Project association in the core DB.</li> <li>Do not infer or modify NULL Project assignments.</li> <li>Verify that only these three top-level keys differ from the live global state:</li> </ol> <pre><code class="language-text">local-projects project-order thread-project-assignments </code></pre> <ol start="11"> <li>Atomically replace only <code>.codex-global-state.json</code> while Desktop is stopped.</li> <li>Restart and validate.</li> </ol> <p>Result:</p> <pre><code class="language-text">local-projects: 6 project-order: 6 thread-project-assignments: 12 </code></pre> <p>All original Projects returned to the sidebar and could be opened.</p> <p>The repair also survived a full termination of every ChatGPT/Codex background process and a fresh restart.</p> <p><code>state_5.sqlite</code> was never modified, and its SHA-256 remained unchanged before and after the recovery.</p> <p>One additional finding: a recovered Project initially appeared to have only 2 of 12 threads visible. Read-only inspection showed this was actually correct:</p> <pre><code class="language-text">2 cataloged/visible threads: source=vscode thread_source=user originator=Codex Desktop 10 non-cataloged threads: source={"subagent":{"other":"guardian"}} thread_source=subagent </code></pre> <p>An additional thread under the same cwd was <code>thread_source=guardian_review</code>.</p> <p>So those internal Guardian/subagent records should <strong>not</strong> be manually inserted into <code>local_thread_catalog</code>.</p> <p>I also avoided rebuilding or deleting <code>codex-dev.db</code>; it was not necessary for this recovery.</p> <p>This appears to confirm a failure mode where the core Project/thread store survives an update but the Desktop Project registry is lost or not migrated correctly.</p> <p>A supported reconciliation command that rebuilds the Desktop registry from the surviving SQLite Project/idempotency data while preserving IDs would be very useful.</p> </p> <div class="body-meta"> <div class="owner-info float-right"> <img class="owner-avatar" src="https://avatars.githubusercontent.com/u/254722186?v=4" alt="yujiaoki1026-hub avatar" width="48" height="48" title="Published by a pub.dev verified publisher"/> <span class="w3-opacity w3-small"> Sep 19 '26 23:09 </span> <a class="owner-name" href="http://gitmemories.com/yujiaoki1026-hub"> yujiaoki1026-hub </a> </div> </div> <div class="clear-both"></div> </div> <div class="issue-body"> <p> <p>OpenAI Support asked me to add the associated Desktop feedback/session ID to this report so the Codex/Desktop team can correlate the diagnostics:</p> <p><code>no-active-thread-01a0af77-0ea6-7e92-bae1-650de0ab3dd7</code></p> <p>This is the same incident described in my earlier recovery comment above.</p> </p> <div class="body-meta"> <div class="owner-info float-right"> <img class="owner-avatar" src="https://avatars.githubusercontent.com/u/254722186?v=4" alt="yujiaoki1026-hub avatar" width="48" height="48" title="Published by a pub.dev verified publisher"/> <span class="w3-opacity w3-small"> Sep 19 '26 23:09 </span> <a class="owner-name" href="http://gitmemories.com/yujiaoki1026-hub"> yujiaoki1026-hub </a> </div> </div> <div class="clear-both"></div> </div> <div class="issue-body"> <p> <p>samme isuue here 01a0bebf-20f9-7c80-abf5-ee31dbd229f1</p> </p> <div class="body-meta"> <div class="owner-info float-right"> <img class="owner-avatar" src="https://avatars.githubusercontent.com/u/40865347?u=48cbabe8058517f093770498c7833dc0c6ffe737&v=4" alt="diegaless avatar" width="48" height="48" title="Published by a pub.dev verified publisher"/> <span class="w3-opacity w3-small"> Sep 20 '26 12:09 </span> <a class="owner-name" href="http://gitmemories.com/diegaless"> diegaless </a> </div> </div> <div class="clear-both"></div> </div> <div class="issue-body"> <p> <p>Independent confirmed reproduction and successful recovery on Windows desktop build 26.915.4065.0 (sanitized).</p> <p>Observed after the update/restart:</p> <ul> <li>Projects sidebar was empty.</li> <li>The durable state database still contained both local projects and their roots.</li> <li>Source folders were intact.</li> <li>Desktop global state had <code>local-projects: {}</code> with migration state <code>projectsMigrated: true</code> and <code>threadAssignmentsMigrated: false</code>.</li> <li>Restarting the app did not repair the registry.</li> </ul> <p>Recovery result:</p> <ul> <li>After making verified backups and fully stopping all ChatGPT/Codex background processes, I reconstructed the desktop project registry from the surviving SQLite project records and legacy mappings.</li> <li>Rebuilt <code>local-projects</code>, <code>project-order</code>, 156 legacy thread-to-project assignments, and the legacy-to-app-server project ID mapping.</li> <li>Relaunched the desktop app. Both local projects and their task grouping became visible again, and the desktop project API returned both expected project IDs and roots.</li> </ul> <p>This is a high-severity data-integrity/recoverability defect even when source folders survive. Please add safeguards so an update cannot persist an empty registry when durable project rows still exist:</p> <ol> <li>atomic/versioned global-state writes with a previous-good generation;</li> <li>startup integrity validation comparing desktop registry against durable SQLite projects;</li> <li>automatic safe rehydration or a supported Repair Projects flow;</li> <li>migration that handles stale/orphaned assignments per record instead of failing all-or-nothing;</li> <li>a clear recovery UI before users are asked to recreate projects manually.</li> </ol> <p>I also installed an independent local audit/backup guard because the current built-in backup can be overwritten by the same faulty startup path.</p> </p> <div class="body-meta"> <div class="owner-info float-right"> <img class="owner-avatar" src="https://avatars.githubusercontent.com/u/211805691?v=4" alt="hamboly avatar" width="48" height="48" title="Published by a pub.dev verified publisher"/> <span class="w3-opacity w3-small"> Sep 21 '26 14:09 </span> <a class="owner-name" href="http://gitmemories.com/hamboly"> hamboly </a> </div> </div> <div class="clear-both"></div> </div> <div class="issue-body"> <p> <p>I am seeing the same regression on Windows with a newer desktop build.</p> <p>Environment:</p> <ul> <li>Windows 11</li> <li>ChatGPT/Codex Desktop version: 26.915.31945</li> <li>Release date shown in About: 2026-09-18</li> <li>Project type: Replit-hosted app backed by a private GitHub repository</li> <li>Replit/Git state is healthy: origin points to the expected GitHub repo, branch is main tracking origin/main, and HEAD matches the current remote state.</li> </ul> <p>Actual behavior:</p> <ul> <li>Codex Desktop shows "No projects" in the Projects section.</li> <li>Existing Codex threads are still present under Recents.</li> <li>PR/task threads that previously belonged to the same project are now flattened into the general Recents list.</li> <li>The project grouping is still visible/usable from mobile, so this appears to be a Windows Desktop project/thread-association issue rather than data loss.</li> <li>The Replit project and GitHub repository are intact.</li> </ul> <p>Expected behavior:</p> <ul> <li>The existing project should still appear in Projects.</li> <li>Historical threads/PR-related tasks should remain grouped under that project after the desktop update.</li> </ul> <p>I have not reset/reinstalled the app or recreated the project, to avoid overwriting or duplicating surviving project/thread association state.</p> <p>This looks closely related to the migration/state issue already described here, but it also affects a project whose working code lives in Replit and is synchronized through GitHub, not only a purely local source folder.</p> </p> <div class="body-meta"> <div class="owner-info float-right"> <img class="owner-avatar" src="https://avatars.githubusercontent.com/u/284744706?v=4" alt="victoryakimenko-hub avatar" width="48" height="48" title="Published by a pub.dev verified publisher"/> <span class="w3-opacity w3-small"> Sep 21 '26 17:09 </span> <a class="owner-name" href="http://gitmemories.com/victoryakimenko-hub"> victoryakimenko-hub </a> </div> </div> <div class="clear-both"></div> </div> <nav> <ul class="pagination"> <li class="page-item disabled" aria-disabled="true"> <span class="page-link">« Previous</span> </li> <li class="page-item"> <a class="page-link" href="http://gitmemories.com/openai/codex/issues/42739?page=2" rel="next">Next »</a> </li> </ul> </nav> </section> </div> </div> </div> <aside class="detail-info-box"> <h3 class="title pkg-infobox-metadata">Labels</h3> <div class="pub-labels"> <div class="pub-label-item" style="background-color: d73a4a"> bug </div> <div class="pub-label-item" style="background-color: 78dc9b"> windows-os </div> <div class="pub-label-item" style="background-color: 401e87"> app </div> <div class="pub-label-item" style="background-color: afabe5"> session </div> </div> <script type="text/javascript"> atOptions = { 'key' : '6ca19c2b16e3f20a28885886ef99a68e', 'format' : 'iframe', 'height' : 250, 'width' : 300, 'params' : {} }; </script> <script type="text/javascript" src="https://www.highperformanceformat.com/6ca19c2b16e3f20a28885886ef99a68e/invoke.js" ></script> <h3 class="title">Owner</h3> <div class="owner-info flex-items-center d-flex"> <img class="owner-avatar" src="https://avatars.githubusercontent.com/u/139689680?v=4" alt="rizal281065 avatar" width="48" height="48" title="Published by a pub.dev verified publisher"/> <a class="owner-name" href="http://gitmemories.com/rizal281065"> rizal281065 </a> </div> <hr class="color1"> <h3>Other Repo Issues</h3> <div class="packages"> </div> <div style="clear: both"></div> </aside> </div> </div> </main> <footer class="site-footer"> <span>© 2022 Git Memory </span> <a class="link sep" href="http://gitmemories.com/privacy-policy">Policy</a> <a class="link sep" href="http://gitmemories.com/terms">Terms </a> <a class="link sep" href="http://gitmemories.com/contact">Contact </a> <a class="link sep" href="https://exchangetuts.com">Exchangetuts </a> <a class="link sep" href="https://onltools.com/">Onltools </a> <a class="link sep" href="https://serveraide.com/">Serveraide </a> </footer> <script src="http://gitmemories.com/js/app.js?id=a1337f444c840fae34ad"></script> </body> </html>