From a4176794dc5d2bbbe7cfaa874541e70ba2224b47 Mon Sep 17 00:00:00 2001 From: Abhinav Vedmala Date: Wed, 6 May 2026 11:03:56 -0700 Subject: [PATCH] Trust hook fixtures in rewrite tests --- codex-rs/core/tests/suite/hooks.rs | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/codex-rs/core/tests/suite/hooks.rs b/codex-rs/core/tests/suite/hooks.rs index 2c5422fc0a..ec16367ba4 100644 --- a/codex-rs/core/tests/suite/hooks.rs +++ b/codex-rs/core/tests/suite/hooks.rs @@ -1645,10 +1645,7 @@ async fn permission_request_hook_rewrites_shell_command_before_execution() -> Re } }) .with_config(|config| { - config - .features - .enable(Feature::CodexHooks) - .expect("test config should allow feature update"); + trust_discovered_hooks(config); }); let test = builder.build(&server).await?; @@ -1816,10 +1813,7 @@ async fn permission_request_hook_rewrites_apply_patch_before_execution() -> Resu }) .with_config(|config| { config.include_apply_patch_tool = true; - config - .features - .enable(Feature::CodexHooks) - .expect("test config should allow feature update"); + trust_discovered_hooks(config); }); let test = builder.build(&server).await?; @@ -2406,10 +2400,7 @@ async fn pre_tool_use_rewrites_shell_command_before_execution() -> Result<()> { } }) .with_config(|config| { - config - .features - .enable(Feature::CodexHooks) - .expect("test config should allow feature update"); + trust_discovered_hooks(config); }); let test = builder.build(&server).await?; @@ -3083,10 +3074,7 @@ async fn pre_tool_use_rewrites_apply_patch_before_execution() -> Result<()> { }) .with_config(|config| { config.include_apply_patch_tool = true; - config - .features - .enable(Feature::CodexHooks) - .expect("test config should allow feature update"); + trust_discovered_hooks(config); }); let test = builder.build(&server).await?;