Skip to content

[Windows] Automation resume fails on path canonicalization mismatch (C:\... vs \\?\C:\...) #20882

Open

Description

@Redas17

What version of the Codex App are you using (From “About Codex” dialog)?

0.128.0

What subscription do you have?

Pro

What platform is your computer?

Microsoft Windows NT 10.0.19044.0 x64

What issue are you seeing?

Summary
On Windows, Codex Desktop automation fails to start with:

Could not start automation
cannot resume running thread with mismatched path: requested C:\Users\Home\.codex\sessions\...\rollout-....jsonl, active \\?\C:\Users\Home\.codex\sessions\...\rollout-....jsonl

These paths point to the same file, but Codex treats them as different values and refuses to resume the thread.

What steps can reproduce the bug?

Steps to reproduce

  1. Start an automation attached to an existing thread.
  2. Stop it.
  3. Start it again.
  4. The resume fails with the mismatch error.

Actual behavior

  • Automation does not start.
  • The same error recurs across multiple automations, not just one thread.
  • Restarting Codex, signing out/in, and rebooting the machine do not reliably fix it.

What is the expected behavior?

Expected behavior

  • Codex should canonicalize Windows paths before comparing or persisting rollout/session paths.
  • C:\... and \\?\C:\... should be treated as the same file on Windows.

Additional information

Notes

Activity

  1. added
    appIssues related to the Codex desktop app
    on May 3, 2026
  2. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on May 3, 2026
  3. seasonmsg commented on May 16, 2026

    @seasonmsg

    I hit the same Windows path canonicalization bug in Codex Desktop.

    Environment:

    • Windows
    • Codex Desktop installed package: OpenAI.Codex_26.513.3673.0_x64__2p2nqsd0c76g0
    • codex.exe version observed locally: 0.131.0.0
    • Workspace: E:\Codex

    Error:
    cannot resume running thread 019e2f67-cded-7ec1-b44c-909bf4ea40de with stale path:
    requested C:\Users\Administrator\.codex\sessions\2026\05\16\rollout-2026-05-16T14-09-52-019e2f67-cded-7ec1-b44c-909bf4ea40de.jsonl,
    active \\?\C:\Users\Administrator\.codex\sessions\2026\05\16\rollout-2026-05-16T14-09-52-019e2f67-cded-7ec1-b44c-909bf4ea40de.jsonl

    Verified:

    • Both paths point to the same file.
    • File size: 2,741,579 bytes.
    • SHA256: 36e90723532f4239dc5f183b9c51ec65f5d2e98252623879ee4931dc420f77da
    • The rollout JSONL contains final_answer and task_complete.
    • state_5.sqlite stores the normal C:\ path.
    • logs_2.sqlite shows the active resume path as \?\C:...
    • The failure matches the running-thread resume check in thread_processor.rs where requested_path and active_path are compared literally.

    Impact:
    The conversation appears in the sidebar but cannot be reopened from Codex Desktop.

  4. m13v commented on May 16, 2026

    @m13v

    the \?\ vs C:\ mismatch is the classic Windows extended-length path bug. once a path passes through any Win32 canonicalization (GetFinalPathNameByHandleW, std::fs::canonicalize in Rust), it returns as \?\C:... while user-typed paths stay C:... string compare treats them as different files even though they resolve to the same handle. fix is normalizing both sides before compare, not at persist time. dunce::canonicalize strips the verbatim prefix when it's safe. hits every desktop automation framework with persistent session state eventually because the file gets touched at both layers.

  5. grantusmaximus commented on May 19, 2026

    @grantusmaximus

    I’m hitting this repeatedly on Windows Codex Desktop OpenAI.Codex_26.513.4821.0.

    All heartbeat automations can fail with the same stale-path mismatch:

    • requested: C:\...\codex\sessions\...\rollout-....jsonl
    • active: \\?\C:\...\codex\sessions\...\rollout-....jsonl

    I tried several workarounds:

    • closing and reopening Codex;
    • recreating fresh target heartbeat chats;
    • rebinding the automations to the fresh thread IDs;
    • manually normalizing threads.rollout_path in state_5.sqlite to \\?\C:\....

    Recreating/rebinding the target chats appeared to work briefly, but the issue returned. Manual DB normalization also briefly verifies as correct, but Codex later rewrites threads.rollout_path back to plain C:\..., then the automation launcher can fail because the active running thread is tracked with \\?\C:\....

    I had to pause all heartbeat automations because the error toast repeats constantly. This looks like Windows path canonicalization needs to happen before the stale-path comparison, and the current local workarounds are not durable.

  6. rkoivunen-sw commented on May 25, 2026

    @rkoivunen-sw

    I am seeing the same Windows path-canonicalization bug on a newer Codex Desktop build.

    Version: OpenAI.Codex 26.519.5221.0
    OS: Windows 11
    

    Observed repeated error shape:

    cannot resume running thread <thread-id> with stale path:
    requested `C:\Users\<user>\.codex\sessions\...\rollout-....jsonl`,
    active `\\?\C:\Users\<user>\.codex\sessions\...\rollout-....jsonl`
    

    Extra proof from local logs/binary inspection:

    AppServerConnection routed method=thread/resume from originWebcontentsId=1 and returned errorCode=-32600
    electron-message-handler reported Request failed method=thread/resume
    resources\codex.exe contains "cannot resume running thread" and "stale path"
    resources\app.asar  does not contain those strings
    

    So this still appears to be the local app-server/backend comparing equivalent Windows paths literally. C:\... and \\?\C:\... should compare equal after Windows path normalization/canonicalization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appautomationsbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions