Codex Desktop remote SSH connection does not show persisted remote sessions after app restart
What version of the Codex App are you using?
Codex Desktop 26.506.31421 (2620)
What subscription do you have?
ChatGPT / Codex account subscription. I can provide the exact plan if needed.
What platform is your computer?
Local machine:
- macOS
26.4.1 - Build
25E253 - Architecture:
arm64
Remote machine:
- Connected from Codex Desktop through SSH
- Remote host:
172.27.127.196 - SSH public-key authentication
- Remote user:
jiabao
What issue are you seeing?
When using Codex Desktop with a remote SSH connection, previous remote conversations are not shown in the Codex Desktop sidebar after restarting/reopening the Desktop app.
The remote history is not lost. The remote ~/.codex directory contains valid persisted session data, including:
~/.codex/session_index.jsonl~/.codex/sessions/.../rollout-*.jsonl~/.codex/state_5.sqlite
Example remote session_index.jsonl entries:
{"id":"019e1f53-f380-74f3-9b19-62689665b5af","thread_name":"解释代码并说明复现流程","updated_at":"2026-05-13T03:14:51.727688595Z"}
{"id":"019e1f5a-f11b-7320-9df1-56690eebc764","thread_name":"排查 Codex 会话记录丢失","updated_at":"2026-05-13T03:22:01.42465072Z"}
The remote SQLite state database also contains these threads. Querying the remote DB by cwd/source/archive filters returns the sessions correctly.
However, after restarting Codex Desktop and reconnecting to the same remote host/workspace, these remote sessions still do not appear in the Desktop sidebar/history list.
Steps to reproduce
- Open Codex Desktop on macOS.
- Connect to a remote host through SSH public-key authentication.
- Start one or more Codex sessions in a remote workspace, for example
/data/jiabao/Libra-MIL. - Confirm that the remote machine has persisted session files under
~/.codex. - Quit/restart Codex Desktop.
- Reopen Codex Desktop and reconnect to the same remote host/workspace.
- Check the Desktop sidebar/history list.
Expected behavior
Codex Desktop should show the persisted remote sessions for the current remote host/workspace after restart.
If the remote app-server/TUI can query or resume those threads, the Desktop UI should surface them as resumable history entries.
Actual behavior
The remote sessions remain present on disk and in the remote state database, but Codex Desktop does not show them in the sidebar after restart.
This makes it look like the remote conversation history was lost, even though the files and database rows still exist.
Evidence / debugging performed
Remote files exist:
~/.codex/session_index.jsonl
~/.codex/sessions/.../rollout-*.jsonl
~/.codex/state_5.sqlite
Remote DB inspection confirms the sessions are present:
python3 - <<'PY'
import sqlite3, pathlib
p = pathlib.Path.home() / ".codex/state_5.sqlite"
conn = sqlite3.connect(str(p))
for row in conn.execute("""
select id, title, cwd, datetime(updated_at, 'unixepoch')
from threads
order by updated_at desc
limit 20
"""):
print(row)
PY
A query similar to the apparent app-server filters also returns the expected remote sessions:
python3 - <<'PY'
import sqlite3, pathlib
p = pathlib.Path.home() / ".codex/state_5.sqlite"
conn = sqlite3.connect(str(p))
q = """
select id, title, cwd, source, model_provider, archived, first_user_message
from threads
where archived = 0
and source in ('cli', 'vscode')
and cwd = ?
order by updated_at desc
limit 20
"""
for row in conn.execute(q, ("/data/jiabao/Libra-MIL",)):
print(row)
PY
I also tried importing/syncing the remote ~/.codex session files and SQLite rows into the local ~/.codex, including:
- copying remote
sessions/ - appending remote
session_index.jsonl - inserting remote rows into local
state_5.sqlite - adding local project trust/config entries
- updating local global/sidebar state hints
These workarounds did not make the remote histories appear in Codex Desktop after restart.
This suggests the issue is likely in Codex Desktop's remote-history/sidebar hydration or filtering logic, rather than missing persisted session files.
Related issues
This looks related to local/Desktop history surfacing issues, but the reproduction here is specifically for Codex Desktop remote SSH connections:
- #13713
- #21076
- #21659
Impact
Remote Codex sessions appear to disappear from the Desktop UI after restart, even though they are still persisted on the remote machine. This makes remote workflows difficult to continue from Codex Desktop.
8 Comments
I’m seeing the same issue with Codex Desktop and SSH remote workspaces.
Repro:
The underlying files still exist on the remote side, including
~/.codex/sessions/**/rollout-*.jsonland~/.codex/session_index.jsonl. In my case, creating a new session after reconnecting makes only that new live session visible, while older remote sessions are not backfilled into the UI after restart.This looks like a remote SSH history/sidebar hydration or backfill issue rather than the session data being lost.
我也遇到了同样的问题
same here, had to log onto the ssh node to resume conversations
I can still reproduce this on the current Codex Desktop build after updating.
Environment:
26.527.31326 (3390)codex-cli 0.135.0-alpha.1codex-cli 0.135.0/opt/<redacted-project>What I see:
remote-ssh-codex-managed:<redacted-host>project with remote path/opt/<redacted-project>.~/.codex/state_5.sqliteand~/.codex/session_index.jsonl.Remote DB evidence:
Relevant Desktop logs show
thread/listrequests against the remote app-server returning without an app-server error, for example:So this still looks like a Desktop remote sidebar/history hydration or filtering bug rather than missing remote persistence or SSH failure.
One important UX point: logging into the SSH node and running
codex resumeis not an acceptable workaround for this issue. That does recover the conversation data, but it bypasses Codex Desktop entirely and loses the intended workflow: local Desktop UI/control plane with execution and filesystem access on the remote host. The remote CLI can resume the thread, but the local Desktop sidebar cannot discover/resume it.Expected behavior:
thread/listandthread/resumeto the correct remote app-server/state.I’m seeing the same issue with Codex Desktop and a remote SSH project.
Setup:
Observed behavior:
Remote evidence:
~/.codex/session_index.jsonl.rollout-*.jsonlfile exists under~/.codex/sessions/....Expected behavior:
Remote SSH project conversations that exist in the remote Codex session index and session files should appear in the Codex Desktop sidebar for that remote project.
Actual behavior:
The remote session exists and is resumable by ID, but it is not listed in the sidebar/history for the remote project.
This looks like a sidebar/history hydration or filtering issue for remote SSH projects, rather than missing or corrupted session data.
I can reproduce this on the current Codex Desktop SSH remote flow and have additional evidence that narrows the failure to sidebar hydration rather than persistence or
thread/listtransport.Environment
26.707.71524 (5263)0.144.4Additional evidence
initialize->initialized->thread/list) returns all 22 persisted, non-archived user threads.0.144.4, multiple successfulthread/listresponses,conversationCount=22, andrefreshRecentConversationsFailed=false.notLoaded. Navigating to each existing thread changes its status toidle; after doing this, the corresponding sidebar entries appear. Once all 22 threads are opened once, the remote sidebar is fully restored.This suggests the remote transport and enumeration path is working, but the project sidebar either filters out
notLoadedremote threads or fails to hydrate successfulthread/listresults into project groups.Workaround
Open every persisted remote thread by ID once. This restores the sidebar entries, but it does not scale and requires the thread IDs to be known externally.
Expected behavior
A successful
thread/listresponse should populate the appropriate project groups even while a remote thread isnotLoaded. Alternatively, expanding a project group should lazily load/resume its persisted threads.No host identifiers, user identifiers, repository names, workspace paths, thread titles, or thread contents are included in this report.
same here
codex-cli 0.144.3
chatgpt 26.707.91948
I found an additional reproduction condition on my side: this issue occurs when the remote project directory opened in Codex App is a symbolic-link path.
For example, the project is registered/opened through a path shaped like:
After restarting the app and reconnecting to the same SSH host, the project can show no previous chats even though the remote session data is still present.
This suggests the project/thread association may be comparing paths by exact string while only one side is canonicalized—for example, the saved project path remains the symlink path while the persisted or rehydrated thread
cwdresolves to the physical path.It would be helpful for the remote sidebar hydration logic to either:
cwdconsistently; orAt minimum, equivalent symlink and physical paths should not make existing remote conversations appear to be lost.