mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
V1
This commit is contained in:
@@ -432,6 +432,9 @@ fn merge_resume_cli_flags(interactive: &mut TuiCli, resume_cli: TuiCli) {
|
||||
if resume_cli.web_search {
|
||||
interactive.web_search = true;
|
||||
}
|
||||
if resume_cli.disable_auto_compaction {
|
||||
interactive.disable_auto_compaction = true;
|
||||
}
|
||||
if !resume_cli.images.is_empty() {
|
||||
interactive.images = resume_cli.images;
|
||||
}
|
||||
@@ -567,6 +570,7 @@ mod tests {
|
||||
"--oss",
|
||||
"--full-auto",
|
||||
"--search",
|
||||
"--disable-auto-compaction",
|
||||
"--sandbox",
|
||||
"workspace-write",
|
||||
"--ask-for-approval",
|
||||
@@ -609,6 +613,18 @@ mod tests {
|
||||
.iter()
|
||||
.any(|p| p == std::path::Path::new("/tmp/b.png"));
|
||||
assert!(has_a && has_b);
|
||||
assert!(interactive.disable_auto_compaction);
|
||||
assert!(!interactive.resume_picker);
|
||||
assert!(!interactive.resume_last);
|
||||
assert_eq!(interactive.resume_session_id.as_deref(), Some("sid"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn resume_disable_auto_compaction_flag_merges() {
|
||||
let interactive =
|
||||
finalize_from_args(["codex", "resume", "sid", "--disable-auto-compaction"].as_ref());
|
||||
|
||||
assert!(interactive.disable_auto_compaction);
|
||||
assert!(!interactive.resume_picker);
|
||||
assert!(!interactive.resume_last);
|
||||
assert_eq!(interactive.resume_session_id.as_deref(), Some("sid"));
|
||||
|
||||
@@ -72,6 +72,10 @@ pub struct Cli {
|
||||
#[arg(long = "search", default_value_t = false)]
|
||||
pub web_search: bool,
|
||||
|
||||
/// Disable automatic conversation history compaction triggered near the model token limit.
|
||||
#[arg(long = "disable-auto-compaction", default_value_t = false)]
|
||||
pub disable_auto_compaction: bool,
|
||||
|
||||
#[clap(skip)]
|
||||
pub config_overrides: CliConfigOverrides,
|
||||
}
|
||||
|
||||
@@ -170,6 +170,10 @@ pub async fn run_main(
|
||||
}
|
||||
};
|
||||
|
||||
if cli.disable_auto_compaction {
|
||||
config.model_auto_compact_token_limit = None;
|
||||
}
|
||||
|
||||
// we load config.toml here to determine project state.
|
||||
#[allow(clippy::print_stderr)]
|
||||
let config_toml = {
|
||||
|
||||
Reference in New Issue
Block a user