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
feat(agent-teams): pass worker thread id into member execution context
Steven Enamakel13598289262d
diff --git a/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs b/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rsindex 6db67d2741..3821e41af8 100644--- a/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs+++ b/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime.rs@@ -244,6 +244,10 @@ impl TeamMemberExecutor for HostTeamMemberExecutor {.run_id.as_deref().ok_or_else(|| anyhow!("admitted team member has no run id"))?;+ let worker_thread_id = member+ .worker_thread_id+ .as_deref()+ .ok_or_else(|| anyhow!("admitted team member has no worker thread id"))?;run_member_loop(&self.ctx,&self.config,@@ -252,6 +256,7 @@ impl TeamMemberExecutor for HostTeamMemberExecutor {agent_id,task.clone(),run_id,+ worker_thread_id,self.model_override.clone(),self.parent_override.clone(),)@@ -267,6 +272,7 @@ async fn run_member_loop(agent_id: &str,task: AgentTeamTask,run_id: &str,+ worker_thread_id: &str,model_override: Option<String>,parent_override: Option<ParentExecutionContext>,) -> Result<Vec<String>> {@@ -292,6 +298,7 @@ async fn run_member_loop(agent_id,&task,run_id,+ worker_thread_id,model_override,parent,)@@ -314,6 +321,7 @@ async fn drive_member(agent_id: &str,task: &AgentTeamTask,run_id: &str,+ worker_thread_id: &str,model_override: Option<String>,parent: ParentExecutionContext,) -> Result<Vec<String>> {@@ -338,6 +346,7 @@ async fn drive_member(("memberId".to_string(), member_id.to_string()),("taskId".to_string(), task.id.clone()),("teamRunId".to_string(), run_id.to_string()),+ ("teamWorkerThreadId".to_string(), worker_thread_id.to_string()),].into_iter().collect(),diff --git a/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime_tests.rs b/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime_tests.rsindex e55375117d..7ea3c3c4ec 100644--- a/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/agent_teams/runtime_tests.rs@@ -267,6 +267,7 @@ async fn run_member_loop_drives_member_under_an_explicit_parent() {"task_manager_agent",task,"teamrun-y",+ "teamworker-y",Some("test-model".into()),Some(mock_parent(provider)),)diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions.rs b/crates/openhuman-core/src/agent/orchestration/background_completions.rsindex e531851ace..5bbe232902 100644--- a/crates/openhuman-core/src/agent/orchestration/background_completions.rs+++ b/crates/openhuman-core/src/agent/orchestration/background_completions.rs@@ -134,7 +134,7 @@ pub(super) fn state() -> std::sync::MutexGuard<'static, HostState> {/// The durable completion queue of `workspace_dir` in the storage backend,/// under the calling tenant's scope.-fn open_driver_store(workspace_dir: &Path) -> anyhow::Result<Arc<dyn CompletionStore>> {+pub(super) fn open_driver_store(workspace_dir: &Path) -> anyhow::Result<Arc<dyn CompletionStore>> {let opened = crate::storage::local::open("background_completions", workspace_dir)?;let scoped = opened.scoped()?;let store = DriverCompletionStore::new(Arc::clone(scoped.documents()))@@ -142,7 +142,7 @@ fn open_driver_store(workspace_dir: &Path) -> anyhow::Result<Arc<dyn CompletionSOk(Arc::new(store))}-fn router_pool() -> &'static CompletionRouterPool<RouterScope> {+pub(super) fn router_pool() -> &'static CompletionRouterPool<RouterScope> {static POOL: OnceLock<CompletionRouterPool<RouterScope>> = OnceLock::new();POOL.get_or_init(|| {CompletionRouterPool::new(|scope| {@@ -171,13 +171,13 @@ fn router_pool() -> &'static CompletionRouterPool<RouterScope> {}#[cfg(test)]-fn test_store_overrides() -> &'static Mutex<HashMap<RouterScope, Arc<dyn CompletionStore>>> {+pub(super) fn test_store_overrides() -> &'static Mutex<HashMap<RouterScope, Arc<dyn CompletionStore>>> {static STORES: OnceLock<Mutex<HashMap<RouterScope, Arc<dyn CompletionStore>>>> =OnceLock::new();STORES.get_or_init(|| Mutex::new(HashMap::new()))}-fn entry_for(workspace_dir: &Path) -> Arc<Entry> {+pub(super) fn entry_for(workspace_dir: &Path) -> Arc<Entry> {let scope = router_scope(workspace_dir);let router = match router_pool().get_or_open(&scope) {Ok(router) => router,