MCPcopy Index your code
hub / github.com/AI45Lab/Code / with_config

Method with_config

core/src/subagent.rs:589–602  ·  view source on GitHub ↗

Create a new agent registry with configuration Loads built-in agents first, then loads agents from configured directories.

(config: &CodeConfig)

Source from the content-addressed store, hash-verified

587 ///
588 /// Loads built-in agents first, then loads agents from configured directories.
589 pub fn with_config(config: &CodeConfig) -> Self {
590 let registry = Self::new();
591
592 // Load agents from configured directories
593 for dir in &config.agent_dirs {
594 let agents = load_agents_from_dir(dir);
595 for agent in agents {
596 tracing::info!("Loaded agent '{}' from {}", agent.name, dir.display());
597 registry.register(agent);
598 }
599 }
600
601 registry
602 }
603
604 /// Register an agent definition
605 pub fn register(&self, agent: AgentDefinition) {

Callers

nothing calls this directly

Calls 2

load_agents_from_dirFunction · 0.85
registerMethod · 0.45

Tested by

no test coverage detected