codex - 💡(How to fix) Fix Codex Desktop remote SSH connection does not show persisted remote sessions after app restart [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#22438Fetched 2026-05-14 03:36:06
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Fix Action

Fix / Workaround

These workarounds did not make the remote histories appear in Codex Desktop after restart.

Code Example

{"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"}

---

~/.codex/session_index.jsonl
~/.codex/sessions/.../rollout-*.jsonl
~/.codex/state_5.sqlite

---

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

---

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
RAW_BUFFERClick to expand / collapse

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

  1. Open Codex Desktop on macOS.
  2. Connect to a remote host through SSH public-key authentication.
  3. Start one or more Codex sessions in a remote workspace, for example /data/jiabao/Libra-MIL.
  4. Confirm that the remote machine has persisted session files under ~/.codex.
  5. Quit/restart Codex Desktop.
  6. Reopen Codex Desktop and reconnect to the same remote host/workspace.
  7. 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

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.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex Desktop remote SSH connection does not show persisted remote sessions after app restart [1 participants]