mirror of
https://github.com/openai/codex.git
synced 2026-06-01 19:02:59 +00:00
fix: exec policy loading for sub-agents (#18654)
This commit is contained in:
@@ -111,6 +111,12 @@ pub(crate) fn child_uses_parent_exec_policy(parent_config: &Config, child_config
|
||||
}
|
||||
|
||||
exec_policy_config_folders(parent_config) == exec_policy_config_folders(child_config)
|
||||
&& parent_config
|
||||
.config_layer_stack
|
||||
.ignore_user_and_project_exec_policy_rules()
|
||||
== child_config
|
||||
.config_layer_stack
|
||||
.ignore_user_and_project_exec_policy_rules()
|
||||
&& parent_config.config_layer_stack.requirements().exec_policy
|
||||
== child_config.config_layer_stack.requirements().exec_policy
|
||||
}
|
||||
|
||||
@@ -161,6 +161,22 @@ async fn child_uses_parent_exec_policy_when_non_exec_policy_layers_differ() {
|
||||
assert!(child_uses_parent_exec_policy(&parent_config, &child_config));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn child_does_not_use_parent_exec_policy_when_ignore_rules_differs() {
|
||||
let (_home, parent_config) = test_config().await;
|
||||
let mut child_config = parent_config.clone();
|
||||
child_config.config_layer_stack = child_config
|
||||
.config_layer_stack
|
||||
.with_user_and_project_exec_policy_rules_ignored(
|
||||
/*ignore_user_and_project_exec_policy_rules*/ true,
|
||||
);
|
||||
|
||||
assert!(!child_uses_parent_exec_policy(
|
||||
&parent_config,
|
||||
&child_config
|
||||
));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn child_does_not_use_parent_exec_policy_when_requirements_exec_policy_differs() {
|
||||
let (_home, parent_config) = test_config().await;
|
||||
|
||||
Reference in New Issue
Block a user