fix(runner): forward Codex automation credentials

This commit is contained in:
Dotta committed 2026-08-27 12:26:28 -05:00
1 parent c3f3157a03
commit 2a3c036cf5
2 files changed
+6 -2

No files matched your search

@@ -96,6 +96,7 @@ it("passes the configured Codex API key only through the provider process enviro
environment: {
PATH: "/bin",
OPENAI_API_KEY: "configured-provider-key",
CODEX_API_KEY: "configured-automation-key",
PAPERCLIP_API_KEY: "must-not-reach-provider",
},
},
@@ -116,6 +117,7 @@ it("passes the configured Codex API key only through the provider process enviro
HOME: "/isolated/codex-home",
CODEX_HOME: "/isolated/codex-home",
OPENAI_API_KEY: "configured-provider-key",
CODEX_API_KEY: "configured-automation-key",
});
expect(environment.PAPERCLIP_API_KEY).toBeUndefined();
});
@@ -851,8 +851,10 @@ export function createCapabilityRunnerdProviderEnvironment(input: {
HOME: input.codexHome,
CODEX_HOME: input.codexHome,
});
const apiKey = input.options.environment?.OPENAI_API_KEY;
if (apiKey?.trim()) environment.OPENAI_API_KEY = apiKey;
for (const key of ["OPENAI_API_KEY", "CODEX_API_KEY"] as const) {
const apiKey = input.options.environment?.[key];
if (apiKey?.trim()) environment[key] = apiKey;
}
return environment;
}