Skip to content

Windows: running thread resume rejects same rollout path when one side uses \\?\ prefix #24697

Closed

Description

@haowenGuo

Summary

On Windows, creating or resuming work against an already-running thread can fail with a stale-path error even when the requested rollout file and the active rollout file are the same file.

Observed error:

cannot resume running thread 019e6296-8510-7243-8d00-c899d5139d9e with stale path: requested `C:\Users\Lenovo\.codex\sessions\2026\05\26\rollout-2026-05-26T12-41-37-019e6296-8510-7243-8d00-c899d5139d9e.jsonl`, active `\\?\C:\Users\Lenovo\.codex\sessions\2026\05\26\rollout-2026-05-26T12-41-37-019e6296-8510-7243-8d00-c899d5139d9e.jsonl`

The two paths refer to the same file. The only difference is Windows' verbatim / extended-length path prefix (\\?\).

Impact

This can leave Codex Desktop unable to create tasks or resume a running thread. It can happen repeatedly if persisted thread metadata and the active running-thread path use different Windows path representations.

Likely cause

thread_processor.rs compares params.path and the active running-thread rollout path with direct PathBuf equality before rejoining a running thread. On Windows, direct equality treats C:\... and \\?\C:\... as different even when they identify the same file.

Expected behavior

The stale-path check should compare normalized paths, so Windows verbatim and non-verbatim equivalents are accepted while genuinely stale or different rollout files are still rejected.

Activity

  1. added
    bug
    app
    windows-os
    app-server
    on May 27, 2026
  2. haowenGuo commented on May 27, 2026

    @haowenGuo
    Author

    I have a small reference patch prepared here:

    The patch changes the running-thread resume stale-path guard from direct PathBuf equality to path_utils::paths_match_after_normalization, and adds a Windows regression test for C:\... vs \\?\C:\... rollout path equivalents.

    Validation performed locally:

    • git diff --check
    • cargo +stable fmt --check

    The focused Rust test was also attempted, but dependency fetch/build did not complete in the local environment within the available time.

  3. goodman-oai commented on Nov 15, 2026

    @goodman-oai
    Contributor

    Closing as completed. Codex 0.137.0 shipped the fix for the running-thread path comparison. The Windows regression test changes only the \\?\ prefix on the active rollout path and checks that thread/resume returns the same thread ID. It also checks that a different rollout is rejected. Fix and regression test · 0.137.0 release notes

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

    appapp-serverbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions