feat: enable smart approve for user by default (#1599)

This commit is contained in:
Yingjie He
2025-03-10 17:57:31 -07:00
committed by GitHub
parent eb5b296fdc
commit 9447b792ee
6 changed files with 66 additions and 137 deletions
+1 -6
View File
@@ -15,7 +15,6 @@ use super::Agent;
use crate::agents::capabilities::Capabilities;
use crate::agents::extension::{ExtensionConfig, ExtensionResult};
use crate::config::Config;
use crate::config::ExperimentManager;
use crate::memory_condense::condense_messages;
use crate::message::{Message, ToolRequest};
use crate::providers::base::Provider;
@@ -283,11 +282,7 @@ impl Agent for SummarizeAgent {
let mode = goose_mode.clone();
match mode.as_str() {
"approve" => {
let mut read_only_tools = Vec::new();
// Process each tool request sequentially with confirmation
if ExperimentManager::is_enabled("GOOSE_SMART_APPROVE")? {
read_only_tools = detect_read_only_tools(&capabilities, tool_requests.clone()).await;
}
let read_only_tools = detect_read_only_tools(&capabilities, tool_requests.clone()).await;
for request in &tool_requests {
if let Ok(tool_call) = request.tool_call.clone() {
// Skip confirmation if the tool_call.name is in the read_only_tools list
+1 -2
View File
@@ -15,7 +15,6 @@ use crate::agents::capabilities::Capabilities;
use crate::agents::extension::{ExtensionConfig, ExtensionResult};
use crate::agents::ToolPermissionStore;
use crate::config::Config;
use crate::config::ExperimentManager;
use crate::message::{Message, ToolRequest};
use crate::providers::base::Provider;
use crate::providers::base::ProviderUsage;
@@ -299,7 +298,7 @@ impl Agent for TruncateAgent {
}
// Only check read-only status for tools needing confirmation
if !needs_confirmation.is_empty() && ExperimentManager::is_enabled("GOOSE_SMART_APPROVE")? {
if !needs_confirmation.is_empty() {
read_only_tools = detect_read_only_tools(&capabilities, needs_confirmation.clone()).await;
}
+1 -1
View File
@@ -5,7 +5,7 @@ use std::collections::HashMap;
/// It is the ground truth for init experiments. The experiment names in users' experiment list but not
/// in the list will be remove from user list; The experiment names in the ground-truth list but not
/// in users' experiment list will be added to user list with default value false;
const ALL_EXPERIMENTS: &[(&str, bool)] = &[("GOOSE_SMART_APPROVE", true)];
const ALL_EXPERIMENTS: &[(&str, bool)] = &[];
/// Experiment configuration management
pub struct ExperimentManager;