openai / openai/codex

Archiving fails on Windows when rollout_path contains the \\?\ prefix

Open Beginner friendly
#39,689 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug session windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Environment
  • Codex App: 26.818.2441.0
  • Windows NT 10.0.26200.0 (x64)
Description

Some existing threads can be opened normally, but archiving them fails with:

failed to archive thread: The system cannot find the file specified. (os error 2)

The referenced JSONL rollout file still exists and is readable.

I reproduced this with three different threads. In each case, the rollout_path stored in ~/.codex/state_5.sqlite started with the Windows extended-length path prefix:

\\?\C:\Users\<redacted>\.codex\sessions\...\rollout-<timestamp>-<thread-id>.jsonl

After backing up the database and removing only the \\?\ prefix from the affected row, the same archive operation succeeded immediately. The rollout file was moved to archived_sessions as expected.

No transcript content was changed.

Steps to reproduce
  1. On Windows, use a thread whose stored rollout_path starts with \\?\.
  2. Confirm that the referenced rollout file exists.
  3. Try to archive the thread.
  4. Archiving fails with os error 2.
Expected behavior

The thread should be archived even when a legacy rollout_path contains the Windows extended-length path prefix.

This may be related to path normalization before std::fs::rename in codex-rs/thread-store/src/local/archive_thread.rs.

Possibly related to #28276, although that report is on macOS and appears to have a different cause.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in codex-rs/thread-store/src/local/archive_thread.rs and inspect the path handling immediately before std::fs::rename. Reproduce on Windows with a stored rollout_path beginning with the extended-length prefix, then verify that archiving succeeds and moves the rollout file to archived_sessions without changing transcript content.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.