fix: detect read only tool when only mode is approve (#1398)

This commit is contained in:
Yingjie He
2025-02-26 16:39:54 -08:00
committed by GitHub
parent 2f6370e3e2
commit 552facb7ef

View File

@@ -238,8 +238,6 @@ impl Agent for TruncateAgent {
break;
}
let read_only_tools = detect_read_only_tools(&capabilities, tool_requests.clone()).await;
// Process tool requests depending on goose_mode
let mut message_tool_response = Message::user();
// Clone goose_mode once before the match to avoid move issues
@@ -247,6 +245,7 @@ impl Agent for TruncateAgent {
match mode.as_str() {
"approve" => {
// Process each tool request sequentially with confirmation
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