codex resume --all omits resumable sessions when first user_message is beyond scan limit
What happened?
A valid local Codex CLI session is omitted from codex resume --all, even though it can be resumed directly by session ID.
Direct resume works:
codex resume 019e029c-b1e9-7e31-992e-df4638cf8ee8
But the same session does not appear in:
codex resume --all
codex resume --all --no-alt-screen
Searching inside the picker by UUID or title also returns no result.
Environment
- Codex CLI:
0.129.0 - Package:
@openai/codex@0.129.0 - OS: Linux
- Session source:
cli - Model provider:
openai
Evidence
The session JSONL exists:
~/.codex/sessions/2026/05/07/rollout-2026-05-07T13-24-44-019e029c-b1e9-7e31-992e-df4638cf8ee8.jsonl
The local SQLite state index contains the session:
id: 019e029c-b1e9-7e31-992e-df4638cf8ee8
title: Review again and return FINAL REPORT!!
cwd: /path/to/project
archived: 0
has_user_event: 0
source: cli
model_provider: openai
The JSONL has a valid session_meta, and direct resume succeeds. However, the first actual user_message appears late in the file:
line 424: {"timestamp":"2026-05-07T13:57:10.370Z","type":"event_msg","payload":{"type":"user_message","message":"Review again and return FINAL REPORT!!", ...}}
Suspected cause
This appears related to #9501 and #9512, but the current fix still seems bounded by the picker scan limits:
HEAD_RECORD_LIMIT = 10
USER_EVENT_SCAN_LIMIT = 200
Because the first user_message is at line 424, the session remains outside the scan window and is omitted from the resume picker/list/search path.
Expected behavior
Any session that can be resumed directly by ID and exists in the local session index should appear in codex resume --all, or at least be searchable by UUID/title in the picker.
Actual behavior
The session is omitted from codex resume --all and cannot be found via picker search, despite being directly resumable by ID.
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
The picker should be able to list a session from metadata before deeply scanning the JSONL.
Use the state index / file metadata for session id, title, cwd, source, archived flag, and timestamp; then lazily scan deeper content when the row is opened or searched. A late first
user_messageshould affect preview quality, not resumability.has_user_event=falsecan be shown as a state, but it should not hide a directly resumable session.---
_Generated with ax._
I can reproduce this on Codex CLI
0.142.2with a session originally written by0.141.0.Observed behavior:
The picker only lists my current session, but the older session is present in the SQLite thread inventory and is directly resumable by UUID:
That direct resume opens correctly and prompts whether to use the recorded session cwd:
Local DB row for the affected thread:
codex doctor --jsonreports rollout/DB parity as OK:This case also matches the scan-limit theory: the first
event_msgwithpayload.type = user_messageis at line 229, just beyond the suspectedUSER_EVENT_SCAN_LIMIT = 200. Earlierresponse_itemrecords withrole = userexist at lines 4 and 6, but the state row still hashas_user_event = 0, and the picker omits the session even though direct resume succeeds.So this still appears present in
0.142.2: a late firstevent_msg.user_messageaffects picker visibility/search, but it should not make an indexed, directly resumable CLI/user session disappear fromresume --all.I put together a concrete patch for this on a fork branch:
https://github.com/mattezell/codex/tree/fix/resume-picker-previewless-sessions
Branch commit:
24b5388636 Fix listing sessions without early previews
Summary of the proposed fix:
This preserves degraded display quality for such rows while keeping directly resumable sessions visible in resume --all.
I attempted to open a PR from mattezell:fix/resume-picker-previewless-sessions to openai:main, but GitHub returned a CreatePullRequest permission error. The repo contribution guide also says external PRs are invitation-only, so sharing the patch here for maintainer use.
Your line-424 evidence is a useful boundary case: the rollout and SQLite row exist, direct UUID resume works, but the bounded picker scan makes the session effectively disappear.
I’m testing Codex Rescue against local-session discovery failures like this. It is local-first, reads rollouts without changing them, and won’t modify the Codex index or try to “repair” the picker. The useful question here is whether it consistently discovers the hidden session and reports its state despite the late first user event.
If you still have the case, could you run:
pipx install codex-rescue==0.1.0a3codex-rescue sessionscodex-rescue doctor --latestSanitized output is sufficient—please don’t publish raw JSONL, SQLite data, prompts, filesystem paths, or secrets.
https://github.com/shleder/codex-rescue