From cf00cdfa7fbeeca6f9d57ae6e19137a91c5a6e43 Mon Sep 17 00:00:00 2001 From: Bhuvanesh Sridharan Date: Mon, 6 Apr 2026 13:00:42 +0530 Subject: [PATCH] fix: inherit process.env in app-server spawn when no explicit env is provided `SpawnedCodexAppServerClient.initialize()` passes `this.options.env` to `spawn()`, but no caller ever sets `env` in options. In Node.js, passing `undefined` for `env` gives the child process **no** environment variables, breaking any model provider that relies on env vars (e.g. DATABRICKS_TOKEN). Fall back to `process.env` when `this.options.env` is not set, matching the existing pattern in `broker-lifecycle.mjs` and `codex-companion.mjs`. Co-authored-by: Isaac --- plugins/codex/scripts/lib/app-server.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/codex/scripts/lib/app-server.mjs b/plugins/codex/scripts/lib/app-server.mjs index fec105c..7590d4a 100644 --- a/plugins/codex/scripts/lib/app-server.mjs +++ b/plugins/codex/scripts/lib/app-server.mjs @@ -188,7 +188,7 @@ class SpawnedCodexAppServerClient extends AppServerClientBase { async initialize() { this.proc = spawn("codex", ["app-server"], { cwd: this.cwd, - env: this.options.env, + env: this.options.env ?? process.env, stdio: ["pipe", "pipe", "pipe"], shell: process.platform === "win32", windowsHide: true