codex - 💡(How to fix) Fix codex resume --all does not list existing local sessions, while resume <session-id> can open them [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#20165Fetched 2026-04-30 06:32:53
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

Root Cause

The same local-state issue also appears to affect the VSCode Codex extension because it uses the same ~/.codex directory.

RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.125.0

What subscription do you have?

ChatGPT Plus

Which model were you using?

gpt-5.4-mini, gpt-5.4, gpt-5.4, gpt-5.5, etc

What platform is your computer?

Darwin 25.4.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Terminal.app and VSCode integrated terminal

What issue are you seeing?

Existing local sessions still exist under ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl.

However:

codex resume --all

shows "No sessions yet".

Direct resume by session id works:

codex resume <session-id>

Example:

codex resume 019dd81b-cdcd-7da1-8b5a-ee131f2f004a

This suggests the local session files still exist and are readable, but the session picker/index is stale, corrupted, or not rebuilt.

The issue started after switching authentication/config from API key custom provider to ChatGPT account login.

The same local-state issue also appears to affect the VSCode Codex extension because it uses the same ~/.codex directory.

What steps can reproduce the bug?

  1. Use Codex CLI with existing local sessions stored in ~/.codex/sessions.

  2. Confirm rollout files exist, for example:

~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl

  1. Change authentication/configuration (in my case: switched from API key custom provider to ChatGPT login).

  2. Run:

codex resume --all

  1. Observe the picker shows "No sessions yet".

  2. Run:

codex resume <existing-session-id>

  1. Observe the session can still be opened or partially resumed.

Expected: resume --all should list all valid local sessions.

Actual: resume --all shows no sessions even though valid local sessions exist.

What is the expected behavior?

codex resume --all should detect and list all valid local sessions stored under ~/.codex/sessions.

If local index files are stale or missing, Codex should automatically rebuild the session picker from existing rollout session files.

Sessions that can be opened with:

codex resume <session-id>

should also appear in the resume --all picker.

The VSCode extension should show the same local sessions when it uses the same ~/.codex state directory.

Additional information

Relevant local files existed during the issue:

~/.codex/sessions/**/*.jsonl ~/.codex/history.jsonl ~/.codex/session_index.jsonl ~/.codex/state_5.sqlite ~/.codex/logs_2.sqlite

The problem began after switching authentication/configuration from API key custom provider to ChatGPT login.

Direct resume by session id still works, which suggests the sessions themselves are not lost.

This looks like a local session index / picker synchronization problem rather than missing session data.

extent analysis

TL;DR

The issue can be resolved by rebuilding the local session index after switching authentication/configuration methods.

Guidance

  • Verify that the ~/.codex/sessions directory and its contents are readable and not corrupted.
  • Try deleting the ~/.codex/session_index.jsonl file to force Codex to rebuild the session index.
  • Run codex resume --all again to see if the session picker is updated correctly.
  • If the issue persists, check the ~/.codex/logs_2.sqlite file for any error messages related to session index rebuilding.

Example

No code snippet is provided as it's not necessary for this issue.

Notes

The issue seems to be related to the local session index not being updated after switching authentication methods. Rebuilding the index or deleting the corrupted index file may resolve the issue. However, if the problem persists, further investigation into the Codex configuration and authentication settings may be necessary.

Recommendation

Apply workaround: Delete the ~/.codex/session_index.jsonl file and run codex resume --all again to force Codex to rebuild the session index. This should resolve the issue if it's indeed related to a stale or corrupted session index.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING