TUI /resume intermittently forks the selected session into a new thread ID
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start at the TUI /resume entry point and compare the thread/resume and thread/fork paths. Reproduce with repeated resume and picker cycles, then inspect state_5.sqlite, rollout files, and session_meta for forked_from_id; done means /resume preserves the selected thread ID without adding a session, while explicit fork still creates one.
Written by the indexing model from the issue text.
Description
What version of Codex CLI is running?
codex-cli 0.145.0
One affected session was originally created with 0.143.0, but the issue also reproduced when both the parent and child were created with 0.145.0.
What subscription do you have?
ChatGPT subscription; the exact tier is not exposed by the local diagnostics used for this report.
Which model were you using?
gpt-5.6-sol
What platform is your computer?
Ubuntu 20.04, Linux x86_64.
What terminal emulator and version are you using?
GNOME Terminal; exact version unknown.
What issue are you seeing?
The TUI /resume command intermittently creates a new thread ID instead of resuming the selected thread in place.
This does not happen on every resume. I observed it twice on 2026-07-23, but I do not yet have a deterministic trigger.
When the issue occurs:
- I type
/resumein the Codex TUI. - I select an existing CLI session.
- The selected conversation opens with its previous history.
- Codex also creates a new rollout file with a new session ID.
- The new rollout's
session_metacontainsforked_from_idpointing to the selected session. - Both the original and the new session remain visible in the
/resumepicker with nearly identical content.
This makes /resume behave like /fork even though I did not request a fork.
Persisted-state evidence
I inspected state_5.sqlite and the affected rollout files using read-only queries. No transcript contents, full session IDs, account identifiers, or project paths are included in this report.
Three affected entries form this chain:
| Role | Created | CLI version | Source | forked_from_id |
|---|---|---|---|---|
Original (019f4283…) |
2026-07-08 | 0.143.0 | cli, thread_source=user |
absent |
Unexpected child 1 (019f8973…) |
2026-07-22 | 0.145.0 | cli, thread_source=user |
original ID |
Unexpected child 2 (019f8e63…) |
2026-07-23 | 0.145.0 | cli, thread_source=user |
unexpected child 1 ID |
The three session IDs are different, but their persisted first_user_message values are exactly equal, and each has a valid, distinct rollout file.
The relevant session_meta shape is:
{
"originator": "codex-tui",
"source": "cli",
"thread_source": "user",
"cli_version": "0.145.0",
"forked_from_id": "<previous session id>"
}
codex doctor --json reports:
state DB integrity: ok
rollout DB duplicate DB paths: 0
rollout DB duplicate rollout thread ids: 0
rollout DB scan errors: 0
The doctor report also contains two unrelated stale rows, but neither stale row belongs to the affected chain. Every affected session has a valid rollout file.
Internal Guardian/subagent threads also exist in the inventory, but these three affected entries are ordinary cli/user threads, not Guardian or subagent sessions.
What steps can reproduce the bug?
The issue is intermittent.
Observed workflow:
- Start Codex TUI inside a project.
- Work in a normal CLI session and exit or switch away from it.
- Later, type
/resume. - Select that existing session.
- Continue using the restored conversation.
- Open
/resumeagain and inspect the session list. - Sometimes a second session with the same history is present.
- Inspecting its rollout shows a new ID and
forked_from_idpointing to the selected session.
Repeating this can produce a chain in which each unexpected child points to the previous child.
Not every /resume produces a new ID, so there may be a race, loaded/unloaded thread-state distinction, app-server state difference, or another conditional path deciding between thread/resume and thread/fork. This is a hypothesis, not a confirmed root cause.
What is the expected behavior?
/resume should continue the selected thread using its existing thread ID.
Only an explicit /fork or codex fork operation should create a new thread ID with forked_from_id.
At minimum:
/resumeshould consistently use the resume path;- it should not create a new top-level session unexpectedly;
- the resume picker should not accumulate multiple copies of the same logical conversation;
- if persistence requires an internal continuation record, the UI should represent the chain as one logical session rather than multiple independent entries.
Additional information
Possibly related issues:
- #29531 — resume creates new date-based rollout files containing duplicated historical context
- #22593 — forked sessions store
forked_from_idand copy parent history - #19267 — intermittent duplicate same-title thread records with distinct IDs and rollout files
None appears to cover the exact combination observed here: Codex CLI/TUI, /resume, intermittent behavior, and an unexpected forked_from_id chain.
I can provide a redacted codex doctor --json report and sanitized session_meta records if maintainers need them. I will not post transcript contents publicly.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·