add requirements.toml commandline option

This commit is contained in:
MJR
2026-03-02 11:18:45 -05:00
parent c2e126f92a
commit 7d6cb71ec0
37 changed files with 646 additions and 35 deletions
+43
View File
@@ -1070,6 +1070,9 @@ fn merge_interactive_cli_flags(interactive: &mut TuiCli, subcommand_cli: TuiCli)
if let Some(cwd) = subcommand_cli.cwd {
interactive.cwd = Some(cwd);
}
if let Some(requirements_toml) = subcommand_cli.requirements_toml {
interactive.requirements_toml = Some(requirements_toml);
}
if subcommand_cli.web_search {
interactive.web_search = true;
}
@@ -1379,6 +1382,26 @@ mod tests {
assert_eq!(interactive.resume_session_id.as_deref(), Some("sid"));
}
#[test]
fn resume_subcommand_requirements_toml_overrides_root_value() {
let interactive = finalize_resume_from_args(
[
"codex",
"--requirements-toml",
"/tmp/root.toml",
"resume",
"--requirements-toml",
"/tmp/resume.toml",
]
.as_ref(),
);
assert_eq!(
interactive.requirements_toml.as_deref(),
Some(std::path::Path::new("/tmp/resume.toml"))
);
}
#[test]
fn resume_merges_dangerously_bypass_flag() {
let interactive = finalize_resume_from_args(
@@ -1429,6 +1452,26 @@ mod tests {
assert!(interactive.fork_show_all);
}
#[test]
fn fork_subcommand_requirements_toml_overrides_root_value() {
let interactive = finalize_fork_from_args(
[
"codex",
"--requirements-toml",
"/tmp/root.toml",
"fork",
"--requirements-toml",
"/tmp/fork.toml",
]
.as_ref(),
);
assert_eq!(
interactive.requirements_toml.as_deref(),
Some(std::path::Path::new("/tmp/fork.toml"))
);
}
#[test]
fn app_server_analytics_default_disabled_without_flag() {
let app_server = app_server_from_args(["codex", "app-server"].as_ref());