Codex App remote project conversations disappear from local sidebar, but still exist on the remote server
What version of the Codex App are you using (From “About Codex” dialog)?
26.519.81530
What subscription do you have?
api
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
I am using Codex App on Windows with an SSH remote project on a Linux server.
For this remote project, conversations sometimes disappear from the local Codex App sidebar. However, the conversations are not actually deleted. If I SSH into the remote server, I can still find the records under:
~/.codex/session_index.jsonl
~/.codex/sessions/
~/.codex/archived_sessions/
The remote session_index.jsonl still contains the conversation entries, and the corresponding rollout-*.jsonl files still exist under ~/.codex/sessions/ or ~/.codex/archived_sessions/.
So the problem appears to be that Codex App does not reliably display or sync remote project sessions in the local sidebar, even though the remote server still has the session records.
What steps can reproduce the bug?
- Open Codex App on Windows.
- Connect to a Linux server using SSH remote projects.
- Open a remote project, for example
/path/to/remote/project. - Start several conversations in that remote project.
- wait a minute or reopen Codex App.
- Some remote project conversations no longer appear in the local Codex App sidebar.
- SSH into the remote server and inspect the remote Codex files:
cat ~/.codex/session_index.jsonl
find ~/.codex/sessions ~/.codex/archived_sessions -type f -name 'rollout-*.jsonl'
What is the expected behavior?
Remote project conversations that exist in the remote server's Codex history should appear in the Codex App sidebar when I open the corresponding remote project.
Additional information
Codex CLI (in remote sever): 0.135.0
Remote OS: Ubuntu 22.04.5 LTS
9 Comments
Comment body
Reproduced on macOS (Codex Desktop) with an SSH remote project on a Linux server. Spent some time tracing this in the minified bundles inside
app.asar. Posting the diagnosis in case it helps — happy to file a PR if you point me at the source repo.Root cause (sidebar disappearance)
The chain that decides "what hostId owns this conversation" has two atoms in
app-server-manager-signals-*.js:fk(hostId) -> AppServerManager— returns the manager for a hostIdfA(conversationId) -> hostId— returns the hostId for a conversation, with a?? localfallbackWhen a remote conversation is synced from the remote AppServerManager to the local UI:
fkis computed from amkatom that only constructs a manager whenhostId === "local"— remote managers are not retrievable throughfkat all, so any "look up the manager for this hostId" call returns null.fA(conversationId)callsdA(conversationId)which reads from aTAatom /THREAD_PROJECT_ASSIGNMENTSstorage; for remote conversations these are empty, so it falls back to the local hostId.W(thread, project)matching function insidebar-project-groups-*.jsthen sees the thread withhostId === "local"and refuses to match it against a remote project (whosehostIdis the SSH host's id), so the thread is dropped from the group.So the conversation isn't lost — it just gets stamped with the wrong hostId and the sidebar grouping silently drops it.
Local workaround
I patched four call sites in the asar to bridge this:
fk: fall back to aglobalThis.__codexMgrMap.get(hostId)lookup when the scoped atom returns null.addManager(...): also populateglobalThis.__codexMgrMap.set(hostId, manager)so the fallback above has data for remote managers.W: when the thread'shostIdislocalbut the project is remote, try matching against every remote project's hostId./home/because the local app can'tstatit — suppressed for remote-shaped paths.After these four patches, remote conversations reliably appear under the right remote project in the sidebar across app restarts.
Repro consistency
The "sometimes" in the original report seems to depend on whether
THREAD_PROJECT_ASSIGNMENTShas a cached entry from a prior session — when it does,dAfinds the right hostId and the sidebar shows the thread; when it doesn't (fresh app start, new conversation, or after the cache is invalidated), the fallback to local hostId kicks in and the thread disappears.Happy to share the patched bundles or a more detailed write-up if useful.
Is the archive function working for anyone with remote ssh? If I archive a chat in a remote ssh instance, it completely disappears from the app UI. I was not able to recover it from
<settings> -> <remote-machine> -> <archived chats>, which always showsNo archived chats..Same, archival has been broken for me too, archived threads disappear from the sidebar but don't appear in Archived Chats.
And now after the latest updates all my remote chats have disappeared in all remote projects in the sidebar, even though they're still accessible through the Cmd+G palette.
All my remote threads has been lost too. They do appear for like a split second when connected to the remote, then completely disappeared. Pinned chats are alright though. The ChatGPT mobile app loads the threads just fine though, so this is a codex-macos specific bug.
Same here as well, its been happening for at least a week now. Super frustrating, one thing you can do is ask it to pin the recent threads so you can at least see where you left off.
problem sitll exist
Yes it does.
I ran into what looks like the same issue on macOS with an SSH remote: project conversations briefly appeared in the Codex sidebar and then disappeared again, while the iPhone route could still see them.
The workaround that fixed it for me was to treat the remote session files as the source of truth, not the local sidebar cache.
What I did:
~/.codex/session_index.jsonl~/.codex/sessions/**/*.jsonl~/.codex/archived_sessions/*.jsonl~/.codex/state_5.sqlitesession_meta.payload.cwdandstate_5.sqlite.threads.cwdvalues pointed at stale paths like:/workspace/projects/...while my registered remote projects now used:
/home/codex/projects/...session_metarecords in rollout filesstate_5.sqlitethreads.cwd~/.codex/sqlite/codex-dev.dblocal_thread_catalog.cwd.codex-global-state.jsonthread-project-assignmentsThe key point:
state_5.sqliteand the local sidebar catalog can be stale or partially rebuilt. The durable source of truth was the remotesession_index.jsonlplus the actual rollout files undersessions/andarchived_sessions/.In my case I also had to kill the remote app-server before patching, otherwise it could rewrite
state_5.sqliteback from stale in-memory state.Validation after the workaround:
/workspace/projects/...cwd valuesstate_5.sqlite: 0 active stale/workspace/projects/...cwd valuesThanks!!! This worked!