Skip to content

fix(windows): support long Codex executable paths - #704

Open
faizan-oai wants to merge 2 commits into
mainfrom
agent/windows-long-codex-launches
Open

fix(windows): support long Codex executable paths#704
faizan-oai wants to merge 2 commits into
mainfrom
agent/windows-long-codex-launches

Conversation

@faizan-oai

Copy link
Copy Markdown
Contributor

Summary

Fix Windows Codex launches from deeply nested installation directories. Node can return ENOENT for an existing executable with a long ordinary Windows path; launching the same binary with an extended-length path succeeds.

This is a reproduced deep-installation failure, not a claim that normal shallow installations fail or that every path above a single length is affected.

Changes

  • Convert fully qualified Windows executable paths at the direct-process and SDK launch boundaries. Keep resolver output and CODEX_CLI_PATH unchanged; preserve bare, relative, drive-relative, root-relative, and non-Windows lookup semantics.
  • Cover runtime commands, login, skill commands, publication, review/comparison, and deep-scan worker/preflight launches.
  • Supply the launch-safe executable to the default Windows SDK path, preserving the pinned SDK's bundled-tool PATH setup. Explicit overrides retain their existing tool-search behavior, and input environment objects are not mutated.
  • Extend existing tests with real Node long-path launches and synthetic worker protocols. Make Windows fixture termination and quoted-path assertions match the existing process/error contracts while retaining POSIX assertions.

Testing

Local Windows validation, with the existing Codex/SDK 0.149.1 pins:

  • Node 22.13.0 and 24.19.0: six real Codex --version launches passed across long ordinary, already-namespaced, and shallow paths. The original ordinary long-path failure was reproduced separately with the same binary.
  • The real pinned SDK completed four synthetic protocol launches across those two Node versions, covering default and explicit selection. Child observations verified unchanged reported paths and bundled-tool PATH preservation for default selection only. These were not model-backed scans.
  • Bun 1.3.14, seed 12345: 94 passed, 3 existing platform skips, 0 failures, 499 assertions across focused runtime/API/publication cases and the auth, skill-command, review, and comparison files. Other name-filtered cases were not run.
  • Both canonical Node deep-scan executor and permission-profile-preflight test scripts passed, including actual long-path process launches using synthetic protocol fixtures.
  • Generated-model verification, SDK and MCP TypeScript checks, SDK formatting, plugin-source boundary check, pnpm pack/prepack, and explicit-contract static archive inspection passed. The archive is a local working-tree validation artifact; installed-package smoke and the full suite were not run locally.

An initial comparison run rejected the temporary credential directory's ancestry. The unchanged test file then passed under a verified private test parent without changing ACLs or relaxing credential checks. Initial new-fixture cleanup/termination and quoted-path assertion failures were corrected in the tests before the final passing runs.

Risk and rollout

The default Windows SDK path now uses an explicit executable override, so retaining its bundled-tool search path is essential; both option-level tests and real SDK child observations cover this. Non-Windows default SDK selection is unchanged.

No dependency versions, credentials, sandbox policies, or persistent settings change. UNC conversion has string-level coverage only; network-share execution and a full model-backed scan were not exercised. No release or automatic merge is included.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the bug Something isn't working label Aug 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-28T05:13:58.949508Z 026361c Manual request
🔒 Security Review Completed 2026-08-28T05:11:27.843855Z 026361c New commits
ℹ️ 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.

@faizan-oai

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 562df1b915

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@faizan-oai

Copy link
Copy Markdown
Contributor Author

@codex review

Updated to 026361c with two test-only fixture corrections:

  • Bind the new launch helper in the isolated worker-cancellation fixture. The same-seed local baseline had 1 pass/4 failures; the candidate has 5 passes.
  • Resolve the host PowerShell executable before applying the captured SDK environment. The failing API case now passes with Node 22 and 24 on the child PATH, using the corresponding original CI seeds.

SDK type checking and changed-file formatting pass. Production code, cancellation assertions, scope/data assertions, and timeouts are unchanged.

The initial CI run remains recorded as failed. Its separate failure in the unchanged parallel credential-import test is being investigated independently; this commit does not claim to fix it. Current-head CI is pending.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 026361cfe9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant