MCPcopy Create free account
hub / github.com/Louisym/MiniCC / build_agent_runtime

Function build_agent_runtime

rust/crates/tools/src/lib.rs:1460–1478  ·  view source on GitHub ↗
(
    job: &AgentJob,
)

Source from the content-addressed store, hash-verified

1458}
1459
1460fn build_agent_runtime(
1461 job: &AgentJob,
1462) -> Result<ConversationRuntime<AnthropicRuntimeClient, SubagentToolExecutor>, String> {
1463 let model = job
1464 .manifest
1465 .model
1466 .clone()
1467 .unwrap_or_else(|| DEFAULT_AGENT_MODEL.to_string());
1468 let allowed_tools = job.allowed_tools.clone();
1469 let api_client = AnthropicRuntimeClient::new(model, allowed_tools.clone())?;
1470 let tool_executor = SubagentToolExecutor::new(allowed_tools);
1471 Ok(ConversationRuntime::new(
1472 Session::new(),
1473 api_client,
1474 tool_executor,
1475 agent_permission_policy(),
1476 job.system_prompt.clone(),
1477 ))
1478}
1479
1480fn build_agent_system_prompt(subagent_type: &str) -> Result<Vec<String>, String> {
1481 let cwd = std::env::current_dir().map_err(|error| error.to_string())?;

Callers 1

run_agent_jobFunction · 0.85

Calls 1

agent_permission_policyFunction · 0.85

Tested by

no test coverage detected