diff --git a/src/openhuman/agent/tinyagents/topology.rs b/src/openhuman/agent/tinyagents/topology.rs index b2f6f0c702..e94abd6b34 100644 --- a/src/openhuman/agent/tinyagents/topology.rs +++ b/src/openhuman/agent/tinyagents/topology.rs @@ -70,7 +70,7 @@ pub(crate) fn all_graph_topologies() -> Vec { crate::openhuman::agent::orchestration::spawn_parallel_graph::spawn_parallel_graph_topology( ) { - out.push(describe("spawn_parallel_agents", &t)); + out.push(describe("spawn_parallel_graph", &t)); } // Not exported: generic item-count-driven `map_reduce` fan-outs whose node @@ -103,7 +103,11 @@ mod tests { #[test] fn all_topologies_includes_delegation_and_workflow_scheduler() { let reports = all_graph_topologies(); - for name in ["delegation", "workflow_runs:scheduler"] { + for name in [ + "delegation", + "workflow_runs:scheduler", + "spawn_parallel_graph", + ] { let report = reports .iter() .find(|r| r.name == name) @@ -121,6 +125,54 @@ mod tests { } } + #[test] + fn all_topologies_names_do_not_collide_with_production_tools() { + let tmp = tempfile::tempdir().expect("create tempdir"); + let config = std::sync::Arc::new(crate::openhuman::config::Config::default()); + let security = std::sync::Arc::new(crate::openhuman::security::SecurityPolicy::default()); + let audit = std::sync::Arc::new( + crate::openhuman::security::AuditLogger::new( + crate::openhuman::config::AuditConfig { + enabled: false, + log_path: "audit.log".into(), + max_size_mb: 10, + }, + tmp.path().to_path_buf(), + ) + .expect("create audit logger"), + ); + let browser = crate::openhuman::config::BrowserConfig::default(); + let http = crate::openhuman::config::HttpRequestConfig::default(); + let agents = std::collections::HashMap::new(); + + let tools = crate::openhuman::tools::all_tools( + config.clone(), + &security, + audit, + &browser, + &http, + tmp.path(), + &agents, + &config, + ); + let tool_names: std::collections::HashSet<_> = tools.iter().map(|t| t.name()).collect(); + + // Verify runtime tool `spawn_parallel_agents` is present in the checked tool set + assert!( + tool_names.contains("spawn_parallel_agents"), + "expected spawn_parallel_agents in production all_tools registration" + ); + + let reports = all_graph_topologies(); + for report in &reports { + assert!( + !tool_names.contains(report.name), + "graph name '{}' collides with registered tool of the same name", + report.name + ); + } + } + #[test] fn delegation_topology_names_the_revision_loop_nodes() { let t = super::super::delegation::delegation_graph_topology().expect("builds");