Provider scenario tests (#3688)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-07-28 20:04:11 +02:00
committed by GitHub
parent 4442ccfe4a
commit 73a274d311
33 changed files with 4424 additions and 220 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ const DEFAULT_MAX_TURNS: u32 = 1000;
/// The main goose Agent
pub struct Agent {
pub(super) provider: Mutex<Option<Arc<dyn Provider>>>,
pub(super) extension_manager: Arc<RwLock<ExtensionManager>>,
pub extension_manager: Arc<RwLock<ExtensionManager>>,
pub(super) sub_recipe_manager: Mutex<SubRecipeManager>,
pub(super) tasks_manager: TasksManager,
pub(super) final_output_tool: Arc<Mutex<Option<FinalOutputTool>>>,
+7 -3
View File
@@ -338,12 +338,16 @@ impl ExtensionManager {
.insert(sanitized_name.clone());
}
self.clients
.insert(sanitized_name.clone(), Arc::new(Mutex::new(client)));
self.add_client(sanitized_name, client);
Ok(())
}
pub fn add_client(&mut self, client_name: String, client: Box<dyn McpClientTrait>) {
let sanitized_name = normalize(client_name);
self.clients
.insert(sanitized_name, Arc::new(Mutex::new(client)));
}
/// Get extensions info
pub async fn get_extensions_info(&self) -> Vec<ExtensionInfo> {
self.clients
+1 -3
View File
@@ -34,9 +34,7 @@ async fn toolshim_postprocess(
impl Agent {
/// Prepares tools and system prompt for a provider request
pub(crate) async fn prepare_tools_and_prompt(
&self,
) -> anyhow::Result<(Vec<Tool>, Vec<Tool>, String)> {
pub async fn prepare_tools_and_prompt(&self) -> anyhow::Result<(Vec<Tool>, Vec<Tool>, String)> {
// Get tool selection strategy from config
let config = Config::global();
let router_tool_selection_strategy = config