The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(spawn-subagent): extract subagent spawned progress reporting
Steven Enamakela0aadc02a2c6
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_completion.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_completion.rsindex 57a8f5b91c..50a35ccc5f 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_completion.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_completion.rs@@ -7,6 +7,32 @@ use crate::security::turn_origin::AgentTurnOrigin;use std::path::PathBuf;use std::sync::Arc;+pub(super) async fn report_spawned_progress(+ progress_sink: Option<tokio::sync::mpsc::Sender<AgentProgress>>,+ agent_id: String,+ task_id: String,+ prompt: String,+ worker_thread_id: Option<String>,+ display_name: String,+ parent_call_id: Option<String>,+) {+ if let Some(progress) = progress_sink {+ let _ = progress+ .send(AgentProgress::SubagentSpawned {+ agent_id,+ task_id,+ mode: "async".to_string(),+ dedicated_thread: worker_thread_id.is_some(),+ prompt_chars: prompt.chars().count(),+ prompt,+ worker_thread_id,+ display_name: Some(display_name),+ parent_call_id,+ })+ .await;+ }+}+async fn mark_driver_finished(store: &Arc<dyn tinyagents_orchestration::subagent::SubagentSessionStore>,session_id: &str,diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rsindex 04bae0dd2b..a116b3ad7f 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_host_impl.rs@@ -321,21 +321,16 @@ impl SpawnSubagentTool {task_id.to_owned(),follow_up_prompt.chars().count(),);- if let Some(progress) = progress_sink.as_ref() {- let _ = progress- .send(AgentProgress::SubagentSpawned {- agent_id: definition.id.clone(),- task_id: task_id.to_owned(),- mode: "async".to_string(),- dedicated_thread: session.worker_thread_id.is_some(),- prompt_chars: follow_up_prompt.chars().count(),- prompt: follow_up_prompt.clone(),- worker_thread_id: session.worker_thread_id.clone(),- display_name: Some(definition.display_name().to_string()),- parent_call_id: crate::tools::host_extensions::tool_call_id(tool_context),- })- .await;- }+ completion::report_spawned_progress(+ progress_sink.clone(),+ definition.id.clone(),+ task_id.to_owned(),+ follow_up_prompt.clone(),+ session.worker_thread_id.clone(),+ definition.display_name().to_string(),+ crate::tools::host_extensions::tool_call_id(tool_context),+ )+ .await;let completion = completion::make_completion(dispatch.clone().into_core(),@@ -625,21 +620,16 @@ impl SpawnSubagentTool {task_id.clone(),prompt.chars().count(),);- if let Some(ref tx) = progress_sink {- let _ = tx- .send(AgentProgress::SubagentSpawned {- agent_id: definition.id.clone(),- task_id: task_id.clone(),- mode: "async".to_string(),- dedicated_thread: worker_thread_id.is_some(),- prompt_chars: prompt.chars().count(),- prompt: prompt.clone(),- worker_thread_id: worker_thread_id.clone(),- display_name: Some(definition.display_name().to_string()),- parent_call_id: crate::tools::host_extensions::tool_call_id(tool_context),- })- .await;- }+ completion::report_spawned_progress(+ progress_sink.clone(),+ definition.id.clone(),+ task_id.clone(),+ prompt.clone(),+ worker_thread_id.clone(),+ definition.display_name().to_string(),+ crate::tools::host_extensions::tool_call_id(tool_context),+ )+ .await;let background_workspace_dir = parent.workspace_dir.clone();let background_dispatch = dispatch.clone();