MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_registry_with_config

Function test_registry_with_config

core/src/subagent.rs:1561–1581  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1559
1560 #[test]
1561 fn test_registry_with_config() {
1562 let temp_dir = tempfile::tempdir().unwrap();
1563
1564 // Create an agent file
1565 std::fs::write(
1566 temp_dir.path().join("custom.yaml"),
1567 r#"
1568name: custom-agent
1569description: Custom agent from config
1570"#,
1571 )
1572 .unwrap();
1573
1574 let config = CodeConfig::new().add_agent_dir(temp_dir.path());
1575 let registry = AgentRegistry::with_config(&config);
1576
1577 // Should have built-in agents plus custom agent
1578 assert!(registry.exists("explore"));
1579 assert!(registry.exists("custom-agent"));
1580 assert_eq!(registry.len(), 6); // 5 built-in + 1 custom
1581 }
1582
1583 #[test]
1584 fn test_agent_definition_with_model() {

Callers

nothing calls this directly

Calls 3

writeFunction · 0.85
pathMethod · 0.80
add_agent_dirMethod · 0.80

Tested by

no test coverage detected