diff --git a/api/src/utils/agent/agents/manager_agent.rs b/api/src/utils/agent/agents/manager_agent.rs index 513141055..c01967bcb 100644 --- a/api/src/utils/agent/agents/manager_agent.rs +++ b/api/src/utils/agent/agents/manager_agent.rs @@ -1,7 +1,8 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; +use serde_json::Value; use std::collections::HashMap; -use std::sync::{Arc, RwLock}; +use std::sync::Arc; use tokio::sync::mpsc::Receiver; use uuid::Uuid; @@ -156,18 +157,6 @@ impl ManagerAgent { let mut rx = self.stream_process_thread(thread).await?; - while let Some(message) = rx.recv().await { - let message = message?; - if let AgentMessage::Tool { - id, - content, - tool_call_id, - name, - progress, - } = message - {} - } - Ok(rx) } } diff --git a/api/src/utils/tools/agents_as_tools/dashboard_agent_tool.rs b/api/src/utils/tools/agents_as_tools/dashboard_agent_tool.rs index b60fd67cd..ef24e00b9 100644 --- a/api/src/utils/tools/agents_as_tools/dashboard_agent_tool.rs +++ b/api/src/utils/tools/agents_as_tools/dashboard_agent_tool.rs @@ -78,6 +78,11 @@ impl ToolExecutor for DashboardAgentTool { println!("DashboardAgentTool: Dashboard agent run completed"); println!("DashboardAgentTool: Preparing success response"); + + self.agent + .set_state_value(String::from("files_created"), Value::Bool(false)) + .await; + // Return success with the output Ok(serde_json::json!({ "status": "success", diff --git a/api/src/utils/tools/agents_as_tools/metric_agent_tool.rs b/api/src/utils/tools/agents_as_tools/metric_agent_tool.rs index ca8bee224..943cb111e 100644 --- a/api/src/utils/tools/agents_as_tools/metric_agent_tool.rs +++ b/api/src/utils/tools/agents_as_tools/metric_agent_tool.rs @@ -60,6 +60,10 @@ impl ToolExecutor for MetricAgentTool { // Run the metric agent and get the receiver let _rx = metric_agent.run(&mut current_thread).await?; + self.agent + .set_state_value(String::from("files_created"), Value::Bool(false)) + .await; + // Return immediately with status Ok(serde_json::json!({ "status": "running", diff --git a/api/src/utils/tools/file_tools/search_data_catalog.rs b/api/src/utils/tools/file_tools/search_data_catalog.rs index c1a0631b6..efdbd08db 100644 --- a/api/src/utils/tools/file_tools/search_data_catalog.rs +++ b/api/src/utils/tools/file_tools/search_data_catalog.rs @@ -254,6 +254,10 @@ impl ToolExecutor for SearchDataCatalogTool { format!("Found {} relevant datasets", search_results.len()) }; + self.agent + .set_state_value(String::from("data_context"), Value::Bool(true)) + .await; + let duration = start_time.elapsed().as_millis(); Ok(SearchDataCatalogOutput {