Revert "Internal MCP Crate Cleanup (#4800)" (#4883)

This commit is contained in:
Alex Hancock
2025-09-29 14:21:30 -04:00
committed by GitHub
parent 2cfef016e2
commit b9ba8dca29
78 changed files with 1090 additions and 844 deletions
+12 -18
View File
@@ -285,30 +285,24 @@ impl GooseAcpAgent {
// Extract tool name and parameters from the ToolCall if successful
let (tool_name, locations) = match &tool_request.tool_call {
Ok(tool_call) => {
let name = tool_call.name.clone();
// Extract file locations from certain tools for client tracking
let mut locs = Vec::new();
if tool_call.name == "developer__text_editor" {
if name == "developer__text_editor" {
// Try to extract the path from the arguments
if let Some(path_str) = tool_call
.arguments
.as_ref()
.and_then(|args_map| args_map.get("path"))
.and_then(|p| p.as_str())
{
let path = std::path::PathBuf::from(path_str);
if path.exists() && path.is_file() {
locs.push(acp::ToolCallLocation {
path: path_str.into(),
line: Some(1),
meta: None,
});
}
let args = &tool_call.arguments;
if let Some(path_str) = args.get("path").and_then(|p| p.as_str()) {
locs.push(acp::ToolCallLocation {
path: path_str.into(),
line: Some(1),
meta: None,
});
}
}
(tool_call.name.to_string(), locs)
(name, locs)
}
Err(_) => ("error".to_string(), vec![]),
Err(_) => ("unknown".to_string(), Vec::new()),
};
// Send tool call notification
+4 -12
View File
@@ -17,7 +17,6 @@ use goose::conversation::message::Message as GooseMessage;
use axum::response::Redirect;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::{net::SocketAddr, sync::Arc};
use tokio::sync::{Mutex, RwLock};
use tower_http::cors::{Any, CorsLayer};
@@ -460,10 +459,8 @@ async fn process_message_streaming(
serde_json::to_string(
&WebSocketMessage::ToolRequest {
id: req.id.clone(),
tool_name: tool_call.name.to_string(),
arguments: Value::from(
tool_call.arguments.clone(),
),
tool_name: tool_call.name.clone(),
arguments: tool_call.arguments.clone(),
},
)
.unwrap()
@@ -480,13 +477,8 @@ async fn process_message_streaming(
serde_json::to_string(
&WebSocketMessage::ToolConfirmation {
id: confirmation.id.clone(),
tool_name: confirmation
.tool_name
.to_string()
.clone(),
arguments: Value::from(
confirmation.arguments.clone(),
),
tool_name: confirmation.tool_name.clone(),
arguments: confirmation.arguments.clone(),
needs_confirmation: true,
},
)