(
job: &AgentJob,
)
| 1458 | } |
| 1459 | |
| 1460 | fn 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 | |
| 1480 | fn build_agent_system_prompt(subagent_type: &str) -> Result<Vec<String>, String> { |
| 1481 | let cwd = std::env::current_dir().map_err(|error| error.to_string())?; |
no test coverage detected