-
Notifications
You must be signed in to change notification settings - Fork 11
feat: disable codex credential sharing, enable proxied calls #854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -328,10 +328,10 @@ export function generateDockerCompose( | |||||||||||||
|
|
||||||||||||||
| // When api-proxy is enabled, exclude API keys from agent environment | ||||||||||||||
| // (they are held securely in the api-proxy sidecar instead) | ||||||||||||||
| // Note: CODEX_API_KEY is intentionally NOT excluded - Codex needs direct credential access | ||||||||||||||
| if (config.enableApiProxy) { | ||||||||||||||
| EXCLUDED_ENV_VARS.add('OPENAI_API_KEY'); | ||||||||||||||
| EXCLUDED_ENV_VARS.add('OPENAI_KEY'); | ||||||||||||||
| EXCLUDED_ENV_VARS.add('CODEX_API_KEY'); | ||||||||||||||
| EXCLUDED_ENV_VARS.add('ANTHROPIC_API_KEY'); | ||||||||||||||
| EXCLUDED_ENV_VARS.add('CLAUDE_API_KEY'); | ||||||||||||||
| } | ||||||||||||||
|
|
@@ -418,9 +418,8 @@ export function generateDockerCompose( | |||||||||||||
| if (process.env.GITHUB_PERSONAL_ACCESS_TOKEN) environment.GITHUB_PERSONAL_ACCESS_TOKEN = process.env.GITHUB_PERSONAL_ACCESS_TOKEN; | ||||||||||||||
| // API keys for LLM providers — skip when api-proxy is enabled | ||||||||||||||
| // (the sidecar holds the keys; the agent uses *_BASE_URL instead) | ||||||||||||||
| // Exception: CODEX_API_KEY is always passed through for Codex agent compatibility | ||||||||||||||
| if (process.env.OPENAI_API_KEY && !config.enableApiProxy) environment.OPENAI_API_KEY = process.env.OPENAI_API_KEY; | ||||||||||||||
| if (process.env.CODEX_API_KEY) environment.CODEX_API_KEY = process.env.CODEX_API_KEY; | ||||||||||||||
| if (process.env.CODEX_API_KEY && !config.enableApiProxy) environment.CODEX_API_KEY = process.env.CODEX_API_KEY; | ||||||||||||||
| if (process.env.ANTHROPIC_API_KEY && !config.enableApiProxy) environment.ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY; | ||||||||||||||
| if (process.env.USER) environment.USER = process.env.USER; | ||||||||||||||
| if (process.env.TERM) environment.TERM = process.env.TERM; | ||||||||||||||
|
|
@@ -1009,11 +1008,10 @@ export function generateDockerCompose( | |||||||||||||
| // Use IP address instead of hostname for BASE_URLs since Docker DNS may not resolve | ||||||||||||||
| // container names in chroot mode | ||||||||||||||
| environment.AWF_API_PROXY_IP = networkConfig.proxyIp; | ||||||||||||||
| // OPENAI_BASE_URL temporarily disabled for Codex - will be re-enabled in future | ||||||||||||||
| // if (config.openaiApiKey) { | ||||||||||||||
| // environment.OPENAI_BASE_URL = `http://${networkConfig.proxyIp}:10000/v1`; | ||||||||||||||
| // logger.debug(`OpenAI API will be proxied through sidecar at http://${networkConfig.proxyIp}:10000/v1`); | ||||||||||||||
| // } | ||||||||||||||
| if (config.openaiApiKey) { | ||||||||||||||
| environment.OPENAI_BASE_URL = `http://${networkConfig.proxyIp}:10000/v1`; | ||||||||||||||
| logger.debug(`OpenAI API will be proxied through sidecar at http://${networkConfig.proxyIp}:10000/v1`); | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+1011
to
+1014
|
||||||||||||||
| if (config.openaiApiKey) { | |
| environment.OPENAI_BASE_URL = `http://${networkConfig.proxyIp}:10000/v1`; | |
| logger.debug(`OpenAI API will be proxied through sidecar at http://${networkConfig.proxyIp}:10000/v1`); | |
| } | |
| environment.OPENAI_BASE_URL = `http://${networkConfig.proxyIp}:10000/v1`; | |
| logger.debug(`OpenAI API will be proxied through sidecar at http://${networkConfig.proxyIp}:10000/v1`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage currently validates that
CODEX_API_KEYis excluded whenenableApiProxyis true andopenaiApiKeyis provided, but it doesn’t cover the important edge case whereenableApiProxyis true and onlyprocess.env.CODEX_API_KEYis set (noopenaiApiKey). Given the new exclusion logic, adding an explicit test for that scenario would prevent regressions and clarify intended behavior (pass-through vs proxy configuration vs error).