mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
add requirements.toml commandline option
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user