|
|
@@ -118,7 +118,7 @@ where
|
|
|
tool_executor,
|
|
|
permission_policy,
|
|
|
system_prompt,
|
|
|
- &RuntimeFeatureConfig::default(),
|
|
|
+ RuntimeFeatureConfig::default(),
|
|
|
)
|
|
|
}
|
|
|
|
|
|
@@ -129,7 +129,7 @@ where
|
|
|
tool_executor: T,
|
|
|
permission_policy: PermissionPolicy,
|
|
|
system_prompt: Vec<String>,
|
|
|
- feature_config: &RuntimeFeatureConfig,
|
|
|
+ feature_config: RuntimeFeatureConfig,
|
|
|
) -> Self {
|
|
|
let usage_tracker = UsageTracker::from_session(&session);
|
|
|
Self {
|
|
|
@@ -140,7 +140,7 @@ where
|
|
|
system_prompt,
|
|
|
max_iterations: usize::MAX,
|
|
|
usage_tracker,
|
|
|
- hook_runner: HookRunner::from_feature_config(feature_config),
|
|
|
+ hook_runner: HookRunner::from_feature_config(&feature_config),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -609,7 +609,7 @@ mod tests {
|
|
|
}),
|
|
|
PermissionPolicy::new(PermissionMode::DangerFullAccess),
|
|
|
vec!["system".to_string()],
|
|
|
- &RuntimeFeatureConfig::default().with_hooks(RuntimeHookConfig::new(
|
|
|
+ RuntimeFeatureConfig::default().with_hooks(RuntimeHookConfig::new(
|
|
|
vec![shell_snippet("printf 'blocked by hook'; exit 2")],
|
|
|
Vec::new(),
|
|
|
)),
|
|
|
@@ -675,7 +675,7 @@ mod tests {
|
|
|
StaticToolExecutor::new().register("add", |_input| Ok("4".to_string())),
|
|
|
PermissionPolicy::new(PermissionMode::DangerFullAccess),
|
|
|
vec!["system".to_string()],
|
|
|
- &RuntimeFeatureConfig::default().with_hooks(RuntimeHookConfig::new(
|
|
|
+ RuntimeFeatureConfig::default().with_hooks(RuntimeHookConfig::new(
|
|
|
vec![shell_snippet("printf 'pre hook ran'")],
|
|
|
vec![shell_snippet("printf 'post hook ran'")],
|
|
|
)),
|