Bug report: Local projects disappear from sidebar after Windows desktop update
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
- Have multiple local Codex projects with chats assigned to them.
- Update the Windows desktop app.
- Launch Codex.
- 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.exebackground 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.sqlitestill 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.exeprocesses 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.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #41874
Powered by Codex Action
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.
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.sqlitestill 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-projectsregistry. - Migration state remains:
projectsMigrated: truethreadAssignmentsMigrated: 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.
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/listcontrol 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 supportedthread/metadata/updateAPI and deepest-root matching, restored 47 unambiguous thread associations with 0 errors. Counts remained 11 projects / 66 threads andPRAGMA quick_checkremainedok; 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.
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-gate1463309241code 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.
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/updateapp-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_checkremainsok. - Nevertheless, the Desktop-facing project inventory still exposes only ChatGPT projects and no local projects, and
.codex-global-state.jsonstill has an emptylocal-projectsobject with nothread-project-assignmentsentry.
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.
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: truethreadAssignmentsMigrated: 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-projectssnapshot. - 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_keystable as the authoritative legacy-ID → new-project-UUID mapping. - Left the 2 stale/orphaned assignments projectless.
state_5.sqliteretained all 9 projects and roots.- 43 threads then had valid non-null
project_idvalues. - 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 = NULLthere. - 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:
- Legacy thread-project assignment migration can fail while project creation succeeds.
- 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-assignmentreferencing 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.
使用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;
需要确认:
- 每个
local-projects的 key 都能匹配project_idempotency_keys.key - 每条映射只对应一个 core project
thread-project-assignments引用的项目 ID 都存在于local-projectslocal-projects项目缺少的确实只是createdAt和updatedAt
修复方法
重要:必须先完全退出 Codex Desktop,并在任务管理器中确认没有 ChatGPT.exe 进程。
如果在 Desktop 运行期间修改文件,退出时它可能用内存中的旧状态覆盖修复结果。
-
备份:
$CODEX_HOME/.codex-global-state.json $CODEX_HOME/state_5.sqlite -
不要修改 SQLite。
-
对
local-projects下的每个项目,使用对象的 key 作为 legacy project ID。 -
通过以下关系查找时间戳:
local-projects 的项目 key → project_idempotency_keys.key → project_idempotency_keys.project_id → projects.id -
把数据库中的时间戳添加到对应项目对象:
"createdAt": 1234567890000, "updatedAt": 1234567890000值分别来自:
projects.created_at_ms projects.updated_at_ms必须写成 JSON 数字,不能写成字符串。
-
不要修改:
- 项目 ID
- 项目名称和
rootPaths thread-project-assignmentsproject-order- SQLite 中的
project_id - sessions 或 rollout 文件
- migration flags
-
验证 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
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.0logs twoFailed to load global statewarnings 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 saysprojectsMigrated: true,threadAssignmentsMigrated: false. - The current
state_5.sqlitepasses read-onlyPRAGMA quick_checkwithok. 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_idvalues. 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 desktoplist_projectstool returns only ChatGPT projects and zero local projects. No unavailable host/source is reported bylist_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.
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.
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_HOMEis 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-nullproject_idvalues. - Read-only database checks currently return
PRAGMA quick_check = okand noforeign_key_checkrows. - 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 canonicalproject_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_projectsresult. - No unavailable local host or source is reported.
- In the available September 13-15 desktop logs, I found no new
Failed to load global stateorAutomation project no longer existsentry. 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.
补充一个 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 功能,帮助用户恢复已有项目及任务关联,避免手动修改内部状态文件。
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": "
Create a fresh backup containing:
.codex-global-state.json session_index.jsonl state_5.sqlite Replace only: .codex-global-state.json session_index.jsonl
I did not modify state_5.sqlite.
My final validation was:
SQLITE CHECK : ok PROJECTS : 12 ASSIGNMENTS : 100 ACTIVE REAL COVERED : 104 / 104 SQLITE MODIFIED : NO
After reopening Codex Desktop, all local Projects appeared again with their old chats.
Why my first recovery attempt failed
The first recovery generated new UUIDs from project paths.
Those IDs were not present in:
project_idempotency_keys
For example, the generated WEB_PHOTO ID was unmapped, while the original legacy ID still had a valid mapping to the canonical SQLite project.
The working approach was therefore:
existing SQLite project → existing project_idempotency_keys.key → existing root → restore Desktop registry → restore thread assignments
rather than:
cwd → generate new project UUID → create new sidebar project
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.
Additional Windows reproduction with a successful narrow, backup-first recovery on Codex Desktop 26.911.7940.0.
Failure state
- The Projects view showed zero local projects, while Recent chats and project references in some move/selection menus were still available.
- A prior startup had logged global-state JSON parse failures caused by an unexpected NUL (
U+0000) character. The subsequently recreated global-state file parsed successfully but had an emptylocal-projectsobject and no legacy thread-assignment registry. - The active
config.tomlremained valid; this incident did not require rebuilding configuration or MCP entries. - Read-only SQLite validation returned
PRAGMA integrity_check = ok. state_5.sqlitestill contained 29 projects, 40 ordered roots, and 29 one-to-one legacy-to-core mappings inproject_idempotency_keys.- All 40 root directories still existed.
- The thread rows survived, but none had a non-null canonical
project_id.
This is distinct from the recovery case where local-projects exists but individual objects merely lack createdAt / updatedAt: here the entire Desktop registry was empty.
Narrow recovery that worked
After fully exiting Codex Desktop and making two independently hash-verified snapshots plus a same-volume rollback copy, only local-projects in .codex-global-state.json was reconstructed from the current SQLite database:
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)
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.
The recovery did not modify state_5.sqlite, sessions, rollouts, session_index.jsonl, config.toml, migration flags, thread assignments, project ordering, or sidebar ordering.
Result after restart
- The Projects UI returned.
- The Desktop project-list API changed from zero local projects to all 29 local projects, alongside the existing cloud projects.
- The live global-state registry contains 29 projects and 40 roots.
- SQLite still contains the same 29 projects and 40 roots.
- The rollback copy and both offline snapshots remain available.
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.
Requested product behavior
Please make global-state parse-failure recovery reconcile an empty Desktop project registry from the durable SQLite project inventory when project_idempotency_keys provides a complete unique mapping. Thread-assignment repair should be a separate, partial-failure-tolerant phase. A supported backup-first Repair/Rebuild Projects action would be safer than requiring users to edit an internal, undocumented state file offline.
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.
Additional Windows reproduction from OpenAI Support Case #15269457 (also previously #14590680).
Session ID requested by Support:
no-active-thread-01a0af77-0ea6-7e92-bae1-650de0ab3dd7
Current environment
- Codex Desktop package:
26.915.4065.0 - Windows 11 Pro 25H2
- Affected normal profile:
%USERPROFILE%\.codex
Durable data is intact
The live SQLite DB passes PRAGMA quick_check = ok.
Immediately before the latest isolation test I took a cold backup, then compared backup vs current DB read-only. These were exact matches:
- projects:
6vs6— exact match - project_roots:
6vs6— exact match - assigned threads:
12vs12— exact match - assigned threads:
12vs12— exact match
The original project is still present with the same ID:
01a05dcb-31fb-71b1-b040-6780c7e93374
All 12 thread-to-project associations are still preserved.
So this is not SQLite corruption or loss of the durable project/thread records.
UI symptom
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 state_5.sqlite.
The visible disposable project page showed 0 chats. Settings > Archived chats, searching for ``, returned no matching archived chats.
Fresh Desktop logs have also shown a Conversation state not found hydration symptom.
CODEX_HOME isolation test did not take effect
Support asked me to test a separate existing CODEX_HOME.
Launch method:
- Fully terminate all
ChatGPT/Codexprocesses. - Verify the isolation directory already exists.
- Set process-scoped
CODEX_HOMEto the isolation directory. - Launch
ChatGPT.exedirectly viaSystem.Diagnostics.ProcessStartInfowithUseShellExecute = falseand explicitly injectCODEX_HOMEintoEnvironmentVariables. - Do not interact with the UI until checking the fresh Desktop log.
Despite that, the fresh Desktop log still read from the normal profile, including paths under:
%USERPROFILE%\.codex\vendor_imports\skills%USERPROFILE%\.codex\.tmp\bundled-marketplaces\...%USERPROFILE%\.codex\plugins\cache\...
and the app-server migration reported the normal-profile project count (projectCount=6).
CODEX_SQLITE_HOME isolation test also did not take effect
Support then suggested isolating SQLite specifically with CODEX_SQLITE_HOME.
I confirmed that neither the normal nor isolation config.toml contains sqlite_home or CODEX_SQLITE_HOME.
Test method:
- Fully terminate Desktop processes.
- Take a cold backup.
- Pre-create a fresh SQLite isolation directory.
- Explicitly inject both
CODEX_HOMEandCODEX_SQLITE_HOMEinto the sameProcessStartInfolaunch environment. - Do not interact with the UI.
Result:
- no
state_5.sqlitewas created underCODEX_SQLITE_HOME - the isolation SQLite directory remained unused
- the normal
%USERPROFILE%\.codex\state_5.sqlitewas modified during startup - before:
3,584,000bytes, mtime10:53:22 - after:
3,657,728bytes, mtime11:00:57
A subsequent read-only comparison confirmed that the project/root/thread-assignment records themselves remained unchanged.
Support status
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.
This continues to look like a Windows Desktop local-project/sidebar hydration or post-load visibility issue, with a separate problem where CODEX_HOME / CODEX_SQLITE_HOME are not reliably honored by Desktop launch isolation.
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.
Successful Windows recovery without modifying state_5.sqlite
I was able to recover the missing local Projects on Windows while preserving the existing Project IDs and thread data.
The durable core database was healthy:
state_5.sqlite
projects: 6
project_roots: 6
project_idempotency_keys: 6
threads: 29
PRAGMA quick_check: ok
However, Desktop global state had collapsed to:
local-projects: 1
project-order: 1
thread-project-assignments: missing
The important mapping was:
project_idempotency_keys.key
= Desktop / legacy Project ID
project_idempotency_keys.project_id
= current/core projects.id
I rebuilt only the Desktop-side Project registry using the surviving SQLite records.
The recovery procedure was:
- Fully terminate all ChatGPT/Codex processes.
- Create a cold backup of the complete
.codexdirectory. - Verify SQLite integrity and exact expected counts.
- Build an offline candidate
.codex-global-state.json. - Reconstruct
local-projectsfromprojects,project_roots, andproject_idempotency_keys. - Use
project_idempotency_keys.keyas the Desktop Project ID rather thanprojects.id. - Reconstruct
project-orderusing those existing Desktop IDs. - Restore
thread-project-assignmentsonly for threads that already had an explicit non-null Project association in the core DB. - Do not infer or modify NULL Project assignments.
- Verify that only these three top-level keys differ from the live global state:
local-projects
project-order
thread-project-assignments
- Atomically replace only
.codex-global-state.jsonwhile Desktop is stopped. - Restart and validate.
Result:
local-projects: 6
project-order: 6
thread-project-assignments: 12
All original Projects returned to the sidebar and could be opened.
The repair also survived a full termination of every ChatGPT/Codex background process and a fresh restart.
state_5.sqlite was never modified, and its SHA-256 remained unchanged before and after the recovery.
One additional finding: a recovered Project initially appeared to have only 2 of 12 threads visible. Read-only inspection showed this was actually correct:
2 cataloged/visible threads:
source=vscode
thread_source=user
originator=Codex Desktop
10 non-cataloged threads:
source={"subagent":{"other":"guardian"}}
thread_source=subagent
An additional thread under the same cwd was thread_source=guardian_review.
So those internal Guardian/subagent records should not be manually inserted into local_thread_catalog.
I also avoided rebuilding or deleting codex-dev.db; it was not necessary for this recovery.
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.
A supported reconciliation command that rebuilds the Desktop registry from the surviving SQLite Project/idempotency data while preserving IDs would be very useful.
OpenAI Support asked me to add the associated Desktop feedback/session ID to this report so the Codex/Desktop team can correlate the diagnostics:
no-active-thread-01a0af77-0ea6-7e92-bae1-650de0ab3dd7
This is the same incident described in my earlier recovery comment above.
samme isuue here 01a0bebf-20f9-7c80-abf5-ee31dbd229f1
Independent confirmed reproduction and successful recovery on Windows desktop build 26.915.4065.0 (sanitized).
Observed after the update/restart:
- Projects sidebar was empty.
- The durable state database still contained both local projects and their roots.
- Source folders were intact.
- Desktop global state had
local-projects: {}with migration stateprojectsMigrated: trueandthreadAssignmentsMigrated: false. - Restarting the app did not repair the registry.
Recovery result:
- 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.
- Rebuilt
local-projects,project-order, 156 legacy thread-to-project assignments, and the legacy-to-app-server project ID mapping. - 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.
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:
- atomic/versioned global-state writes with a previous-good generation;
- startup integrity validation comparing desktop registry against durable SQLite projects;
- automatic safe rehydration or a supported Repair Projects flow;
- migration that handles stale/orphaned assignments per record instead of failing all-or-nothing;
- a clear recovery UI before users are asked to recreate projects manually.
I also installed an independent local audit/backup guard because the current built-in backup can be overwritten by the same faulty startup path.
I am seeing the same regression on Windows with a newer desktop build.
Environment:
- Windows 11
- ChatGPT/Codex Desktop version: 26.915.31945
- Release date shown in About: 2026-09-18
- Project type: Replit-hosted app backed by a private GitHub repository
- 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.
Actual behavior:
- Codex Desktop shows "No projects" in the Projects section.
- Existing Codex threads are still present under Recents.
- PR/task threads that previously belonged to the same project are now flattened into the general Recents list.
- 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.
- The Replit project and GitHub repository are intact.
Expected behavior:
- The existing project should still appear in Projects.
- Historical threads/PR-related tasks should remain grouped under that project after the desktop update.
I have not reset/reinstalled the app or recreated the project, to avoid overwriting or duplicating surviving project/thread association state.
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.