From 768d5dcc19e6dea092d2133d2592341a59db4fc7 Mon Sep 17 00:00:00 2001 From: Gagancreates Date: Thu, 4 Jun 2026 02:06:31 +0530 Subject: [PATCH] fix(code-mode): hide Codex's native console window on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- apps/x/patches/@openai__codex@0.128.0.patch | 15 +++++++++++++++ apps/x/pnpm-lock.yaml | 9 +++++++-- apps/x/pnpm-workspace.yaml | 2 ++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 apps/x/patches/@openai__codex@0.128.0.patch diff --git a/apps/x/patches/@openai__codex@0.128.0.patch b/apps/x/patches/@openai__codex@0.128.0.patch new file mode 100644 index 00000000..73b2e0c3 --- /dev/null +++ b/apps/x/patches/@openai__codex@0.128.0.patch @@ -0,0 +1,15 @@ +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) => { diff --git a/apps/x/pnpm-lock.yaml b/apps/x/pnpm-lock.yaml index 65eb7f36..c4e5a8d5 100644 --- a/apps/x/pnpm-lock.yaml +++ b/apps/x/pnpm-lock.yaml @@ -10,6 +10,11 @@ catalogs: specifier: 4.1.7 version: 4.1.7 +patchedDependencies: + '@openai/codex@0.128.0': + hash: 9edd926108a95aaa788aa93870fd6b16d70eeccdf5740b503af5d34cc9f25e86 + path: patches/@openai__codex@0.128.0.patch + importers: .: @@ -8249,7 +8254,7 @@ snapshots: '@agentclientprotocol/codex-acp@0.0.44(zod@4.2.1)': dependencies: '@agentclientprotocol/sdk': 0.21.1(zod@4.2.1) - '@openai/codex': 0.128.0 + '@openai/codex': 0.128.0(patch_hash=9edd926108a95aaa788aa93870fd6b16d70eeccdf5740b503af5d34cc9f25e86) diff: 8.0.4 open: 11.0.0 vscode-jsonrpc: 8.2.1 @@ -10101,7 +10106,7 @@ snapshots: '@oozcitak/util@8.3.4': {} - '@openai/codex@0.128.0': + '@openai/codex@0.128.0(patch_hash=9edd926108a95aaa788aa93870fd6b16d70eeccdf5740b503af5d34cc9f25e86)': optionalDependencies: '@openai/codex-darwin-arm64': '@openai/codex@0.128.0-darwin-arm64' '@openai/codex-darwin-x64': '@openai/codex@0.128.0-darwin-x64' diff --git a/apps/x/pnpm-workspace.yaml b/apps/x/pnpm-workspace.yaml index 19bafad8..f5cdd141 100644 --- a/apps/x/pnpm-workspace.yaml +++ b/apps/x/pnpm-workspace.yaml @@ -13,3 +13,5 @@ onlyBuiltDependencies: - fs-xattr - macos-alias - protobufjs +patchedDependencies: + '@openai/codex@0.128.0': patches/@openai__codex@0.128.0.patch