Skip to content

Preserve script quotes in Windows sandbox cmd invocations - #60624

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/32b4b7b55f6af4dba206813eac150310f37ae1d4
Nov 10, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/32b4b7b55f6af4dba206813eac150310f37ae1d4

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Preserve script quotes in Windows sandbox cmd invocations

Why

CRT argument escaping adds literal backslashes before quotes in cmd.exe /c scripts, breaking quoted paths and executable names.

What changed

Serialize single-script cmd /c invocations with /s /c and an outer quote pair, preserving the script's quotes. Share this handling across Windows sandbox process creation, ConPTY, and MXC execution requests.

Testing

Add a regression test for certutil -hashfile with a quoted path containing spaces, and update the command-line test for a quoted PowerShell executable.

## Why

CRT argument escaping adds literal backslashes before quotes in `cmd.exe /c` scripts, breaking quoted paths and executable names.

## What changed

Serialize single-script `cmd /c` invocations with `/s /c` and an outer quote pair, preserving the script's quotes. Share this handling across Windows sandbox process creation, ConPTY, and MXC execution requests.

## Testing

Add a regression test for `certutil -hashfile` with a quoted path containing spaces, and update the command-line test for a quoted PowerShell executable.

GitOrigin-RevId: 32b4b7b55f6af4dba206813eac150310f37ae1d4
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/32b4b7b55f6af4dba206813eac150310f37ae1d4 branch from 3fe4b95 to 627b579 Compare November 10, 2026 16:58
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-10T16:58:43.101692Z 627b579 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit 627b579 into main Nov 10, 2026
9 of 24 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/32b4b7b55f6af4dba206813eac150310f37ae1d4 branch November 10, 2026 16:58
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.