Repository navigation
Codex Mac Desktop App: existing threads don't load after app restart #16817
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.325.31654 (1272)
What subscription do you have?
Pro
What platform is your computer?
Darwin 25.1.0 arm64 arm
What issue are you seeing?
I had a bunch of open threads (not archived) open in the Codex app, after a restart they are all gone in the UI, but still present on disk.
Except the pinned threads, somehow they remain.
From Codex itself:
The first bad loads show up on April 4, 2026 at 12:23:38Z in codex-desktop log (line 1858). Your user config in config.toml was last modified at April 4, 2026 23:15:11, and the current app bundle app.asar is from March 28, 2026. So the timing does not fit “we changed config, then sessions broke.”
What the source shows: this is a Codex Desktop subagent-thread bug. I extracted the renderer chunk to app-server-manager-hooks.js. In there, the app hydrates spawned/collab receiver threads with a thread/read using includeTurns:false, and separately the turn/started handler just errors out if the conversation is not already in memory. That creates a race. Your logs match it exactly: for this spawned session (line 1), the session is created at 18:57:21.934Z, then the log (line 21320) shows thread/read, and 95ms later the same log (line 21321) shows Received turn/started for unknown conversation, followed by No turns for conversation. That means the child thread starts emitting turn events before the renderer has inserted conversation state.
There’s a second real bug in the bundle too: the desktop code parses source.subAgent, but your stored thread/session metadata is source.subagent lowercase in state_5.sqlite and the session files. That likely breaks subagent-specific UI wiring, but it looks older and latent. The race above is the thing that matches today’s failure pattern.
More clanker slop:
After restarting Codex App, almost all previous sessions stopped loading. The only old sessions that still seem to load are pinned ones.
Important detail: this does not look like session data was deleted. The session files still exist locally on disk, but the app fails to load them after restart.
From the app logs, the failure pattern looks like this:
- the app successfully reads the thread
- then it immediately treats incoming turn/item events as belonging to an unknown conversation
- then it reports that there are no turns / no conversation state for that same conversation
Example from the logs for conversationId=019d59db-5e0a-74c3-88a0-686072ee40fe:
- 2026-04-04T18:57:22.374Z: response_routed ... method=thread/read conversationId=019d59db-5e0a-74c3-88a0-686072ee40fe
- 2026-04-04T18:57:22.469Z: Received turn/started for unknown conversation conversationId=019d59db-5e0a-74c3-88a0-686072ee40fe
- 2026-04-04T18:57:23.416Z: No turns for conversation conversationId=019d59db-5e0a-74c3-88a0-686072ee40fe
Another example for conversationId=019d5918-fa4e-74d1-9ed2-cb69be48e455:
- 2026-04-04T15:25:02.606Z: Received turn/started for unknown conversation conversationId=019d5918-fa4e-74d1-9ed2-cb69be48e455
- 2026-04-04T15:25:03.452Z: Received item/started for unknown conversation conversationId=019d5918-fa4e-74d1-9ed2-cb69be48e455
- 2026-04-04T15:25:03.452Z: Received item/completed for unknown conversation conversationId=019d5918-fa4e-74d1-9ed2-cb69be48e455
- 2026-04-04T15:25:03.840Z: Conversation state not found conversationId=019d5918-fa4e-74d1-9ed2-cb69be48e455
So the user-visible symptom is:
- restart app
- pinned sessions still load
- non-pinned previous sessions mostly or entirely fail to load
- local session data still exists
- logs suggest the app is reading thread metadata but failing to reconstruct / retain conversation state
What steps can reproduce the bug?
Uploaded thread: 019d59e6-805e-7f53-af2e-d474db002e07
What is the expected behavior?
All the threads on disk load in the app 😁
Additional information
No response
Activity
github-actions commentedon Apr 4, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
joshp123 commentedon Apr 5, 2026
@etraut-openai I don't think this is a duplicate of #15406.
/resume- in this case, the threads are not visible from the Codex CLI at all, and cannot be resumed.Can you consider re-opening this?
etraut-openai commentedon Apr 5, 2026
@joshp123, I think this is the same underlying problem. We like to consolidate problems that are likely to be the same issue because it boosts their visibility to the team. If there are a bunch of separate bug reports with little or no engagement from other users, they tend to fly beneath the radar.
That said, if you think this is truly a different issue, I'll reopen this one.
joshp123 commentedon Apr 5, 2026
Hey @etraut-openai , thanks for the response and re-opening the issue - I appreciate it. Totally understand consolidating duplicates, no criticism there :)
One more additional datapoint (that also diverges from the linked ticket) - it seems like my preferences for the Codex app (and possibly CLI) also got reset around the same time. I'm having Codex look into the issue; will keep the issue updated with additional information and enrich the issue with this.
yahuo commentedon Apr 12, 2026
Additional evidence from a renderer/sidebar-only variant on macOS. This may be the same umbrella symptom as
#16095, but on my machine the failing layer is clearly the Desktop renderer, not local storage or the app-server.Environment
26.409.20454(build1462)Darwin 25.xonarm64/Users/jinxin/Applications/OpenSource/claude-codeWhat is healthy
~/.codex/state_5.sqlitecontains12unarchived threads for that exactcwd.thread/listfor that exactcwd.thread/list({ cwd=..., archived=false })thread/list({ cwd=..., archived=false, sourceKinds=[] })thread/list({ cwd=..., archived=false, sourceKinds=null })thread/list({ cwd=..., archived=false, sourceKinds=["vscode"] })Observed UI symptom
What I validated locally
app-server-manager-hooks-*.jsandapp-server-manager-signals-*.js).refetchThreadList()must page through allthread/listcursors, not only the current50 * pageCountwindow.listAllThreads({ archived:false })result, not seeded from the current in-memory recent-conversation subset and then left vulnerable to being overwritten by that partial state.After applying that renderer-side patch locally:
ElectronAsarIntegrity, and re-signingImportant upstreaming blocker
openai/codexrepo to try to send a PR.codex appin the public repo only downloads/opens Codex Desktop; it does not contain the sidebar implementation I had to patch.So from the outside this looks like an internal Desktop-source fix, not something that can currently be fixed with a public PR against
openai/codex.If useful, I can post the exact local patch shape I validated, but the short version is: the backend
thread/listlayer is healthy here; the failing layer is renderer-side recent-conversation pagination/cache hydration in the Desktop app.vernon99 commentedon Apr 12, 2026
Just wanted to chime in here, happened to twice in the last 30 minutes, removing first a bunch of chats after restart and then removing the rest. Almost all of mu chats are gone, ugh.
joshp123 commentedon Apr 13, 2026
I just saw this reported bug: #17316 , and IIRC it coincided with me also switching providers, and when I switched providers once more back to default ChatGPT, all my threads re-appeared. I think this could be the key?
aboqasem commentedon May 4, 2026
Looks like this is the intended behavior: #15494.
I asked codex to create a script to sync all current sessions:
Prompt
Codex response
Added a standalone script at
sync_session_providers.py. It reads the currentmodel_providerfromconfig.toml, finds session files under~/.codex/sessions, and for every session whosesession_meta.payload.model_providerdiffers, it creates a cloned.jsonlwith:session_meta.payload.model_providerrewritten to the current config valuesession_meta.payload.idrewritten to the new UUIDVerified in dry-run mode: it currently finds
10sessions to sync for providermyprovider.Use:
I did not run
--apply, so nothing insessions/was changed yet.shaypal5 commentedon May 7, 2026
I hit what appears to be the same class of bug, but with a very clear pagination/hydration signal.
Environment:
26.429.61741codex-cli 0.128.0-alpha.115.7.4, Darwin24.6.0, arm64~/.codex/state_5.sqlitehad427unarchived threads and27archived threads across31cwd/project rootsSymptoms:
~/.codex/state_5.sqlite,~/.codex/session_index.jsonl, and rollout files under~/.codex/sessionswere intact.codex resume --all --include-non-interactivecould find the missing conversations immediately.codex app-server --listen stdio://could return the missing project threads viathread/listwhen querying directly bycwd.No chats.Most useful finding:
This looks like the same underlying issue as #14751: the renderer/sidebar is driven by a globally loaded recent subset, rather than fetching enough pages or querying per-project history when expanding a project.
Local proof:
threads.updated_atdid not persist, because the app-server scan-and-repair path rewrote the DB timestamps from the rollout JSONL timestamps.listRecentThreadsto followthread/listcursors internally, fetching multiple pages of 100 before building the sidebar/project cache, restored all missing projects and conversations.Important implementation detail for reproducing the hotpatch safely on macOS/Electron:
app.asarwithout updatingElectronAsarIntegrityinContents/Info.plistcaused the app to crash at startup withEXC_BREAKPOINT/SIGTRAPduring Electron bootstrap.app.asar, updatingElectronAsarIntegrity["Resources/app.asar"].hashto the SHA-256 of the ASAR header string, and then re-signing ad-hoc made the patched app launch.The effective app-side workaround was conceptually:
After that patch, the Desktop sidebar/project groups showed the missing conversations again. So the likely product fix is for the Desktop renderer/sidebar to page through local
thread/listresults as needed, or to querythread/listbycwdwhen expanding/searching a project, instead of assuming the initial global recent window is sufficient.roymasad commentedon May 13, 2026
thank you for the valuable detailed post, any update from the codex team concerning this ?
chenjxpp commentedon May 22, 2026
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:
rrosztoczy commentedon Jun 12, 2026
I just want to mention that this is a frequent issue for me still.
dkkb commentedon Jun 25, 2026
Me too