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";...@@ -28,6 +28,7 @@ import { ServerSettingsError } from "@t3tools/contracts";
28import { makeManagedServerProvider } from "../makeManagedServerProvider.ts";28import { makeManagedServerProvider } from "../makeManagedServerProvider.ts";
29import { buildServerProvider } from "../providerSnapshot.ts";29import { buildServerProvider } from "../providerSnapshot.ts";
30import { CodexProvider } from "../Services/CodexProvider.ts";30import { CodexProvider } from "../Services/CodexProvider.ts";
31import { expandHomePath } from "../../pathExpansion.ts";
31import { ServerSettingsService } from "../../serverSettings.ts";32import { ServerSettingsService } from "../../serverSettings.ts";
32import packageJson from "../../../package.json" with { type: "json" };33import packageJson from "../../../package.json" with { type: "json" };
3334
...@@ -222,7 +223,7 @@ const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(fun...@@ -222,7 +223,7 @@ const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(fun
222 command: input.binaryPath,223 command: input.binaryPath,
223 args: ["app-server"],224 args: ["app-server"],
224 cwd: input.cwd,225 cwd: input.cwd,
225 ...(input.homePath ? { env: { CODEX_HOME: input.homePath } } : {}),226 ...(input.homePath ? { env: { CODEX_HOME: expandHomePath(input.homePath) } } : {}),
226 }),227 }),
227 );228 );
228 const client = yield* Effect.service(CodexClient.CodexAppServerClient).pipe(229 const client = yield* Effect.service(CodexClient.CodexAppServerClient).pipe(
apps/server/src/provider/Layers/CodexSessionRuntime.ts+4-1
...@@ -30,6 +30,7 @@ import {...@@ -30,6 +30,7 @@ import {
30 CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS,30 CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS,
31 CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS,31 CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS,
32} from "../CodexDeveloperInstructions.ts";32} from "../CodexDeveloperInstructions.ts";
33import { expandHomePath } from "../../pathExpansion.ts";
3334
34const PROVIDER = "codex" as const;35const PROVIDER = "codex" as const;
3536
...@@ -683,7 +684,9 @@ export const makeCodexSessionRuntime = (...@@ -683,7 +684,9 @@ export const makeCodexSessionRuntime = (
683 .spawn(684 .spawn(
684 ChildProcess.make(options.binaryPath, ["app-server"], {685 ChildProcess.make(options.binaryPath, ["app-server"], {
685 cwd: options.cwd,686 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 : {}),
687 shell: process.platform === "win32",690 shell: process.platform === "win32",
688 }),691 }),
689 )692 )