Skip to content

Commit 0c024d4

Browse files
fix: apply CODEX_BIN + shell: win32 to remaining Codex spawn sites
Extends the Windows .cmd wrapper fix to pr-close-coverage-proof.ts and commit-sweeper.ts, covering all Codex subprocess launchers.
1 parent a50878d commit 0c024d4

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/commit-sweeper.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,10 @@ function runCodex(options: {
300300
'approval_policy="never"',
301301
];
302302
if (options.serviceTier) codexConfig.splice(1, 0, `service_tier="${options.serviceTier}"`);
303+
const codexBin = process.env.CODEX_BIN ?? "codex";
304+
const useShell = process.platform === "win32";
303305
const result = spawnSync(
304-
"codex",
306+
codexBin,
305307
[
306308
"exec",
307309
"-m",
@@ -322,6 +324,7 @@ function runCodex(options: {
322324
input: readFileSync(promptPath, "utf8"),
323325
maxBuffer: 128 * 1024 * 1024,
324326
timeout: options.timeoutMs,
327+
...(useShell ? { shell: true } : {}),
325328
},
326329
);
327330
if (result.error || result.status !== 0 || !existsSync(outputPath)) {

‎src/pr-close-coverage-proof.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ export function runPrCloseCoverageProofModel(options: {
258258
if (options.runtime.serviceTier) {
259259
codexConfig.splice(1, 0, `service_tier="${options.runtime.serviceTier}"`);
260260
}
261+
const codexBin = process.env.CODEX_BIN ?? "codex";
262+
const useShell = process.platform === "win32";
261263
const result = spawnSync(
262-
"codex",
264+
codexBin,
263265
[
264266
"exec",
265267
"-m",
@@ -282,6 +284,7 @@ export function runPrCloseCoverageProofModel(options: {
282284
input: prompt,
283285
maxBuffer: 64 * 1024 * 1024,
284286
timeout: options.runtime.timeoutMs,
287+
...(useShell ? { shell: true } : {}),
285288
},
286289
);
287290
if (result.error) {

0 commit comments

Comments
 (0)