From ec3140db1297f3acebec7d6916b329cad3b12693 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 20 Jul 2026 20:02:25 +0000 Subject: [PATCH] Update tests for history and hook API changes (#34403) ## What changed - Assert truncated audio history through `ContextManager::raw_items()`. - Initialize `additional_context_limit` in the quoted Windows hook command test. GitOrigin-RevId: 43c19804e558b7a11fc17590506ec6ec7f3a9897 --- codex-rs/core/src/context_manager/history_tests.rs | 4 ++-- codex-rs/hooks/src/engine/command_runner_tests.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/src/context_manager/history_tests.rs b/codex-rs/core/src/context_manager/history_tests.rs index 027bdee1a7..37d0cda789 100644 --- a/codex-rs/core/src/context_manager/history_tests.rs +++ b/codex-rs/core/src/context_manager/history_tests.rs @@ -2120,8 +2120,8 @@ fn record_items_omits_audio_that_exceeds_the_output_budget() { history.record_items([&item], TruncationPolicy::Tokens(50)); assert_eq!( - history.items, - vec![ResponseItem::FunctionCallOutput { + history.raw_items(), + &[ResponseItem::FunctionCallOutput { id: None, call_id: "call-audio".to_string(), output: FunctionCallOutputPayload { diff --git a/codex-rs/hooks/src/engine/command_runner_tests.rs b/codex-rs/hooks/src/engine/command_runner_tests.rs index ddd26d52b5..a8999d885e 100644 --- a/codex-rs/hooks/src/engine/command_runner_tests.rs +++ b/codex-rs/hooks/src/engine/command_runner_tests.rs @@ -30,6 +30,7 @@ async fn cmd_shell_runs_quoted_hook_command_path() { command: format!(r#""{}" notify"#, hook_path.display()), timeout_sec: 10, status_message: None, + additional_context_limit: Default::default(), source_path, source: HookSource::User, display_order: 0,