* Build child process environment for Codex execution. * Preserve API keys captured at harness startup, even if the parent environment * is sanitized later in the run. * * @param {NodeJS.ProcessEnv} baseEnv * @param {string|undefined} codexApiKey * @param {string|undefined} openaiApiKey * @re
(baseEnv, codexApiKey, openaiApiKey)
| 245 | * @returns {NodeJS.ProcessEnv} |
| 246 | */ |
| 247 | function buildCodexChildEnv(baseEnv, codexApiKey, openaiApiKey) { |
| 248 | const childEnv = { ...baseEnv }; |
| 249 | if (codexApiKey) { |
| 250 | childEnv.CODEX_API_KEY = codexApiKey; |
| 251 | } |
| 252 | if (openaiApiKey) { |
| 253 | childEnv.OPENAI_API_KEY = openaiApiKey; |
| 254 | } |
| 255 | return childEnv; |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * Extract numeric port from a URL string. |
no outgoing calls
no test coverage detected