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.
This commit is contained in:
Cursor Agent committed 2026-03-26 05:06:53 +00:00
1 parent 775794743d
commit 42afbb2266
1 file changed
+4 -1
@@ -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: {