Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): find the Codex CLI bundled with ChatGPT on macOS #14110

Closedmkantautas(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/14110/headopened View on GitHub

Showing 3 changed files with 121 additions and 1 deletion.

x
0 of 3 viewed, 3 left
2 additions and 1 deletionapps/server/src/provider/Drivers/CodexDriver.tsModified
View file
@@ -68,6 +68,7 @@
materializeCodexShadowHome,
resolveCodexHomeLayout,
} from "./CodexHomeLayout.ts";
+import { resolveCodexBinaryPath } from "./CodexExecutable.ts";
const decodeCodexSettings = Schema.decodeSync(CodexSettings);
​
const DRIVER_KIND = ProviderDriverKind.make("codex");
@@ -155,7 +156,7 @@
const effectiveConfig = {
...config,
enabled,
- binaryPath: expandHomePath(config.binaryPath),
+ binaryPath: yield* resolveCodexBinaryPath(expandHomePath(config.binaryPath), processEnv),
homePath: homeLayout.effectiveHomePath ?? "",
} satisfies CodexSettings;
const resolveMaintenance = yield* makeCachedProviderMaintenanceResolution(
77 additions and 0 deletionsapps/server/src/provider/Drivers/CodexExecutable.test.tsAdded
View file
@@ -0,0 +1,77 @@
+import { describe, expect, it } from "@effect/vitest";
+import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
+import { SpawnExecutableResolution } from "@t3tools/shared/shell";
+import * as Effect from "effect/Effect";
+​
+import { resolveCodexBinaryPath } from "./CodexExecutable.ts";
+​
+const BUNDLED_CLI = "/Applications/ChatGPT.app/Contents/Resources/codex-cli/bin/codex";