openai / openai/codex

[Windows desktop] Copy as path escapes underscores as \_ and breaks file resolution

Open
#46,037 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

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

26.908.9136.0

What subscription do you have?

ChatGPT subscription; exact tier is not shown in the Codex app UI

What platform is your computer?

Windows x64

What issue are you seeing?

When a Windows path copied with File Explorer's Ctrl+Shift+C is pasted into the Codex Desktop composer, underscores can be serialized as Markdown escapes in the persisted and model-visible message.

Original clipboard path:
C:\Users\<user>\Desktop\frame_000010.jpg

Persisted path in the session JSONL:
C:\Users\<user>\Desktop\frame\_000010.jpg

This is not only visual. The agent interpreted the inserted backslash as a Windows directory separator, checked a nonexistent path, and incorrectly told the user that the supplied path was wrong. The real file existed and opened successfully at the original path.

What steps can reproduce the bug?
  1. On Windows, create or select a file named frame_000010.jpg in File Explorer.
  2. Press Ctrl+Shift+C to use Copy as path.
  3. Paste the quoted path into a local Codex Desktop task and send the message.
  4. Ask Codex to inspect or open the file.
  5. Inspect the corresponding session JSONL under %USERPROFILE%\.codex\sessions.

The raw user message contains frame\_000010.jpg instead of frame_000010.jpg. A literal filesystem check fails for the escaped form and succeeds for the original form.

What is the expected behavior?

Pasted Windows paths should remain byte-for-byte identical in the model-visible message and session storage. If the composer uses Markdown escaping for display, the model-facing and filesystem layers must decode that escape before resolving the path.

frame_000010.jpg must never be interpreted as frame\_000010.jpg.

Additional information

Reproduced on 2026-09-17 with the current Windows package listed above.

Possibly related to #39844 and the duplicate #39902. This report narrows the case to direct File Explorer Copy as path in a current local Windows Desktop task, with immediate sent-message and filesystem impact. It does not require switching chats or repeatedly restoring an unsent draft.

No raw session file is attached because it contains unrelated private conversation content. A minimized, redacted excerpt can be provided if maintainers request it.

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

Reproduce the Windows Desktop flow using File Explorer’s Ctrl+Shift+C, then compare the pasted message with its corresponding JSONL under %USERPROFILE%.codex\sessions. Trace how the composer serializes the path and how the model-facing and filesystem layers consume it. Done means frame_000010.jpg remains identical in the sent message and session storage, and the original file resolves successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.