From e906c019faca25f71aa9088725f69437c1bd34d0 Mon Sep 17 00:00:00 2001 From: JUN Date: Fri, 2 Oct 2026 01:36:19 +0900 Subject: [PATCH 1/2] fix(chatgpt): build the bundled app-server path with posix.join on every host --- src/chatgpt/app-server-shim/launcher.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chatgpt/app-server-shim/launcher.ts b/src/chatgpt/app-server-shim/launcher.ts index 629633373ef..53142ddafbf 100644 --- a/src/chatgpt/app-server-shim/launcher.ts +++ b/src/chatgpt/app-server-shim/launcher.ts @@ -1,6 +1,6 @@ import { accessSync, chmodSync, constants, mkdirSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs"; import { randomBytes } from "node:crypto"; -import { join } from "node:path"; +import { join, posix } from "node:path"; import { getConfigDir } from "../../config/paths"; import { selfLaunchArgv } from "../../lib/self-launch-argv"; @@ -32,7 +32,7 @@ export function resolveChatgptCodexBinary( isExecutable: (path: string) => boolean = isExecutableFile, ): string | null { for (const layout of BUNDLED_CODEX_LAYOUTS) { - const candidate = join(bundleRoot, ...layout); + const candidate = posix.join(bundleRoot, ...layout); // macOS bundle paths are POSIX on every host if (isExecutable(candidate)) return candidate; } return null; From 5e732845748e5e76daef111f5f5113e66f213cbd Mon Sep 17 00:00:00 2001 From: JUN Date: Fri, 2 Oct 2026 02:12:15 +0900 Subject: [PATCH 2/2] test(chatgpt): assert bundled app-server candidates stay POSIX on every host --- tests/clients/desktop-app-server-shim-launcher.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/clients/desktop-app-server-shim-launcher.test.ts b/tests/clients/desktop-app-server-shim-launcher.test.ts index 4baaaa1d9fe..fa16a29364a 100644 --- a/tests/clients/desktop-app-server-shim-launcher.test.ts +++ b/tests/clients/desktop-app-server-shim-launcher.test.ts @@ -62,6 +62,16 @@ describe("experimental app-server launcher", () => { expect(resolveChatgptCodexBinary(root, () => false)).toBeNull(); }); + test("every probed bundle path stays POSIX, so a Windows host builds the same candidates", () => { + const probed: string[] = []; + resolveChatgptCodexBinary("/Users/example/Applications/ChatGPT.app", path => { probed.push(path); return false; }); + expect(probed.length).toBeGreaterThan(0); + for (const path of probed) { + expect(path).not.toContain("\\"); + expect(path.startsWith("/Users/example/Applications/ChatGPT.app/Contents/")).toBe(true); + } + }); + test("the writer embeds the binary it is given", () => withDir(dir => { const real = "/Volumes/Apps/ChatGPT.app/Contents/Resources/codex-cli/CodexCLI.app/Contents/MacOS/codex"; const path = writeChatgptShimLauncher(dir, real);