From 574cf183c7ab77e91db5976bf47f315d3c0bef7d Mon Sep 17 00:00:00 2001 From: jif-oai Date: Fri, 19 Dec 2025 17:03:54 +0100 Subject: [PATCH] fix tests --- codex-rs/core/tests/suite/compact.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codex-rs/core/tests/suite/compact.rs b/codex-rs/core/tests/suite/compact.rs index 91bcfac347..d35f42f001 100644 --- a/codex-rs/core/tests/suite/compact.rs +++ b/codex-rs/core/tests/suite/compact.rs @@ -1836,6 +1836,8 @@ async fn auto_compact_allows_multiple_attempts_when_interleaved_with_other_turn_ let mut config = load_default_config_for_test(&home).await; config.model_provider = model_provider; set_test_compact_prompt(&mut config); + // Keep base instructions empty so token estimates align with mocked usage. + config.base_instructions = Some(String::new()); config.model_auto_compact_token_limit = Some(200); let conversation_manager = ConversationManager::with_models_provider( CodexAuth::from_api_key("dummy"), @@ -1947,6 +1949,8 @@ async fn auto_compact_triggers_after_function_call_over_95_percent_usage() { let mut config = load_default_config_for_test(&home).await; config.model_provider = model_provider; set_test_compact_prompt(&mut config); + // Keep base instructions empty so token estimates align with mocked usage. + config.base_instructions = Some(String::new()); config.model_context_window = Some(context_window); config.model_auto_compact_token_limit = Some(limit); @@ -2074,6 +2078,8 @@ async fn auto_compact_counts_encrypted_reasoning_before_last_user() { .with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()) .with_config(|config| { set_test_compact_prompt(config); + // Keep base instructions empty so token estimates align with mocked usage. + config.base_instructions = Some(String::new()); config.model_auto_compact_token_limit = Some(300); config.features.enable(Feature::RemoteCompaction); })