From 14a4911187292aa68e92841b56e29007af728da6 Mon Sep 17 00:00:00 2001 From: kevin zhao Date: Thu, 20 Nov 2025 20:09:30 -0500 Subject: [PATCH] using RW locks --- codex-rs/core/src/exec_policy.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/codex-rs/core/src/exec_policy.rs b/codex-rs/core/src/exec_policy.rs index 4d79016d16..44328de14a 100644 --- a/codex-rs/core/src/exec_policy.rs +++ b/codex-rs/core/src/exec_policy.rs @@ -127,7 +127,6 @@ pub(crate) async fn append_allow_prefix_rule_and_update( .add_prefix_rule(prefix, Decision::Allow)?; Ok(()) - Ok(()) } fn requirement_from_decision( @@ -464,20 +463,6 @@ prefix_rule(pattern=["rm"], decision="forbidden") "hello".to_string(), "world".to_string(), ]); -======= - #[test] - fn append_allow_prefix_rule_updates_policy_and_file() { - let codex_home = tempdir().expect("create temp dir"); - let current_policy = Arc::new(Policy::empty()); - let prefix = vec!["echo".to_string(), "hello".to_string()]; - - let updated_policy = - append_allow_prefix_rule_and_update(codex_home.path(), current_policy, &prefix) - .expect("update policy"); - - let evaluation = - updated_policy.check(&["echo".to_string(), "hello".to_string(), "world".to_string()]); ->>>>>>> 8fb06a9d5 (mutating in memory policy instead of reloading) assert!(matches!( evaluation, Evaluation::Match {