codex - 💡(How to fix) Fix Codex Desktop side chat can half-create without rollout, then resume/fork fails with thread-store Is a directory [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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#20944Fetched 2026-05-05 05:55:52
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×1

Error Message

Error creating task failed to read thread: thread-store internal error: failed to read thread /Users/andywendt/.codex: Is a directory (os error 21)

Root Cause

The parent thread was recoverable because its rollout JSONL existed and only its threads row was missing. The side chat was not recoverable because neither the DB row nor the rollout file existed, even though app logs show it had received turns in the active UI.

Code Example

Error creating task
failed to read thread: thread-store internal error: failed to read thread /Users/andywendt/.codex: Is a directory (os error 21)

---

sqlite3 -header -column ~/.codex/state_5.sqlite "select id, title, cwd, rollout_path, datetime(updated_at,'unixepoch') as updated from threads where id in ('019df0cd-d3f9-71a1-9009-c5cef1e161ab','019df0f2-d18e-7b02-8c91-38e76fbb5164','019df0f3-0e28-7f82-9afd-b4f997d4306b');"
find ~/.codex/sessions ~/.codex/archived_sessions -type f -name '*019df0f2*' -o -name '*019df0f3*'

---

2026-05-04T03:05:38.547Z error [electron-message-handler] Conversation state not found conversationId=019df0f2-d18e-7b02-8c91-38e76fbb5164
2026-05-04T03:05:38.565Z info [AppServerConnection] response_routed ... method=thread/inject_items ... conversationId=019df0f2-d18e-7b02-8c91-38e76fbb5164 ... errorCode=null
2026-05-04T03:05:45.862Z info [AppServerConnection] response_routed ... method=turn/start ... conversationId=019df0f2-d18e-7b02-8c91-38e76fbb5164 ... errorCode=null
2026-05-04T04:14:55.842Z error [electron-message-handler] Request failed conversationId=019df0f2-d18e-7b02-8c91-38e76fbb5164 ... method=thread/fork ... error={"code":-32600,"message":"no rollout found for thread id 019df0f2-d18e-7b02-8c91-38e76fbb5164"}
2026-05-04T04:18:01.470Z error [electron-message-handler] Request failed conversationId=019df0f2-d18e-7b02-8c91-38e76fbb5164 ... method=thread/resume ... error={"code":-32603,"message":"failed to read thread: thread-store internal error: failed to read thread /Users/andywendt/.codex: Is a directory (os error 21)"}
RAW_BUFFERClick to expand / collapse

What version of Codex are you running?

Codex Desktop for macOS 26.429.30905 (2345)

App-server / CLI version observed in local thread metadata: 0.128.0-alpha.1

What platform is your computer?

  • macOS 26.4.1 (25E253)
  • Apple Silicon / arm64

What subscription do you have?

Pro

What issue are you seeing?

A side chat in Codex Desktop appears to have been half-created: it exists in the renderer/current UI and accepts some internal thread/inject_items / turn/start activity, but it is never persisted to state_5.sqlite and no rollout JSONL is written under ~/.codex/sessions. After that, trying to resume or fork from that side chat repeatedly fails with a toast:

Error creating task
failed to read thread: thread-store internal error: failed to read thread /Users/andywendt/.codex: Is a directory (os error 21)

Earlier, the parent chat itself also failed to resume with the same failed to read thread /Users/andywendt/.codex: Is a directory message until I manually restored the missing threads row in ~/.codex/state_5.sqlite from the existing rollout JSONL. The parent then opened again, but the right-hand side chat remained broken.

The important persisted-state mismatch for the broken side chat:

  • Parent thread id: 019df0cd-d3f9-71a1-9009-c5cef1e161ab
  • Parent rollout exists: ~/.codex/sessions/2026/05/03/rollout-2026-05-03T20-25-14-019df0cd-d3f9-71a1-9009-c5cef1e161ab.jsonl
  • Broken side chat id: 019df0f2-d18e-7b02-8c91-38e76fbb5164
  • No threads row exists for 019df0f2-d18e-7b02-8c91-38e76fbb5164
  • No rollout file exists for 019df0f2-d18e-7b02-8c91-38e76fbb5164
  • A second nearby side chat id, 019df0f3-0e28-7f82-9afd-b4f997d4306b, shows the same missing persisted state

Commands used to verify:

sqlite3 -header -column ~/.codex/state_5.sqlite "select id, title, cwd, rollout_path, datetime(updated_at,'unixepoch') as updated from threads where id in ('019df0cd-d3f9-71a1-9009-c5cef1e161ab','019df0f2-d18e-7b02-8c91-38e76fbb5164','019df0f3-0e28-7f82-9afd-b4f997d4306b');"
find ~/.codex/sessions ~/.codex/archived_sessions -type f -name '*019df0f2*' -o -name '*019df0f3*'

The sqlite3 query returns only the repaired parent row. The find command returns no files for either side-chat id.

Relevant log excerpts from ~/Library/Logs/com.openai.codex/2026/05/04/codex-desktop-d7d022b7-4d32-470e-b4cb-92bb8439f867-40966-t0-i1-022505-0.log:

2026-05-04T03:05:38.547Z error [electron-message-handler] Conversation state not found conversationId=019df0f2-d18e-7b02-8c91-38e76fbb5164
2026-05-04T03:05:38.565Z info [AppServerConnection] response_routed ... method=thread/inject_items ... conversationId=019df0f2-d18e-7b02-8c91-38e76fbb5164 ... errorCode=null
2026-05-04T03:05:45.862Z info [AppServerConnection] response_routed ... method=turn/start ... conversationId=019df0f2-d18e-7b02-8c91-38e76fbb5164 ... errorCode=null
2026-05-04T04:14:55.842Z error [electron-message-handler] Request failed conversationId=019df0f2-d18e-7b02-8c91-38e76fbb5164 ... method=thread/fork ... error={"code":-32600,"message":"no rollout found for thread id 019df0f2-d18e-7b02-8c91-38e76fbb5164"}
2026-05-04T04:18:01.470Z error [electron-message-handler] Request failed conversationId=019df0f2-d18e-7b02-8c91-38e76fbb5164 ... method=thread/resume ... error={"code":-32603,"message":"failed to read thread: thread-store internal error: failed to read thread /Users/andywendt/.codex: Is a directory (os error 21)"}

Steps to reproduce

I do not have a minimal deterministic repro yet, but this happened during normal Codex Desktop side-chat usage:

  1. Open an existing Codex Desktop thread.
  2. Start a side chat from that thread.
  3. Run work in the side chat long enough that it receives thread/inject_items and turn/start events.
  4. Later, try to resume the side chat or create a task/fork from it.
  5. The app shows Error creating task or Failed to resume chat with failed to read thread /Users/<user>/.codex: Is a directory (os error 21).

Expected behavior

A side chat should be persisted atomically before the renderer can route turns to it. If persistence fails, the UI should not keep a side-chat tab that can later be resumed/forked but has no rollout path.

At minimum, thread/resume / thread/fork should fail with a direct missing-rollout or missing-thread-state error instead of falling back to reading ~/.codex as though it were a rollout file.

Additional context

The parent thread was recoverable because its rollout JSONL existed and only its threads row was missing. The side chat was not recoverable because neither the DB row nor the rollout file existed, even though app logs show it had received turns in the active UI.

extent analysis

TL;DR

The issue can be mitigated by manually creating the missing threads row in the state_5.sqlite database and ensuring the corresponding rollout JSONL file exists for the side chat.

Guidance

  • Investigate why the side chat's threads row and rollout JSONL file are not being created during the side chat initialization process.
  • Verify that the thread/inject_items and turn/start events are being properly handled and that the side chat's state is being persisted correctly.
  • Check the app logs for any errors or warnings related to the side chat's persistence and rollout file creation.
  • Consider adding error handling to prevent the UI from keeping a side-chat tab that has no rollout path.

Example

No code snippet is provided as the issue seems to be related to the internal workings of the Codex Desktop application and its database.

Notes

The provided steps to reproduce the issue are not deterministic, and the root cause of the problem is still unknown. Further investigation is needed to determine why the side chat's state is not being persisted correctly.

Recommendation

Apply a workaround by manually creating the missing threads row and rollout JSONL file for the side chat, as this has been shown to resolve the issue for the parent thread. However, a permanent fix would require identifying and addressing the underlying cause of the persistence issue.

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…

FAQ

Expected behavior

A side chat should be persisted atomically before the renderer can route turns to it. If persistence fails, the UI should not keep a side-chat tab that can later be resumed/forked but has no rollout path.

At minimum, thread/resume / thread/fork should fail with a direct missing-rollout or missing-thread-state error instead of falling back to reading ~/.codex as though it were a rollout file.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING