Repository navigation
Description
Codex version
codex-cli 0.148.0
Platform
Linux x86_64, terminal TUI
Problem
A newly created fork does not appear in the codex resume picker until the user sends a regular message in the fork.
The fork is already durable and directly resumable before that message. It has a rollout file, a row in state_5.sqlite, the expected cwd, source = cli, and archived = 0. Renaming the fork also succeeds and persists the name. Direct lookup works:
codex resume <fork-thread-id>However, neither of these lists it:
codex resume
codex resume --allChanging the picker sort order or cwd filter does not help. As soon as one regular user message is submitted in the fork, it appears in the picker.
Reproduction
- Open an existing interactive CLI session with conversation history.
- Run
/fork, or start a fork withcodex fork <thread-id>. - Optionally run
/renamein the new fork. Do not send a regular message. - Note the new thread ID from
/status. - In another terminal, run
codex resume --all. - Observe that the fork is missing from the picker.
- Run
codex resume <fork-thread-id>and observe that the fork opens successfully. - Submit one regular user message in the fork.
- Run
codex resume --allagain. The fork is now listed.
This reproduced twice with fresh forks. The second reproduction was done after all older Codex processes had exited, so mixed CLI versions were ruled out.
Local evidence
Before the first message, the fork had already been written to the normal persistence surfaces:
threads.id = <fork-thread-id>
threads.source = cli
threads.thread_source = user
threads.archived = 0
threads.history_mode = paginated
threads.name = <persisted rename>
threads.rollout_path = <existing rollout file>
threads.preview = ''
threads.has_user_event = 0
The distinguishing field is the empty preview. In codex-rs/state/src/runtime/threads.rs, ordinary thread listings add:
AND threads.preview <> ''The resume picker uses this listing path. A direct UUID resume uses thread/read, so it bypasses that filter. Sending the first regular message fills the preview and makes the fork visible.
Expected behavior
A persisted fork that can be resumed by UUID should appear in the resume picker before it receives a new message. This is especially important after an explicit rename: the user has created and named a branch of an existing conversation, not an accidental empty session.
The empty-preview filter is useful for brand-new sessions that were opened and abandoned without input, but a fork already contains inherited conversation history. It should not be treated as an empty disposable thread.
Possible fix
The listing policy could include persisted forks even when their preview is empty, rather than removing the empty-preview filter globally. Another option is to give a fork a display preview derived from its inherited history, although that may blur the distinction between inherited content and the first message created in the fork.
This is related to #21619 because both failures end at the empty-preview listing filter, but the trigger is different. #21619 concerns an existing rollout whose first user event is beyond a bounded scan. This report is a deterministic fresh-fork case: persistence and rename succeed, but the child has no child-owned user event yet.
We would be happy to prepare a PR with a focused regression test and fix if maintainers agree on the desired listing semantics.
Activity
bioinformatist commentedon Sep 16, 2026
Confirmed that this is still present in stable
0.154.0and inmainas of 2026-09-16.Both versions still call the ordinary thread-list filter with
include_empty_preview = false, which adds:References:
rust-v0.154.0mainThe fresh-fork case therefore remains deterministic: the child has a valid rollout and SQLite row and is directly resumable by UUID, but it stays out of the picker until its first child-owned user message supplies a preview. This was also reproduced after all older Codex processes had exited, so it is not caused by mixed CLI versions.
We would be happy to prepare a focused PR if maintainers agree with the intended behavior. Our proposed scope would be:
Please let us know whether that listing policy matches the expected semantics, or whether maintainers would prefer the fork to receive a derived preview when it is created.
bioinformatist commentedon Nov 7, 2026
@acrognale-oai, following up given your work on #48199. When convenient, could you clarify whether hiding a persisted active fork with inherited history until its first child-owned user message is intended, or an overlooked case?
A source check of 0.167.0 shows the empty-preview filter is still applied to ordinary active listings. #50462 adds previews for delegated task inputs, which appears to cover a different path from the CLI
/forkcase here.I have not rerun the end-to-end reproduction on 0.167.0, so this is not confirmation that the bug persists. The desired behavior is to show persisted forks with inherited history while keeping abandoned, brand-new empty sessions hidden.
etraut-openai commentedon Nov 10, 2026
Thanks for the bug report. This will be addressed in an upcoming release.
balvisio commentedon Nov 16, 2026
Could you please reopen this issue and keep it open until the fix also covers already-persisted affected forks, with a released version identified?
etraut-openai commentedon Nov 16, 2026
Our process is to close a bug at the time that the fix is integrated into "main". We generally do two releases each week (Tues and Thurs), but there are time when we do additional releases or need to defer one because we find a critical problem.
balvisio commentedon Nov 16, 2026
Here is a potential fix: balvisio#1.
It backfills missing inherited previews for existing reference-backed forks before listing filters and pagination run, using each fork's saved history boundary. The regression fixtures are synthetic and cover nested forks, pagination, preservation of existing previews, empty history, and exclusion of parent messages after the fork boundary.