Support CODEX_API_KEY for codex exec (#4615)

Allows to set API key per invocation of `codex exec`
This commit is contained in:
pakrym-oai
2025-10-02 09:59:45 -07:00
committed by GitHub
parent 35c76ad47d
commit 2f6fb37d72
13 changed files with 109 additions and 68 deletions

View File

@@ -1,4 +1,5 @@
#![allow(clippy::expect_used)]
use codex_core::auth::CODEX_API_KEY_ENV_VAR;
use std::path::Path;
use tempfile::TempDir;
use wiremock::MockServer;
@@ -14,7 +15,7 @@ impl TestCodexExecBuilder {
.expect("should find binary for codex-exec");
cmd.current_dir(self.cwd.path())
.env("CODEX_HOME", self.home.path())
.env("OPENAI_API_KEY", "dummy");
.env(CODEX_API_KEY_ENV_VAR, "dummy");
cmd
}
pub fn cmd_with_server(&self, server: &MockServer) -> assert_cmd::Command {