Skip to content

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

feat(subagent): add native context variant for direct subagent runs

Steven Enamakelaf66afdbb6bc
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 ba49cd4c1e..adef69fefa 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
@@ -102,9 +102,27 @@ pub(super) fn tier_gate_decision(
/// 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::turn_exec::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::turn_exec::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.
@@ -832,6 +850,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,
)
.await?;