Explicit node imports (#4567)

To help with compatibility
This commit is contained in:
pakrym-oai
2025-10-01 12:39:04 -07:00
committed by GitHub
parent 609f75acec
commit 170c685882
9 changed files with 43 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
import { spawn } from "child_process";
import { spawn } from "node:child_process";
import readline from "node:readline";
@@ -49,7 +49,7 @@ export class CodexExec {
if (args.threadId) {
commandArgs.push("resume", args.threadId);
}
}
const env = {
...process.env,
@@ -67,7 +67,7 @@ export class CodexExec {
let spawnError: unknown | null = null;
child.once("error", (err) => (spawnError = err));
if (!child.stdin) {
child.kill();
throw new Error("Child process has no stdin");
@@ -104,7 +104,9 @@ export class CodexExec {
resolve(code);
} else {
const stderrBuffer = Buffer.concat(stderrChunks);
reject(new Error(`Codex Exec exited with code ${code}: ${stderrBuffer.toString('utf8')}`));
reject(
new Error(`Codex Exec exited with code ${code}: ${stderrBuffer.toString("utf8")}`),
);
}
});
});