pub async fn execute(
        &self,
        agent_id: String,
        task: String,
        context: &mut ToolCallContext,
    ) -> anyhow::Result<ToolOutput> {
        context
            .send_text(
                TitleFormat::debug(format!(
                    "{} (Agent)",
                    agent_id.as_str().to_case(Case::UpperSnake)
                ))
                .sub_title(task.as_str()),
            )
            .await?;

        // Create a new conversation for agent execution
        let workflow = self.services.workflow_service().read_merged(None).await?;
        let conversation = self
            .services
            .conversation_service()
            .create(workflow)
            .await?;

        // Execute the request through the ForgeApp
        let app = crate::ForgeApp::new(self.services.clone());
        let mut response_stream = app
            .chat(ChatRequest::new(
                Event::new(format!("{agent_id}/user_task_init"), task),
                conversation.id,
            ))
            .await?;

        // Collect responses from the agent
        while let Some(message) = response_stream.next().await {
            let message = message?;
            match &message {
                ChatResponse::Text { text, is_summary, .. } if *is_summary => {
                    return Ok(ToolOutput::text(text));
                }
                _ => {
                    context.send(message).await?;
                }
            }
        }
        Err(Error::EmptyToolResponse.into())
    }
Executes an agent tool call by creating a new chat request for the
specified agent.
crates/forge_app/src/agent_executor.rs