feat: remove OPENAI_API_KEY from env and mlock if set

This commit is contained in:
Michael Bolin
2025-09-25 13:28:43 -07:00
parent 103adcdf2d
commit ded6672ae6
8 changed files with 151 additions and 14 deletions
+6 -1
View File
@@ -10,6 +10,7 @@
//! This allows us to ship a completely separate set of functionality as part
//! of the `codex-exec` binary.
use clap::Parser;
use codex_arg0::PreMainArgs;
use codex_arg0::arg0_dispatch_or_else;
use codex_common::CliConfigOverrides;
use codex_exec::Cli;
@@ -25,7 +26,11 @@ struct TopCli {
}
fn main() -> anyhow::Result<()> {
arg0_dispatch_or_else(|codex_linux_sandbox_exe| async move {
arg0_dispatch_or_else(false, |pre_main_args| async move {
let PreMainArgs {
codex_linux_sandbox_exe,
openai_api_key: _,
} = pre_main_args;
let top_cli = TopCli::parse();
// Merge root-level overrides into inner CLI struct so downstream logic remains unchanged.
let mut inner = top_cli.inner;