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

Function build_agent_from_config

core/src/agent_api/agent_bootstrap.rs:53–70  ·  view source on GitHub ↗
(config: CodeConfig)

Source from the content-addressed store, hash-verified

51}
52
53pub(super) async fn build_agent_from_config(config: CodeConfig) -> Result<Agent> {
54 config
55 .default_llm_config()
56 .context("default_model must be set in 'provider/model' format with a valid API key")?;
57
58 let mut agent_config = base_agent_config(&config);
59 install_global_skill_registry(&mut agent_config, &config);
60 let (global_mcp, global_mcp_tools) = connect_global_mcp(&config).await;
61
62 Ok(Agent {
63 code_config: config,
64 config: agent_config,
65 global_mcp,
66 global_mcp_tools: std::sync::Mutex::new(global_mcp_tools),
67 sessions: Arc::new(std::sync::Mutex::new(std::collections::HashMap::new())),
68 closed: Arc::new(std::sync::atomic::AtomicBool::new(false)),
69 })
70}
71
72fn expand_home(source: &str) -> String {
73 let Some(rest) = source.strip_prefix("~/") else {

Callers 1

from_configMethod · 0.85

Calls 5

base_agent_configFunction · 0.85
connect_global_mcpFunction · 0.85
contextMethod · 0.80
default_llm_configMethod · 0.80

Tested by

no test coverage detected