refactor: improve code formatting and structure across multiple files

This commit is contained in:
mai1015 2026-02-16 03:35:03 -05:00 committed by Chummy
parent b341fdb368
commit dc5e14d7d2
6 changed files with 24 additions and 16 deletions

View file

@ -74,7 +74,7 @@ pub fn all_tools(
browser_config: &crate::config::BrowserConfig,
http_config: &crate::config::HttpRequestConfig,
workspace_dir: &std::path::Path,
agents: &HashMap<String, DelegateAgentConfig>,
agents: &HashMap<String, DelegateAgentConfig, S>,
fallback_api_key: Option<&str>,
config: &crate::config::Config,
) -> Vec<Box<dyn Tool>> {
@ -104,7 +104,7 @@ pub fn all_tools_with_runtime(
browser_config: &crate::config::BrowserConfig,
http_config: &crate::config::HttpRequestConfig,
workspace_dir: &std::path::Path,
agents: &HashMap<String, DelegateAgentConfig>,
agents: &HashMap<String, DelegateAgentConfig, S>,
fallback_api_key: Option<&str>,
config: &crate::config::Config,
) -> Vec<Box<dyn Tool>> {
@ -170,8 +170,12 @@ pub fn all_tools_with_runtime(
// Add delegation tool when agents are configured
if !agents.is_empty() {
let delegate_agents: HashMap<String, DelegateAgentConfig> = agents
.iter()
.map(|(name, cfg)| (name.clone(), cfg.clone()))
.collect();
tools.push(Box::new(DelegateTool::new(
agents.clone(),
delegate_agents,
fallback_api_key.map(String::from),
)));
}