The best way to control Claude Code, Codex and more from any computer or phone
fix(server): restore CODEX_HOME tilde expansion for Codex launches (#2255)
Hauke Schnau committed
Apr 23, 2026 at 06:37 UTC
aa2d385a626c5c659e64f7e1a5bf6b568c3b840f
2 files changed
+6
-2
apps/server/src/provider/Layers/CodexProvider.ts
+2
-1
@@ -28,6 +28,7 @@ import { ServerSettingsError } from "@t3tools/contracts";
28
import { makeManagedServerProvider } from "../makeManagedServerProvider.ts";
29
import { buildServerProvider } from "../providerSnapshot.ts";
30
import { CodexProvider } from "../Services/CodexProvider.ts";
31
+import { expandHomePath } from "../../pathExpansion.ts";
32
import { ServerSettingsService } from "../../serverSettings.ts";
33
import packageJson from "../../../package.json" with { type: "json" };
34
@@ -222,7 +223,7 @@ const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(fun
223
command: input.binaryPath,
224
args: ["app-server"],
225
cwd: input.cwd,
225
- ...(input.homePath ? { env: { CODEX_HOME: input.homePath } } : {}),
226
+ ...(input.homePath ? { env: { CODEX_HOME: expandHomePath(input.homePath) } } : {}),
227
}),
228
);
229
const client = yield* Effect.service(CodexClient.CodexAppServerClient).pipe(
apps/server/src/provider/Layers/CodexSessionRuntime.ts
+4
-1
@@ -30,6 +30,7 @@ import {
30
CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS,
31
CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS,
32
} from "../CodexDeveloperInstructions.ts";
33
+import { expandHomePath } from "../../pathExpansion.ts";
34
35
const PROVIDER = "codex" as const;
36
@@ -683,7 +684,9 @@ export const makeCodexSessionRuntime = (
684
.spawn(
685
ChildProcess.make(options.binaryPath, ["app-server"], {
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
+ : {}),
690
shell: process.platform === "win32",
691
}),
692
)