fix: inherit process.env in app-server spawn when no explicit env is provided (#159)
`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 Co-authored-by: Bhuvanesh Sridharan <bhuvanesh.sridharan@databricks.com>
This commit is contained in:
parent
62c351a7bf
commit
dd335cbc76
@ -188,7 +188,7 @@ class SpawnedCodexAppServerClient extends AppServerClientBase {
|
|||||||
async initialize() {
|
async initialize() {
|
||||||
this.proc = spawn("codex", ["app-server"], {
|
this.proc = spawn("codex", ["app-server"], {
|
||||||
cwd: this.cwd,
|
cwd: this.cwd,
|
||||||
env: this.options.env,
|
env: this.options.env ?? process.env,
|
||||||
stdio: ["pipe", "pipe", "pipe"],
|
stdio: ["pipe", "pipe", "pipe"],
|
||||||
shell: process.platform === "win32" ? (process.env.SHELL || true) : false,
|
shell: process.platform === "win32" ? (process.env.SHELL || true) : false,
|
||||||
windowsHide: true
|
windowsHide: true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user