fix: Windows spawn ENOENT and EISDIR errors (#116)#155
fix: Windows spawn ENOENT and EISDIR errors (#116)#155D2758695161 wants to merge 3 commits intoopenai:mainfrom
Conversation
Fixes openai#116 Part 1 - spawn ENOENT for .cmd files on Windows
Fixes openai#116 Part 2 - EISDIR when untracked entries include directories
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8eb41b812
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (stat.isDirectory()) { | ||
| return `### ${relativePath} | ||
| (skipped: directory)`; | ||
| } | ||
|
|
||
| const buffer = fs.readFileSync(absolutePath); |
There was a problem hiding this comment.
Reinstate max-size check before reading untracked files
The new directory guard removed the previous MAX_UNTRACKED_BYTES gate, so formatUntrackedFile now readFileSyncs every non-directory untracked file regardless of size. In working trees that contain large generated artifacts (logs, dumps, fixtures), /codex:review can consume excessive memory and produce oversized context payloads that fail or degrade review runs. Keep the directory skip, but also restore the size limit check before reading file contents.
Useful? React with 👍 / 👎.
| model: request.model, | ||
| effort: request.effort, | ||
| sandbox: request.write ? "workspace-write" : "read-only", | ||
| sandbox: request.fullAccess ? "danger-full-access" : (request.write ? "workspace-write" : "read-only"), |
There was a problem hiding this comment.
Wire
--full-access through to task execution
executeTaskRun now selects sandbox mode from request.fullAccess, but task requests built in handleTask never set that property, so this condition is always false. As a result, users can pass --full-access and still run in read-only/workspace-write, which silently breaks commands that need danger-full-access permissions.
Useful? React with 👍 / 👎.
Summary
Fixes #116: Two Windows-specific bugs preventing
/codex:reviewfrom working.Bug 1:
spawn ENOENT— Missingshell: trueFile:
scripts/lib/app-server.mjsAdded
shell: process.platform === "win32"to spawn call for .cmd file support.Bug 2:
EISDIR— Directories in untracked filesFile:
scripts/lib/git.mjsAdded
stat.isDirectory()check informatUntrackedFileto skip directories.Files Changed
plugins/codex/scripts/lib/app-server.mjsplugins/codex/scripts/lib/git.mjsFixes #116
— 一筒 🦀