From 42afbb2266fcde9327692b295b93d25b066e48e3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 26 Mar 2026 05:06:53 +0000 Subject: [PATCH] Fix child process env: spread process.env before CODEX_HOME override The env option on ChildProcess.make was set to only { CODEX_HOME: ... } without spreading process.env, causing the spawned codex exec process to lose all inherited environment variables (PATH, HOME, API keys, etc.). This matches the pattern used in codexAppServerManager.ts and CodexProvider.ts. --- apps/server/src/git/Layers/CodexTextGeneration.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/server/src/git/Layers/CodexTextGeneration.ts b/apps/server/src/git/Layers/CodexTextGeneration.ts index c9f9fb9403..8f332bf13e 100644 --- a/apps/server/src/git/Layers/CodexTextGeneration.ts +++ b/apps/server/src/git/Layers/CodexTextGeneration.ts @@ -172,7 +172,10 @@ const makeCodexTextGeneration = Effect.gen(function* () { "-", ], { - env: codexSettings?.homePath ? { CODEX_HOME: codexSettings.homePath } : {}, + env: { + ...process.env, + ...(codexSettings?.homePath ? { CODEX_HOME: codexSettings.homePath } : {}), + }, cwd, shell: process.platform === "win32", stdin: {