codex - 💡(How to fix) Fix Codex cannot resume running thread when Windows session path differs only by \\?\ prefix

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…

Error Message

After a Codex conversation has been running for a while, attempting to resume the existing running thread can fail with a stale path error. The two paths in the error appear to refer to the same session JSONL file, but one is a normal Windows path and the other uses the extended-length \\?\ path prefix.

Root Cause

This breaks continuity for long-running Codex sessions. The underlying session file still exists and appears to be the same file, but the resume logic rejects it because the path strings are formatted differently.

Code Example

cannot resume running thread <THREAD_ID> with stale path: requested `C:\Users\<USER>\.codex\sessions\YYYY\MM\DD\rollout-YYYY-MM-DDTHH-MM-SS-<THREAD_ID>.jsonl`, active `\\?\C:\Users\<USER>\.codex\sessions\YYYY\MM\DD\rollout-YYYY-MM-DDTHH-MM-SS-<THREAD_ID>.jsonl`

---

OS: Windows
OS version observed: Microsoft Windows NT 10.0.26200.0
Shell observed: PowerShell 7.6.1
Codex session storage path: C:\Users\<USER>\.codex\sessions\...
Repository: openai/codex
RAW_BUFFERClick to expand / collapse

What happened?

After a Codex conversation has been running for a while, attempting to resume the existing running thread can fail with a stale path error. The two paths in the error appear to refer to the same session JSONL file, but one is a normal Windows path and the other uses the extended-length \\?\ path prefix.

Redacted example:

cannot resume running thread <THREAD_ID> with stale path: requested `C:\Users\<USER>\.codex\sessions\YYYY\MM\DD\rollout-YYYY-MM-DDTHH-MM-SS-<THREAD_ID>.jsonl`, active `\\?\C:\Users\<USER>\.codex\sessions\YYYY\MM\DD\rollout-YYYY-MM-DDTHH-MM-SS-<THREAD_ID>.jsonl`

These paths are equivalent on Windows, but Codex appears to treat them as different and refuses to resume the thread.

Expected behavior

Codex should resume the existing running thread when the requested and active session paths differ only by Windows path normalization, such as the presence or absence of the \\?\ extended-length prefix.

The user should not need to manually copy and paste the conversation into a new session to continue.

Actual behavior

Codex blocks resume with a stale path mismatch and requires starting a new session or manually transferring context.

Impact

This breaks continuity for long-running Codex sessions. The underlying session file still exists and appears to be the same file, but the resume logic rejects it because the path strings are formatted differently.

Likely cause

The resume logic may be comparing raw path strings rather than comparing normalized/canonical Windows filesystem paths.

Suggested fix

Normalize both paths before comparing them on Windows. For example:

  • Treat C:\... and \\?\C:\... as equivalent when they resolve to the same filesystem path.
  • Canonicalize both paths through the same Windows path API before comparison.
  • Store internal session paths in one canonical format and only render user-facing paths separately.

Environment

OS: Windows
OS version observed: Microsoft Windows NT 10.0.26200.0
Shell observed: PowerShell 7.6.1
Codex session storage path: C:\Users\<USER>\.codex\sessions\...
Repository: openai/codex

Redaction note

The original username, thread ID, timestamp, and exact session file name were redacted in this report.

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

Codex should resume the existing running thread when the requested and active session paths differ only by Windows path normalization, such as the presence or absence of the \\?\ extended-length prefix.

The user should not need to manually copy and paste the conversation into a new session to continue.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING