Skip to content

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

refactor(subagent_host): collapse direct subagent runner into single native-context entry point

Steven Enamakelc21cd65d16d8
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
index 669f2bd3e0..6b84af9208 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
@@ -101,28 +101,11 @@ pub(super) fn tier_gate_decision(
/// final assistant text. On failure the error is suitable for stringifying
/// into a `tool_result` block — including the two dispatch refusals, whose
/// messages tell the model to summarise rather than delegate again.
-pub(crate) async fn run_subagent_direct(
- definition: &AgentDefinition,
- task_prompt: &str,
- options: SubagentRunOptions,
-) -> Result<SubagentRunOutcome, SubagentRunError> {
- run_subagent_direct_inner(definition, task_prompt, options, None).await
-}
-
pub(crate) async fn run_subagent_direct_with_native_context(
- definition: &AgentDefinition,
- task_prompt: &str,
- options: SubagentRunOptions,
- native: crate::agent::tinyagents::NativeSubagentRunContext,
-) -> Result<SubagentRunOutcome, SubagentRunError> {
- run_subagent_direct_inner(definition, task_prompt, options, Some(native)).await
-}
-
-async fn run_subagent_direct_inner(
definition: &AgentDefinition,
task_prompt: &str,
mut options: SubagentRunOptions,
- native: Option<crate::agent::tinyagents::NativeSubagentRunContext>,
+ native: crate::agent::tinyagents::NativeSubagentRunContext,
) -> Result<SubagentRunOutcome, SubagentRunError> {
// Unconditionally heap-allocate the entire run_subagent body so
// every caller doesn't have to carry this future's state inline.
@@ -850,7 +833,7 @@ async fn run_typed_mode(
// The spawn-wide config snapshot supplies the `[context]`
// knobs the graph used to load for itself.
config.as_ref().ok().map(|c| c.as_ref()),
- native,
+ Some(native),
)
.await?;