Skip to content

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

refactor(spawn_subagent): drop unused tool call options parameter

Steven Enamakel39d2a6adaddd
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.rs
index 0a08d0ccb0..1f3cefc8ba 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
@@ -2,7 +2,6 @@ impl SpawnSubagentTool {
async fn execute_with_context_inner(
&self,
args: serde_json::Value,
- _options: ToolCallOptions,
tool_context: Option<&dyn ToolRunContext>,
run_context: crate::agent::tinyagents::host::OpenHumanRunContext,
detached_parent: Option<
@@ -34,8 +33,7 @@ impl SpawnSubagentTool {
}
};
- // Preserve the actual caller's authority before any filesystem/session
- // effects. A scoped refusal cannot become an accepted/running reference.
+ // Refuse out-of-scope callers before any session or filesystem effects.
if let Err(error) = running_subagents::admit_spawn(&dispatch, &parent.workspace_dir) {
return Ok(ToolResult::error(format!(
"spawn_subagent: registration refused: {error}"
@@ -471,8 +469,7 @@ impl SpawnSubagentTool {
));
}
}
- // Capture the admitted parent generation before worker/session creation.
- // Denied lifecycle admission must leave no phantom child or spawn event.
+ // Capture the admitted generation before creating the worker/session.
let completion_target =
match crate::agent::orchestration::background_completions::CompletionTarget::new(
dispatch.clone(),
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs
index 103f813088..105dfdc043 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_surface.rs
@@ -303,12 +303,11 @@ impl Tool for SpawnSubagentTool {
async fn execute_with_context(
&self,
args: serde_json::Value,
- options: ToolCallOptions,
+ _options: ToolCallOptions,
tool_context: Option<&dyn ToolRunContext>,
) -> anyhow::Result<ToolResult> {
self.execute_with_context_inner(
args,
- options,
tool_context,
crate::agent::tinyagents::host::OpenHumanRunContext::new().with_core(
crate::agent::tinyagents::host::run_context::dispatch_ctx_for_tool(tool_context)
@@ -328,7 +327,7 @@ impl SpawnSubagentTool {
pub(crate) async fn execute_under_parent(
&self,
args: serde_json::Value,
- options: ToolCallOptions,
+ _options: ToolCallOptions,
tool_context: Option<&dyn ToolRunContext>,
parent: crate::agent::subagent_host::ParentExecutionContext,
) -> anyhow::Result<ToolResult> {
@@ -337,7 +336,6 @@ impl SpawnSubagentTool {
crate::agent::subagent_host::detached_subagent_parent(&live_parent, "async-subagent")?;
self.execute_with_context_inner(
args,
- options,
tool_context,
live_parent.data.child(),
Some(&detached_parent),
@@ -357,7 +355,6 @@ impl SpawnSubagentTool {
{
self.execute_with_context_inner(
args,
- ToolCallOptions::default(),
tool_context,
run_context,
Some(detached_parent.borrow()),