Codex Desktop 26.519.22136: local project conversation history missing after update, threads still exist in state_5.sqlite
Summary
After updating Codex Desktop on macOS on May 22, 2026, multiple local project conversation histories disappeared from the Codex Desktop UI. The underlying local data still exists in ~/.codex, including state_5.sqlite, session_index.jsonl, and the original rollout JSONL files under sessions/ and archived_sessions/. The issue appears to be a UI/sidebar/project-history indexing or migration bug rather than data deletion.
Environment
- Product: Codex Desktop App
- Platform: macOS
- Codex Desktop version observed in process metadata:
26.519.22136 - Time of update/problem: May 22, 2026, Asia/Shanghai timezone
- Local Codex directory:
~/.codex
User-Visible Impact
The following projects no longer show their expected conversation history in Codex Desktop:
/Users/<user>/Documents/code/project_244/Users/<user>/Documents/code/project_466- Potentially also affected:
/Users/<user>/Documents/code/project_A/Users/<user>/Documents/code/project_B/Users/<user>/Documents/code/project_C
The conversations are important because they contain project-specific debugging, automation, data-processing, and research workflow context.
Evidence That Data Still Exists
Local database and rollout files still contain the missing threads.
state_5.sqlite
Query:
select id, cwd, title, archived, rollout_path
from threads
where cwd in (
'/Users/<user>/Documents/code/project_244',
'/Users/<user>/Documents/code/project_466'
)
order by updated_at desc;
Observed results include:
<thread_id_466_1>- cwd:
/Users/<user>/Documents/code/project_466 - archived:
0 - rollout:
~/.codex/sessions/2026/03/19/rollout-2026-03-19T17-13-52-<thread_id_466_1>.jsonl
<thread_id_244_1>- cwd:
/Users/<user>/Documents/code/project_244 - archived:
0 - rollout:
~/.codex/sessions/2026/04/01/rollout-2026-04-01T09-04-49-<thread_id_244_1>.jsonl
<thread_id_244_2>- cwd:
/Users/<user>/Documents/code/project_244 - archived:
0 - rollout:
~/.codex/sessions/2026/03/27/rollout-2026-03-27T09-52-15-<thread_id_244_2>.jsonl
<thread_id_244_archived_1>- cwd:
/Users/<user>/Documents/code/project_244 - archived:
1 - rollout:
~/.codex/archived_sessions/rollout-2026-04-01T09-03-55-<thread_id_244_archived_1>.jsonl
Counts
state_5.sqlitecontains 153 threads.- The rollout JSONL files under
sessions/andarchived_sessions/also total 153 files. session_index.jsonlhad only 100 entries after update, which suggested an incomplete or stale index. Rebuilding it to 154 lines did not restore UI visibility.
Suspicious Migration/UI State Details
~/.codex/.codex-global-state.json contains:
electron-saved-workspace-rootsincluding:/Users/<user>/Documents/code/project_244/Users/<user>/Documents/code/project_466/Users/<user>/Documents/code/project_A/Users/<user>/Documents/code/project_B
But project-order was truncated and only contained paths up to:
"/Users/<user>/Documents/code/project_244"
The following saved roots were missing from project-order after the update:
/Users/<user>/Documents/code/project_A/Users/<user>/Documents/code/project_C/Users/<user>/Documents/code/project_B/Users/<user>/Documents/code/project_466
Manually adding them back did not restore visibility. Codex Desktop also appeared to rewrite .codex-global-state.json from an in-memory or separate persisted state on restart.
Attempted Workarounds
The following local recovery attempts were made after a full backup of ~/.codex:
- Backed up the full
~/.codexdirectory. - Added missing saved workspace roots back into
project-order. - Rebuilt
session_index.jsonlfromstate_5.sqlite. - Added all non-archived threads to
projectless-thread-ids. - Temporarily locked
.codex-global-state.jsonwith macOSuchgto prevent overwrite during restart, then removed the lock. - Investigated
thread_source:
- Newer visible-looking threads often had
thread_source='user'. - Older missing project threads had
thread_sourceset to NULL. - Updated 51 non-archived, non-automation old local threads from NULL to
user.
None of these restored the missing conversations in the Codex Desktop UI.
Relevant Related Public Issues
These GitHub issues appear related:
- https://github.com/openai/codex/issues/21076
- Similar symptoms: macOS Desktop UI missing/stale history while local DB still contains threads.
- https://github.com/openai/codex/issues/19873
- Similar symptoms: sidebar/project list lost after update while local state files still exist.
- https://github.com/openai/codex/issues/17304
- Mentions possible state DB migration/sidebar history issues and app-server thread APIs.
- https://github.com/openai/codex/issues/17540
- Similar symptoms: older local threads disappear from UI while still present on disk.
Expected Behavior
Codex Desktop should display all non-archived local threads whose cwd points to saved workspace roots. For the affected projects, it should show at least:
- 2 non-archived threads under
/Users/<user>/Documents/code/project_244 - 1 non-archived thread under
/Users/<user>/Documents/code/project_466
Archived threads should remain visible through the archived/history view.
Actual Behavior
The affected project conversation histories are not visible in the Codex Desktop UI after the update, even though local SQLite rows and rollout JSONL files exist and remain readable.
Requested Help
Please advise how to repair or rebuild the Codex Desktop conversation sidebar/project-history index for existing local threads. If this is a known migration bug in Codex Desktop 26.519.22136, please provide:
- A supported recovery procedure.
- Whether
state_5.sqlite,session_index.jsonl,.codex-global-state.json, or app-server state is authoritative for the Desktop UI. - Whether there is a command to force a full local history reindex/backfill.
- Whether a fixed version is available or planned.
Attachments / Logs Available On Request
The user can provide:
- A redacted copy of
~/.codex/state_5.sqlite - A redacted copy of
~/.codex/session_index.jsonl - Selected redacted rollout JSONL files for the affected thread IDs
~/.codex/.codex-global-state.jsonlogs_2.sqliteexcerpts
Please note that some files may contain private conversation content, local paths, and authentication-related metadata. Redaction guidance would be appreciated.
24 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Codex Desktop: Older Project Chats Disappear From Sidebar
Cause
This is usually not data loss. Codex Desktop appears to load only a limited global recent-thread window for the sidebar, roughly the most recently updated conversations. A total 50 list.
When many other threads are newer, older project chats can fall outside that window and disappear from the project sidebar even though they still exist in local storage.
Typical evidence:
%USERPROFILE%\.codex\state_5.sqlite.%USERPROFILE%\.codex\sessions\....Fixes
1. Archive low-value visible threads
Archive temporary, generated, test, or unneeded threads that currently occupy the sidebar. This frees space in the recent-thread window, so older useful project chats can show again.
Use Codex Desktop UI archive, or app-server
thread/archiveif you know the thread ids.2. Resume or refresh the missing thread
If you know the missing thread id, resume it and send a very small test turn, for example:
This updates
updated_at, pushing the thread back into the recent window. After that, restart Codex Desktop if the UI does not update immediately.3. Pin important threads
For long-running or important project chats, pin them so they are less likely to disappear from the sidebar when they fall outside the recent window.
4. Use local state as the source of truth
Do not treat the sidebar as full history. Check local storage when a chat appears missing:
%USERPROFILE%\.codex\state_5.sqlite%USERPROFILE%\.codex\sessions\...\rollout-*.jsonlProduct Bug
The sidebar should page by project, not only depend on the first global recent list. Search should also include all local threads, not only loaded recent threads.
Until that is fixed, the practical workaround is:
+1 — same bug on macOS 26.519.41501 (build 3044), macOS 15.7.4 arm64. @chenjxpp's "~50-thread global window" analysis is likely compounded by a second effect on this machine: my
session_index.jsonlis itself short relative tostate_5.sqlite. So the window is small and the input feeding the window is truncated.Reproducible drift signal
| File | Count |
|---|---:|
|
state_5.sqlitethreadsrows | 723 || of which
archived=1| 13 ||
session_index.jsonllines | 400 || Threads in DB but not in JSONL index | 323 (~45%) |
The sidebar appears to be index-driven, so those 323 threads can't surface even though their rollout files in
~/.codex/sessions/and theirstate_5.sqliterows are intact.Top affected projects (
cwd→ thread count in DB):~/.openclaw/workspace: 196~/Documents/repos/ai-tutor-platform: 154~/Documents/repos/ai-tutor-platform-fresh-main: 103~/Documents/repos/zeroclaw: 49 (13 archived)~/Documents/repos/ai-tutor-esl-integrate: 47~/Documents/PRB: 38History on this machine
session_index.jsonl, and the rebuilt index is short.What would help
state_5.sqlite+sessions/" command, ORsession_index.jsonlfrom the DB.Happy to share a sanitized
state_5.sqlite+session_index.jsonlsnapshot privately if useful.+1 hitting this on Codex Desktop 26.519.41501 (Check for Updates confirms latest). Local thread bodies all render blank; cloud threads still work. Cmd+R, full quit/relaunch, and clearing renderer caches all unhelpful as standalone fixes. Detailed reproduction + correlated logs below — hopefully useful for triage.
Environment
codex-cli 0.133.0-alpha.1(via/Applications/Codex.app/Contents/Resources/codex --version)26.521.10419(per~/.cache/codex-runtimes/codex-primary-runtime/runtime.json)Symptom
Every local thread in the sidebar opens to a completely blank body. Title bar shows the thread name, composer renders normally, but the message area is empty — no spinner, no error, no content.
thread/listandthread/readboth succeed in 50–150 ms witherrorCode=null, so the app-server isn't refusing the requests — the renderer just doesn't paint the body. Cloud-mode threads (with the cloud-badge icon) render fine in the same session.Timeline (from
~/Library/Logs/com.openai.codex/)| Time | Event |
|---|---|
| May 24, 23:22 | Codex Desktop auto-updates to 26.519.41501 (per
/Applications/Codex.appmtime) || May 24, 23:23:30 | First
error [electron-message-handler] Item not found in turn state itemId=call_qpN8JwKc8PiODD9Ib7WriQ45fires, 8 min after the update. 4,483 occurrences that day. || May 25, ~09:36 | Renderer caches (
Local Storage,Session Storage,Code Cache, GPU/Dawn caches,blob_storage) backed up & cleared → threads render again temporarily || May 25, all day | 3,289
Item not found in turn stateerrors continue in background || May 26, 14:07:34 | Local automation in conversation
019df683-26de-7823-aaf2-8baa5f99b7ab(184 MB rollout) logsturn_completed_with_incomplete_plan completedPlanStepCount=3 planStepCount=4. Error rate explodes within seconds. || May 26, 14:10–14:18 | 1,400+
Item not found in turn stateerrors in 8 minutes. All local thread bodies now render blank. || May 26, all day | 14,269 total
Item not found in turn stateerrors || May 26, 16:38 | Quarantined
019df683out of~/.codex/sessions/→ error rate drops to ~1–3/min || May 26, later | Cache cleared again + Codex fully restarted. Zero
Item not found in turn stateerrors in fresh log. Threads still render blank. |Three stacked issues (after a fresh restart in latest state)
1. "Item not found in turn state" cascade (mitigated by quarantine)
itemId=call_*references that the renderer can't resolve in old rolloutscompletedPlanStepCount < planStepCount— references to tool-call items that were planned but never emitted~/.codex/sessions/and restart2. MCP sidecar (
node_repl) initialization timeout — active blocker even after fresh restartManual launch of
/Applications/Codex.app/Contents/Resources/node_replwith proper env (CODEX_HOME,CODEX_CLI_PATH) immediately errors:Five stale
*.sockfiles accumulate in/tmp/codex-browser-use/.startup_timeout_sec = 120is configured but the timeout fires after ~30s — looks like a different sub-call timing out under the main timeout.3. Feature-flag mismatch (Desktop vs bundled CLI)
Desktop renderer tries to enable
auth_elicitation; bundled CLI 0.133.0-alpha.1 doesn't support it. Latest stable CLI (0.134.0) released today likely does, but "Check for Updates" reports "You're up to date" so there's no user-facing path to bundle a newer CLI.What didn't help (in order tried)
Cmd+Rreload (just toggles browser tab, not the chat renderer)Local Storage,Session Storage, GPU/Dawn caches,Code Cache,Cache,blob_storage) — fixed it temporarily on May 25 morning, didn't bite on May 26019df683that was generating the error cascade (resolved issue #1 but not #2/#3)What works as workaround
Cloud-mode threads render fine. Local-mode is the only broken surface.
Hypothesis on root cause
The May 24 build appears to have introduced a Desktop ⇄ bundled-CLI version drift:
marketplace/addtimes out (looks like CLI doesn't recognize the request shape)state_5.sqlitePRAGMA integrity_checkreturnsok— so this is not the DB-corruption shape that #20493 had.Happy to share log slices, MCP transcript captures, or rollout samples if useful for triage.
Update after further local testing:
I was able to confirm the apparent 50-conversation display window in Codex Desktop. After archiving/removing some currently visible conversations, previously missing conversations showed up again in the Desktop UI. This suggests the affected threads were not deleted locally; they were just outside the currently visible recent-conversation window.
I also found that conversations created by Codex automations count toward this same visible set. As a local workaround, I created a script that periodically archives automation-generated conversations after 72 hours, but only if I have not manually participated in that thread (
has_user_event = 0). This helps prevent automation runs from occupying too many slots in the recent conversation list.At the moment I have not found a better workaround other than regularly archiving/removing conversations that are no longer needed. A proper fix would likely be for Codex Desktop to paginate/load the full project history, or otherwise avoid letting automation-generated threads crowd out normal project conversations.
Another data point from macOS. This looks related to #20184, but in my case the custom provider was an OpenAI-compatible HTTP provider, not Azure.
Environment
26.519.81530(CFBundleVersion3178)codex-cli 0.133.0~/.codex/state_5.sqliteplus rollout JSONL files under~/.codex/sessions/~/.codex/archived_sessionsUser-visible symptom
After adding a custom HTTP-only provider named
openai_httpand restarting Codex Desktop, multiple local project histories disappeared from the sidebar/project sections. Some projects showedNo conversationseven though their SQLite rows and rollout JSONL files still existed.This looked like local Desktop history/index drift rather than data deletion.
Snapshot before repair attempts
A backup of
state_5.sqlitetaken before repair attempts showed:Affected project-level rows were still present. Paths redacted:
The important part is that most rows still had
previewandfirst_user_message, so this was not simply “all local thread content/title metadata is empty”. The rows were in SQLite and rollout files were still present, but Desktop did not surface them correctly.Provider/config angle
The observed sequence was:
openai_httpto~/.codex/config.toml.model_provider = "openai_http"while debugging a reconnect issue.This may be related to provider filtering or a local state reindex/reconcile path after provider/config changes. It is similar to #20184 in that custom providers appear to make persisted local history unsafe or confusing, but this case used an OpenAI-compatible HTTP provider id (
openai_http) rather than Azure.Source-level observations
I inspected the public
openai/codexsource at current HEAD and the local bundled binary strings. The current Rust thread-list query appears to filter onthreads.preview <> '', not directly onhas_user_event. The current metadata upsert path also does not includehas_user_eventin the inserted/updated column set, while the schema still has:So I do not want to overstate
has_user_event=0as the sole cause. It is at least a strong drift signal in the bad state: every thread row had it set to0while user-facing preview metadata and rollout files still existed.Expected behavior
state_5.sqliteplus rollout JSONL files.session_index.jsonl, SQLite, provider filters, or renderer state disagree, there should be a supported repair/reindex command.Requested help
Please clarify which local source is authoritative for Desktop sidebar/project history:
state_5.sqlitesession_index.jsonl.codex-global-state.jsonAlso, is there a supported way to force a full local history reindex/backfill without manually editing SQLite or JSONL files?
I can provide redacted counts, schema output, or selected sanitized rows if useful.
Another macOS data point on Codex Desktop
26.519.81530/ bundled CLI0.133.0.This looks like the same local-history/sidebar indexing bug, but I want to add one important detail: refreshing
updated_at, addingsession_index.jsonlrows, togglingthread_source, and writing the sidebar/project assignment keys into.codex-global-state.jsonstill did not restore the affected project threads.Symptom
Environment
26.519.815300.133.0~/.codex/state_5.sqlite,~/.codex/session_index.jsonl, rollout JSONL under~/.codex/sessions/...Local evidence
For one affected project root,
~/.codex/sessionshas 255session_metarows matching the project cwd, andstate_5.sqlitehas 255 matching thread rows witharchived=0.Representative rows still present in
state_5.sqlite:session_index.jsonltimestamp parse check is clean:The affected project path includes non-ASCII characters and spaces, redacted here as:
Workarounds attempted
The following were tried after backups, but the missing threads still did not show in the Desktop sidebar:
updated_at/updated_at_msfor missing rows.~/.codex/session_index.jsonl.session_index.jsonltimestamp (...03:21:53.6NZ-> valid ISO timestamp), then verifiedbad_count=0.thread_sourcetouser.thread_sourceback toNULLto match another old thread that was visible in a different project..codex-global-state.jsonkeys:projectless-thread-idsthread-workspace-root-hintsthread-project-assignmentssidebar-project-thread-orderssidebar-thread-metadataNone of the above restored the missing project threads.
Source inspection / hypothesis
I inspected the packaged Desktop renderer chunks from
app.asar.Relevant observations:
local:<thread_id>.THREAD_PROJECT_ASSIGNMENTS,PROJECTLESS_THREAD_IDS,THREAD_WORKSPACE_ROOT_HINTS, andSIDEBAR_THREAD_METADATA.So the current hypothesis is: if the app-server conversation list does not emit these valid local SQLite/session records, manually adding sidebar/project state is insufficient. The frontend never receives the missing local tasks to group/render.
What would help
Please provide either:
state_5.sqlite+sessions/, orstate_5.sqlite,session_index.jsonl, rollout JSONL,.codex-global-state.json, or another app-server cache.I can provide redacted diagnostics privately if useful.
bump
I hit a very similar Codex Desktop update issue locally: old project sessions still existed in local storage, but the new UI did not show them in the project history/sidebar.
I documented the recovery workflow I used here:
https://github.com/huajiexiewenfeng/codex-session-recovery
It is an unofficial workaround, not an upstream fix. The workflow does a dry-run first and checks the local session index, global project/sidebar state, SQLite
threads.cwd, exactcwdmatching, and Windows\\?\path mismatches. It creates timestamped backups before writing and verifies that the relevantmissing_*counts are zero afterward.This may be useful if
state_5.sqliteandsessions/**/*.jsonlstill contain the missing threads, but Codex Desktop no longer surfaces them after the update.Same bug, new version: my reproduction recurs on Codex Desktop 26.527.31326 (bundled CLI
0.135.0-alpha.1) after auto-update today (May 31 10:04 local). The earlier May 26 comment was on 26.519.41501; the issue persists in 26.527.x without OpenAI shipping any visible fix.What recurred
Local mode chat input is unusable, past conversation bodies render blank. Same identical log signature as before:
Manually launching
/Applications/Codex.app/Contents/Resources/node_replwith the full env from~/.codex/config.tomlimmediately exits with:ps -ef | grep node_replshows zero processes after Codex startup — the sidecar never establishes.A side effect on this version specifically
Right after the 26.527.31326 update,
~/.codex/.tmp/bundled-marketplaces/openai-bundled/was missing several plugin asset PNGs/SVGs that exist in/Applications/Codex.app/Contents/Resources/plugins/openai-bundled/(117 MB extracted vs 120 MB in app bundle). Manyelectron-message-handler … Failed to inline local image … ENOENTwarnings followed:I rsync'd the source bundle over the tmp extraction (which cleared the ENOENTs) but the MCP sidecar timeout still fires — so the missing assets were a symptom of incomplete extraction, not the cause of the timeout.
What's preserved across versions (the May 26 fix held)
~/.codex/.codex-global-state.json: canonical (Documents - Tim's Mac Studio/New projectwith the curly apostrophe)cwdinstate_5.sqlite: canonical path, matching workspace rootItem not found in turn stateerrors today (that bug was resolved by quarantining the dangling-tool-call rollouts)So the path-normalization bug from my last comment is fixed at the data layer — but the MCP sidecar timeout is a separate blocker that re-emerged on the new version with no workaround I've found.
Reproduction every time on 26.527.31326
/tmp/codex-browser-use/*.sock(15 stale ones accumulated from prior failed attempts)Failed to start local app-server sidecar after app-server initialization: Timed out waiting for MCP response to config/readpsOther users on this version
The thread now has 9 comments, several from the past week (@wangyaok1 May 29, @gregory-fanous May 30, @huajiexiewenfeng May 31 hours ago) reporting matching symptoms across
26.519.xbuilds. The new26.527.xrollout hasn't fixed it — it's the same failure mode with the same log signature.Could someone from the team confirm whether this is on the triage radar? Happy to provide:
node_replstderr capture if there's a flag to enable it (I triedDEBUG=*andRUST_LOG=traceenv vars without visible effect)~/.codex/config.toml(sanitized) showing the[mcp_servers.node_repl]blockLocal mode has been broken for me for ~5 days now. Cloud mode continues to work, so it's not blocking entirely — but flagging that the fix-rollout in 26.527 did not address this regression.
Cross-version confirmation: this bug is in every Codex Desktop version on the appcast feed.
After my comment a few hours ago, I tested every version listed in
https://persistent.oaistatic.com/codex-app-prod/appcast.xml:| Version | Build | Published | MCP sidecar timeout fires? |
|---|---|---|---|
| 26.527.31326 | 3390 | May 29 21:52 UTC | ✅ ~30s after launch |
| 26.527.30818 | 3370 | May 29 16:48 UTC | (implied — same family) |
| 26.519.81530 | 3178 | May 26 23:59 UTC | ✅ ~32s after launch |
| 26.519.41501 | 3044 | May 22 23:29 UTC | (had to work around it last week) |
| 26.519.31651 | 3017 | May 22 01:59 UTC | ✅ ~30s after launch |
That's every published version. Same identical log signature on each:
ps -ef | grep node_replshows zero processes on every version. Running/Applications/Codex.app/Contents/Resources/node_replmanually with the env from~/.codex/config.tomlexits immediately on every version:What's different in 26.527.x specifically
On 26.519.x the renderer would silently degrade — the timeout fired but you could still type and submit (you just lost browser/computer-use plugins). My @sulmusic2-star May 26 workaround relied on this degradation path.
In 26.527.31326 the renderer now hard-blocks the composer until the permission dropdown resolves. Concretely:
composer.permissionsDropdown.default.label(the "Default permissions" dropdown) stays in a perpetual loading state because it waits for marketplace-registered permission profiles to populateCloud-mode in the same window works fine because cloud routes around the local app-server entirely.
Things I tried on 26.527.31326 that did not help
Codex.dmgfromhttps://persistent.oaistatic.com/codex-app-prod/Codex.dmg→ reinstalled cleanly → bug persistsrm -rf ~/.codex/.tmp ~/.codex/plugins/cache→ relaunch (Codex re-extracts) → bug persists/tmp/codex-browser-use/*.sock(15+ stale sockets accumulate per session) → bug persists[mcp_servers.node_repl]in~/.codex/config.toml→ renderer still hangs on permission dropdown (so the sidecar block isn't tied only tonode_replbeing declared as an MCP server)rsync -a /Applications/Codex.app/Contents/Resources/plugins/openai-bundled/ ~/.codex/.tmp/bundled-marketplaces/openai-bundled/(the tmp extraction was missing ~3MB of plugin assets right after auto-update) → cleared theENOENTwarnings but did not clear the MCP timeoutLocal data is healthy
Verified across all reinstalls — these are all intact and matching:
~/.codex/.codex-global-state.jsonworkspace root: canonical macOS path with curly apostrophestate_5.sqliteall 73 active threads'cwd: same canonical pathstate_5.sqlitePRAGMA integrity_check: okhas_user_event=1for 80/81 threadsSo the bug isn't in user data, isn't auth, isn't disk, isn't config, isn't paths. It's in the bundled
node_replMCP server failing to respond to its initialize handshake — which then cascades to marketplace-registration timeout, permission-profile load failure, and a fully blocked composer.What would help
This thread has six independent reports now (myself x2, @chenjxpp, @justalmostgreat, @wangyaok1, @gregory-fanous, @huajiexiewenfeng) since May 22, no OpenAI response. Could someone from the Codex team confirm this is on the radar? A working
node_replbuild, even as a separate download, would unblock all of us — every other piece of the local stack works.Currently on cloud mode as the only workaround. Auto-update disabled (
defaults write com.openai.codex SUAutomaticallyUpdate -bool false) to avoid further regressions.我今天也遇到了类似的问题,让Codex进行了解决,有需要的可以参考
中文版
问题概述
Codex Desktop 侧边栏历史对话展示不完整。历史线程数据仍存在于本地线程数据库中,但侧边栏项目分组只展示部分最近线程,导致大量旧线程在 UI 中缺失。
影响范围
复现现象
根因分析
侧边栏初始化时只执行一次 recent threads 拉取:
其中
recentConversationPageCount默认值为1,初始加载只覆盖首批最近线程。项目分组依赖已经加载到内存的线程生成,因此分页之外的线程虽然存在于本地数据库,也无法进入侧边栏分组。代码中存在
loadMoreRecentConversations()分页加载逻辑,但当前侧边栏初始化流程没有稳定触发完整分页加载。诊断结果
脱敏后的本地检查结果:
<UNARCHIVED_THREAD_COUNT>条<ARCHIVED_THREAD_COUNT>条<PROJECT_ASSIGNMENT_COUNT>条涉及的本地路径与项目名已脱敏:
<USER_HOME><CODEX_STATE_DIR><PROJECT_ROOT_A>,<PROJECT_ROOT_B>,<PROJECT_ROOT_C><THREAD_ID>本地修复方案
将侧边栏初始刷新逻辑改为使用已有的完整分页接口:
该方式让侧边栏启动时加载完整未归档线程列表,再交给项目分组逻辑渲染。
同时完成了本地状态修复:
thread_source字段thread-project-assignments推荐产品修复
在源码层面调整
runRecentConversationRefresh,让侧边栏初始化使用完整分页加载:可选方案:
推荐采用
listAllThreads路径,逻辑更直接,且复用现有完整分页实现。建议附带的补丁
建议提交源码级补丁。不要提交本地
app.asar二进制文件,也不要提交任何包含用户名、真实项目路径、线程 ID 的备份文件。源码级补丁建议:
如果产品希望保留分页语义,也可以使用循环加载:
临时本地热修
仅在无法修改源码、需要先恢复本机侧边栏时使用。该方式会修改本地安装包资源,客户端更新会覆盖修改。
热修目标:
替换为:
本地热修必须满足:
01本地状态修复脚本要点
如果线程数据存在但仍然无法进入侧边栏,可检查本地线程元数据。
需要检查的字段:
空
thread_source的修复逻辑:子线程来源修复逻辑:
项目映射也需要确认:
这些状态修复属于辅助步骤。核心产品 bug 仍然是侧边栏初始化没有完整加载未归档线程。
验证标准
修复后应满足:
提交摘要
Suggested commit message:
Suggested GitHub issue title:
---
English Version
Issue Summary
Codex Desktop sidebar does not display the full conversation history. The historical thread records still exist in the local thread database, while the sidebar project groups only show a subset of recent threads. As a result, many older conversations are missing from the UI.
Impact
Reproduction
Root Cause
During sidebar initialization, recent threads are fetched once:
recentConversationPageCountdefaults to1, so the initial load only covers the first recent page. Project groups are built from the threads already loaded into memory. Threads outside that first page remain present in the local database, yet they never enter the sidebar grouping pipeline.The codebase already contains
loadMoreRecentConversations()for paginated loading, but the sidebar initialization path does not reliably trigger full pagination.Diagnostic Findings
Redacted local findings:
<UNARCHIVED_THREAD_COUNT><ARCHIVED_THREAD_COUNT><PROJECT_ASSIGNMENT_COUNT>Redacted local identifiers:
<USER_HOME><CODEX_STATE_DIR><PROJECT_ROOT_A>,<PROJECT_ROOT_B>,<PROJECT_ROOT_C><THREAD_ID>Local Hotfix
Update the sidebar initial refresh path to use the existing full pagination helper:
This lets the sidebar load the full unarchived thread list at startup before rendering project groups.
Additional local state repairs:
thread_sourcevaluesthread-project-assignmentsRecommended Product Fix
Update
runRecentConversationRefreshto hydrate all unarchived threads through the existing full pagination path:Alternative implementation:
The
listAllThreadsapproach is the preferred fix because it is direct and reuses the existing full pagination implementation.Patch To Attach
Attach the source-level patch. Do not attach a local
app.asarbinary, and do not attach backups containing real usernames, project paths, or thread IDs.Recommended source-level patch:
If the product needs to preserve explicit pagination semantics, use a loop:
Temporary Local Hotfix
Use this only when source changes are unavailable and the local sidebar needs immediate recovery. This modifies local app resources and may be overwritten by a client update.
Hotfix target:
Replacement:
Local hotfix requirements:
0after replacement1after replacementLocal State Repair Notes
If thread records exist but still do not appear in the sidebar, inspect local thread metadata.
Check source metadata:
Repair empty user thread sources:
Repair empty subagent thread sources:
Project mapping should also be checked:
These state repairs are supporting steps. The core product bug is the sidebar initialization path failing to hydrate all unarchived threads.
Verification Criteria
After the fix:
Submission Summary
Suggested commit message:
Suggested GitHub issue title:
Thanks @Ten-xu — that's a solid diagnosis and fix, but I want to flag for maintainers that this thread now contains two distinct bugs, and @Ten-xu's fix only addresses one of them. They shouldn't be closed together.
Bug A — missing sidebar history (this issue's title)
state_5.sqlite+sessions/**but don't appear in the Desktop sidebar project groups.listRecentThreads({ limit: 50 × recentConversationPageCount, cursor: null })once withrecentConversationPageCount = 1, so only the first page hydrates; project grouping only uses in-memory threads.listAllThreads({ modelProviders: null }). This looks correct for Bug A.Bug B — local app-server MCP sidecar handshake timeout (different bug, NOT fixed by the pagination patch)
Several of us on macOS (26.519.x → 26.527.x) have a different failure: local mode can't send at all — the composer's permission ("Full access") control never resolves out of its loading state, and the send arrow spins forever. Cloud mode works. Renderer log signature:
This is gated on the MCP sidecar startup, not on thread pagination, so
listAllThreadsdoes not touch it. Evidence it's a separate, app-server-side defect (gathered withRUST_LOG=traceon the bundled app-server):initializein <1s and executes a realjstool call (spawning its Node kernel) in ~0.25s, returning valid results — both sandboxed and with--disable-sandbox. Inside the app-server's ownlist_all_toolstrace it also returns its 3 tools.lsof), then tears it down ~2–3s later while still waiting the full 31s for itsconfig/read/marketplace/addresponse.list_all_tools{mcp_server_count=N}) before the composer's permission control resolves; if that aggregation/handshake doesn't complete, the chip never settles and local send stays disabled.marketplace_addedfiring 5 ms aftermarketplace_written; subsequent launches on the same binary fail.codex execfrom the terminal (same machine, same~/.codex/auth.json) runs local prompts fine, and cloud mode works — isolating the fault to the Desktop app-server's local sidecar lifecycle, not auth/CLI/model/network.Request to maintainers: please keep Bug B open and route it to whoever owns the Desktop local app-server / node_repl /
app-server --listen stdio://sidecar wiring, even if @Ten-xu's pagination fix lands for Bug A. They have different root causes. Happy to provide aRUST_LOG=traceapp-server log slice from a failing launch,lsof/codesignoutput, or the node_repl stdio-handshake repro on request. (Also filed via OpenAI support case 09438125.)I can add one more macOS datapoint that narrows the bug down further.
Environment:
26.519.22136~/.codexWhat I verified locally:
state_5.sqlitesessions/**/rollout-*.jsonlsession_index.jsonlprojectless-thread-ids:71 -> 0thread-workspace-root-hints:71 -> 021 -> 104session_index.jsonlentries:19 -> 0.codex-global-state.jsonlater reverted by itself back to the broken shape:105 -> 22105 -> 17projectless-thread-ids:0 -> 71thread-workspace-root-hints:0 -> 71So at least on this machine, this is not just a one-off stale file. The running Desktop app appears able to re-write the old broken global state back to disk from in-memory state or another internal cache.
That means a one-time local repair is not durable by itself.
Additional observation:
238active threads, the top recent window only covered13-14distinctcwdvalues. After bumping a hidden project's latest thread into the recent set, that project immediately entered the modeled recent window.Temporary local workaround I ended up using:
.codex-global-state.jsonandsession_index.jsonl.codex-global-state.jsonchanges againI packaged that recovery flow here in case it helps others reproduce/debug:
The new bit that may be useful to maintainers is the live regression behavior: Desktop can restore the bad state back onto disk after a successful repair, so the authoritative bug may be in the running app's state hydration / persistence layer, not only in a one-time migration.
Follow-up from the macOS data point I posted earlier.
This is still impacting a real production project, and the local evidence continues to indicate "UI/sidebar discovery failure" rather than deleted data.
Current affected project snapshot:
26.519.81530255local project sessions / SQLite thread rows.state_5.sqliterows havearchived=0.~/.codex/sessions/....session_index.jsonltimestamp parsing is now clean (bad_count=0).Recovery attempts that did not restore the Desktop sidebar:
updated_at/updated_at_mssession_index.jsonlthread_sourcebetweenuserandNULLthread-workspace-root-hintsthread-project-assignmentssidebar-project-thread-ordersprojectless-thread-idsI also dry-ran the community
codex-session-recoveryworkflow. It found:But on macOS that script does not detect running Codex processes, and in this case manual global-state repair has already proven non-durable. So I am not comfortable using write-mode or a watchdog workaround against a live production
~/.codex.Could someone from the Codex team confirm whether this is on the triage radar?
The two concrete product asks are:
state_5.sqlite+sessions/**/*.jsonl), so users do not need to patchapp.asaror manually edit SQLite/global-state files.Happy to provide more redacted diagnostics if useful.
Follow-up: this appears to still be active across newer Desktop builds, and the number of duplicate reports is increasing.
Recent related reports I noticed:
OpenAI.Codex_26.602.4764.0_x64__2p2nqsd0c76g0; local state exists, but Desktop sidebar/search still omits older project conversations.For my affected macOS project, the situation remains unchanged: the missing project threads still exist locally in
~/.codex/sessionsandstate_5.sqlite, but Codex Desktop does not hydrate them back into the project sidebar after restart. Manual global-state/sidebar edits were not durable because Desktop rewrote the state on launch.Request for maintainers:
state_5.sqliteand session JSONL files without patching the app bundle.Several community workarounds now involve patching/rebuilding the Desktop app or mutating local state. Those are risky for production users, so an official recovery path would help a lot.
This is really getting in the way of my codex workflow and causes substantial productivity drop especially because the workarounds mentioned are risky to use for me. So Codex team please plan a fix for this soon
If you access codex through terminal and have it audit the problem, it can disable what may be causing it like computer use or browser use, not sure what it exactly is and codex will work again without those features.
I hit a very similar issue on macOS with Codex Desktop
26.602.71036, but was able to narrow down one concrete root cause and a working local recovery path.Symptom
Several older local project threads disappeared from the Desktop sidebar and in-app search, while the underlying local data was still present:
~/.codex/sessions/**/rollout-*.jsonlfiles existed.~/.codex/state_5.sqlitestill had matchingthreadsrows.~/.codex/session_index.jsonlcould be rebuilt and contained the missing thread IDs..codex-global-state.jsoncould be updated with correctthread-workspace-root-hints, but that alone did not restore visibility.~/Library/Application Support/Codexdid not restore visibility.Key finding
For the missing older threads, the first JSONL line,
session_meta.payload.model_provider, used lowercase:Visible newer threads used:
Only updating
state_5.sqlitewas not enough. On app startup, Codex appeared to re-sync thread metadata from the rollout JSONLsession_metaheader and changed the SQLite row back to the lowercase provider value.Minimal reproduction / validation
For one missing thread:
state_5.sqliteand the target rollout JSONL file.That specific hidden thread reappeared in the project sidebar. After applying the same normalized
model_provider='OpenAI'fix to the remaining affected non-archived user threads and their rollout JSONL headers, the missing project conversations came back.Additional observations
The affected rows matched roughly:
In my case, all remaining affected rows were valid user threads. After synchronizing both SQLite and JSONL
session_meta, the lowercase-provider count became zero and the Desktop UI showed the conversations again.Suggested fix area
The migration / thread-listing layer probably should normalize provider IDs case-insensitively, or migrate old local rollout
session_meta.payload.model_providervalues fromopenaitoOpenAIwithout causing those threads to be filtered out of the Desktop UI/search.A supported recovery command would also help, e.g. something that rebuilds
state_5.sqlite,session_index.jsonl, and workspace hints from rollout JSONL while normalizing provider/source metadata safely.I am not attaching raw DB/JSONL files because they contain private conversation content and local paths, but the above was enough to reproduce and repair the issue locally.
Adding a macOS datapoint after updating to the latest Desktop build.
Environment:
~/.codexRecovery status on my affected project:
state_5.sqlitestill has 251 active/non-archived rows with the expected project cwd.~/.codex/sessions.So my current result is: 26.608.12217 looks like a partial recovery, not a full recovery. It would still be very helpful to have an official full local reindex/recovery command that rebuilds sidebar/project history from durable local state.
@wangyaok1 I also noticed the same results after the latest update. A partial recovery, but still several older projects with a lot of work performed still show "No chats".
Just happened to me this morning after I clicked 'Update' in the app and it restarted So this is still happening.
Product:
Codex Desktop app
Platform:
macOS
What happened:
After restarting Codex Desktop, part of an existing thread’s visible chat history was missing. The current thread continued, but earlier messages from the same day were no longer available to the assistant/context. I did not manually delete/archive the thread.
Impact:
I lost important conversation context and could not provide screenshots because I only noticed after restart.
Expected:
Restart should preserve full visible thread history or clearly indicate if context was compacted. Local UI thread history should not disappear.
I am seeing what appears to be the same class of issue after a recent Codex Desktop update: local thread data still exists, but the Desktop sidebar/project history UI shows no chats/projects except the currently resumed conversation.
Environment:
cli_version:0.142.3149.0.7827.197Observed behavior:
Local data checks:
Recent threads are present in
~/.codex/state_5.sqliteand corresponding rollout JSONL files exist under~/.codex/sessions/2026/06/.... Example IDs/titles from the DB:~/.codex/sessionsand~/.codex/archived_sessionsalso still contain the raw rollout files. I created local backups before trying any workaround.Additional diagnostics:
~/.codex/sqlite/state_5.sqlitewhose latest thread timestamp is stale, but the newer root DB~/.codex/state_5.sqliteis current and contains the missing threads.~/.codex/sqlite/codex-dev.dbhadlocal_thread_catalog = 0rows after restart whilestate_5.sqlitehad hundreds of threads.local_thread_catalogfrom~/.codex/state_5.sqliteto 228 active rows and setinitial_build_complete = 1; integrity check passed, but the Desktop UI still did not restore the missing histories.Potentially related but may be a separate problem:
chatgpt.com/backend-api/conversations?offset=0&limit=1currently returnsHTTP/2 403withcf-mitigated: challengefrom this network. Model/current-thread traffic still works. This may explain why the app cannot repopulate from remote history, but it does not explain why localstate_5.sqlite/rollout threads are not shown.Expected behavior:
Happy to provide additional schema counts or logs if helpful. I avoided attaching full rollout files because they contain private conversation content.
Reproduced on a newer macOS build with additional catalog-level evidence.
Environment
26.707.62119(CFBundleVersion 5211)0.144.226.5.2Symptom
Assigned project tasks appear in the sidebar for roughly one second after launch, then disappear and affected projects show No tasks. The same thing happens after every full quit/relaunch.
The earlier
config.tomlcustom-provider error was repaired; this failure reproduces independently.Data integrity and catalog evidence
Both local SQLite databases return
PRAGMA integrity_check = ok. No authoritative task rows were deleted.Running the installed app-server read-only against a snapshot, using the desktop catalog's startup
thread/listquery shape, returns all 60 eligible unarchived top-level tasks in one page:At the same time, the live derived sidebar catalog contains only 23 visible tasks and never records a completed initial build:
Project-assignment restoration cannot fix visibility by itself because grouping operates only on task IDs already present in the derived catalog.
Mechanism observed in the shipped app
The shipped renderer uses feature gate
567837310to select the discovery limit. The persistent-catalog path uses 50; only an explicitly false gate uses the prior 500-task fallback. A routine refresh then clears the broader thread summaries when the effective limit is 50.The startup catalog service schedules a full sync after five seconds and should complete this dataset in one page, but the catalog remains at
initialBuildComplete=0with a null watermark across relaunches. This explains the visible flash followed by disappearance: startup briefly renders broader state, then the incomplete derived catalog replaces it.Requested product fix
A schema-guarded reconstruction of only the derived catalog was tested twice on cloned databases: 23 → 60 visible rows, watermark/completion set atomically, integrity remained
ok, and a second run was idempotent. The authoritative task database was never written.Raw logs/databases were not attached because they contain private task, client, and repository metadata. A secure upload route can be used if maintainers need them.