CLI: codex resume picker renders "No sessions yet" before initial session load completes
What issue are you seeing?
On Codex CLI 0.118.0, running codex resume from a repo that already has saved sessions can render an incorrect empty state on the first frame:
No sessions yet
I reproduced this in /Users/dxm/gitlab/alloy-test on macOS.
The saved sessions are not actually missing:
codex resume --lastsuccessfully resumes the latest session for the repo.codex resume <session_id>works.codex resume --allshows the sessions.thread/listfrom the embedded app server returns the expected session rows for this repo, including when filtering bycwd=/Users/dxm/gitlab/alloy-test.
I traced this to the TUI picker logic. The picker clears rows and starts an async load, but the empty-state renderer checks:
all_rows.is_empty() && num_scanned_files == 0-> renderNo sessions yet
before it checks whether an initial load is still pending.
So the first frame reports “no sessions” even though the session page is still loading.
Relevant code in rust-v0.118.0:
codex-rs/tui/src/resume_picker.rsaroundstart_initial_load()codex-rs/tui/src/resume_picker.rsaroundrender_empty_state_line()
What steps can reproduce the bug?
- Use Codex CLI
0.118.0on macOS. - Ensure a repo already has saved interactive sessions.
- Run
codex resumefrom that repo. - Observe that the picker can initially render
No sessions yeteven though saved sessions exist.
In my case:
cd /Users/dxm/gitlab/alloy-test
codex resume
Related checks:
cd /Users/dxm/gitlab/alloy-test
codex resume --last
codex resume --all
To verify the data layer itself is fine, I also queried the embedded app server directly with thread/list using:
modelProviders = ["codeproxy"]sourceKinds = ["cli", "vscode"]sortKey = "updated_at"
and it returned the expected /Users/dxm/gitlab/alloy-test session row.
What is the expected behavior?
The resume picker should not render No sessions yet while the initial session page is still loading.
Expected behavior:
- show a loading state such as
Loading sessions...on the initial frame, or - avoid showing the empty-state message until the initial async load has completed.
Additional information
Environment:
- Codex CLI:
0.118.0 - OS: macOS 26.3.1 on Apple Silicon
- Terminal: Apple Terminal
A direct thread/list check from the embedded app server returned rows quickly on the same machine:
initialize: about121 msthread/list: about230 ms
So this does not look like session loss or a backend filtering problem. It looks like a TUI state-ordering / empty-state rendering bug in the resume picker.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I dug into this a bit more locally and it looks narrower than “session lookup failed”.
What I confirmed on
0.118.0:thread/listalready returns the expected/Users/dxm/gitlab/alloy-testsession row on the first page.thread/listwithcwd=/Users/dxm/gitlab/alloy-testalso returns the expected row.codex resume --lastworks because it bypasses the picker and directly callsthread/listwith acwdfilter.codex resumegoes through the TUI picker and can showNo sessions yeton the first frame before the async page load completes.The likely root cause is the empty-state ordering in the picker:
start_initial_load()clearsall_rows, resets pagination, setsloading = Pending, and then kicks off the first async page request.render_empty_state_line()currently checksall_rows.is_empty() && num_scanned_files == 0and rendersNo sessions yetbefore it checksloading.is_pending().So the first frame can report “no sessions” even though the initial page is still loading.
A minimal fix seems to be:
No sessions yet.Loading sessions…whenloading.is_pending()and the first page has not been resolved yet.start_initial_load()and before the first background page is ingested.That would make the UI match the actual backend behavior without changing session lookup itself.