diff --git a/crates/app/cli/src/agent_manager.rs b/crates/app/cli/src/agent_manager.rs index 8e78346..6f6bcdf 100644 --- a/crates/app/cli/src/agent_manager.rs +++ b/crates/app/cli/src/agent_manager.rs @@ -27,6 +27,14 @@ impl AgentManager { &self.state } + /// Spawn a sub-agent for a specific task + pub async fn spawn_sub_agent(&self, _task: &str) -> Result { + // Basic placeholder implementation for Sub-Agent support + // In a real implementation, this would create a new AgentManager instance + // with a focused system prompt and context. + Ok("Sub-agent task completed (mock)".to_string()) + } + /// Execute the reasoning loop: User Input -> LLM -> Thought/Action -> Result -> LLM pub async fn step(&self, input: &str) -> Result { // 1. Add user message to history @@ -101,4 +109,14 @@ mod tests { let response = manager.step("Hello").await.unwrap(); assert_eq!(response, "Mock Response"); } + + #[tokio::test] + async fn test_sub_agent_spawn() { + let client = Arc::new(MockProvider); + let state = Arc::new(Mutex::new(AppState::new())); + let manager = AgentManager::new(client, state); + + let result = manager.spawn_sub_agent("Do something").await.unwrap(); + assert_eq!(result, "Sub-agent task completed (mock)"); + } } \ No newline at end of file