Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

fix(runtime): handle disconnected child stdin on macOS (#2275)

Michael D'Angelo68d5ca4bbabe
diff --git a/sdk/typescript/src/runtime.ts b/sdk/typescript/src/runtime.ts
index f1bf4d7ae..6e3cdc902 100644
--- a/sdk/typescript/src/runtime.ts
+++ b/sdk/typescript/src/runtime.ts
@@ -3318,9 +3318,13 @@ export async function runCodexCommand(
});
child.stdin.on("error", (error: NodeJS.ErrnoException) => {
if (
- !["EPIPE", "ECONNRESET", "EOF", "ERR_STREAM_DESTROYED"].includes(
- error.code ?? "",
- )
+ ![
+ "EPIPE",
+ "ECONNRESET",
+ "ENOTCONN",
+ "EOF",
+ "ERR_STREAM_DESTROYED",
+ ].includes(error.code ?? "")
)
processError = error;
});