rowboat/apps/x/patches/@openai__codex@0.128.0.patch
Gagancreates 768d5dcc19 fix(code-mode): hide Codex's native console window on Windows
Codex's engine ships as a native console-subsystem binary (codex.exe). Launched
from our console-less Electron process tree, Windows allocated a fresh *visible*
console window for it; closing that window wedged the run in a pending state.
(Claude Code is a Node CLI, so it never triggers this.)

The window is created by @openai/codex's launcher (bin/codex.js), which spawns
codex.exe with no windowsHide. Patch it via pnpm to pass windowsHide: true
(CREATE_NO_WINDOW) so the console stays hidden — no window, nothing to close.
2026-06-04 02:06:31 +05:30

15 lines
615 B
Diff

diff --git a/bin/codex.js b/bin/codex.js
index 67ab3e2d95dfac1c91882578b5403916c3121484..f8030b6e1459e05161af99e152b2e7f65ea6c41d 100644
--- a/bin/codex.js
+++ b/bin/codex.js
@@ -175,6 +175,10 @@ env[packageManagerEnvVar] = "1";
const child = spawn(binaryPath, process.argv.slice(2), {
stdio: "inherit",
env,
+ // Native console-subsystem binary: without this Windows pops a visible console
+ // window when launched from a console-less (Electron GUI) parent. Closing that
+ // window wedges the agent. CREATE_NO_WINDOW keeps the console hidden.
+ windowsHide: true,
});
child.on("error", (err) => {