Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(agent): resolve agent registry from run context instead of global

Steven Enamakelaf43126892b8
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
index 4cb59ca8c0..8986684a84 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
@@ -366,7 +366,11 @@ impl ContinueSubagentTool {
}
// Look up the agent definition
- let registry = match AgentDefinitionRegistry::current() {
+ let registry = match run_context
+ .dispatch_ctx()
+ .into_core()
+ .and_then(|core| AgentDefinitionRegistry::for_core_context(&core))
+ {
Some(reg) => reg,
None => {
return Ok(ToolResult::error(
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs
index 4487b87b60..f8b8b187c9 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_execute.rs
@@ -48,7 +48,11 @@ impl SpawnAsyncSubagentTool {
)));
}
- let registry = match AgentDefinitionRegistry::current() {
+ let registry = match run_context
+ .dispatch_ctx()
+ .into_core()
+ .and_then(|core| AgentDefinitionRegistry::for_core_context(&core))
+ {
Some(registry) => registry,
None => {
return Ok(ToolResult::error(