Skip to content

Codex cannot resume running thread when Windows session path differs only by \\?\ prefix #24944

@Hal9000AIML

Description

@Hal9000AIML

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions