You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
app-server spawn strips all environment variables, breaking non-OpenAI model providers #160
When using a non-OpenAI model provider configured via env_key in ~/.codex/config.toml, invoking codex through the Claude Code plugin fails with:
Missing environment variable: DATABRICKS_TOKEN
Running codex directly from the terminal works fine.
Root Cause
In plugins/codex/scripts/lib/app-server.mjs, SpawnedCodexAppServerClient.initialize() spawns codex app-server with:
this.proc=spawn("codex",["app-server"],{cwd: this.cwd,env: this.options.env,// always undefined — no caller passes env in options
...
});
In Node.js, spawn() with env: undefined gives the child process no environment variables at all. The codex app-server subprocess can't see any env vars, so it fails when initializing model providers that require them.
Expected Behavior
The spawned codex app-server process should inherit the parent's environment variables when no explicit env is provided, matching the existing pattern in broker-lifecycle.mjs (line 146) and codex-companion.mjs (line 617).
Steps to Reproduce
Configure a non-OpenAI model provider in ~/.codex/config.toml with env_key = "DATABRICKS_TOKEN" (or any custom env var)
Activity