authorgravatar for hauke@schnau.devHauke Schnau <hauke@schnau.dev> 2026-04-23 06:37:58+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-04-23 00:37:58-04:00
logaa2d385a626c5c659e64f7e1a5bf6b568c3b840f
treeb9f16adaeca80dd654ee8e87a6788322e61ce317
parente25db3a572a6718a1f3c5a64529395cc88cd5249
signature Signed by PGP key B5690EEEBB952194

fix(server): restore CODEX_HOME tilde expansion for Codex launches (#2255)


2 files changed, 6 insertions(+), 2 deletions(-)

apps/server/src/provider/Layers/CodexProvider.ts+2-1
......@@ -28,6 +28,7 @@ import { ServerSettingsError } from "@t3tools/contracts";
2828import { makeManagedServerProvider } from "../makeManagedServerProvider.ts";
2929import { buildServerProvider } from "../providerSnapshot.ts";
3030import { CodexProvider } from "../Services/CodexProvider.ts";
31import { expandHomePath } from "../../pathExpansion.ts";
3132import { ServerSettingsService } from "../../serverSettings.ts";
3233import packageJson from "../../../package.json" with { type: "json" };
3334
......@@ -222,7 +223,7 @@ const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(fun
222223 command: input.binaryPath,
223224 args: ["app-server"],
224225 cwd: input.cwd,
225 ...(input.homePath ? { env: { CODEX_HOME: input.homePath } } : {}),
226 ...(input.homePath ? { env: { CODEX_HOME: expandHomePath(input.homePath) } } : {}),
226227 }),
227228 );
228229 const client = yield* Effect.service(CodexClient.CodexAppServerClient).pipe(
apps/server/src/provider/Layers/CodexSessionRuntime.ts+4-1
......@@ -30,6 +30,7 @@ import {
3030 CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS,
3131 CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS,
3232} from "../CodexDeveloperInstructions.ts";
33import { expandHomePath } from "../../pathExpansion.ts";
3334
3435const PROVIDER = "codex" as const;
3536
......@@ -683,7 +684,9 @@ export const makeCodexSessionRuntime = (
683684 .spawn(
684685 ChildProcess.make(options.binaryPath, ["app-server"], {
685686 cwd: options.cwd,
686 ...(options.homePath ? { env: { ...process.env, CODEX_HOME: options.homePath } } : {}),
687 ...(options.homePath
688 ? { env: { ...process.env, CODEX_HOME: expandHomePath(options.homePath) } }
689 : {}),
687690 shell: process.platform === "win32",
688691 }),
689692 )