Skip to content

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

style: apply rustfmt formatting across orchestration and subagent host code

Steven Enamakel2c84f4bb535d
diff --git a/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs b/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
index 2e6ed35784..9d3e3fa61a 100644
--- a/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
@@ -17,8 +17,8 @@ use std::sync::Arc;
use super::*;
use crate::security::{AutonomyLevel, SecurityPolicy, TrustedAccess, TrustedRoot};
use tinyagents_harness::artifacts::{
- extract_artifact_paths, ArtifactKind, ArtifactPathPolicy,
- ARTIFACT_POINTER_PREFIX, DEFAULT_OFFLOAD_THRESHOLD_BYTES,
+ extract_artifact_paths, ArtifactKind, ArtifactPathPolicy, ARTIFACT_POINTER_PREFIX,
+ DEFAULT_OFFLOAD_THRESHOLD_BYTES,
};
/// Policy with disjoint action/workspace roots, the shipped default layout
diff --git a/crates/openhuman-core/src/agent/orchestration/ops.rs b/crates/openhuman-core/src/agent/orchestration/ops.rs
index 8fa3597d0d..550d926cdc 100644
--- a/crates/openhuman-core/src/agent/orchestration/ops.rs
+++ b/crates/openhuman-core/src/agent/orchestration/ops.rs
@@ -25,9 +25,7 @@
use super::types::{
AgentSnapshot, SpawnAgentRequest, SpawnAgentResponse, WaitAgentOptions, WaitAgentResponse,
};
-use crate::agent::harness::fork_context::{
- ParentExecutionContext,
-};
+use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::harness::host_definition::{AgentDefinition, AgentDefinitionRegistry};
use crate::agent::progress::AgentProgress;
use crate::agent::subagent_host::{
diff --git a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
index 184b991f9e..a4701d7794 100644
--- a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
@@ -213,12 +213,15 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {
let first = (async {
session
- .spawn_agent(parent.clone(), SpawnAgentRequest {
- agent_id: "task_manager_agent".to_string(),
- prompt: "Implement RPC wiring for AGENT_ORCH_E2E".to_string(),
- model: Some("test-model".to_string()),
- ..Default::default()
- })
+ .spawn_agent(
+ parent.clone(),
+ SpawnAgentRequest {
+ agent_id: "task_manager_agent".to_string(),
+ prompt: "Implement RPC wiring for AGENT_ORCH_E2E".to_string(),
+ model: Some("test-model".to_string()),
+ ..Default::default()
+ },
+ )
.await
})
.await
@@ -250,14 +253,18 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {
// `follow_up` did internally.
let follow_up = (async {
session
- .spawn_agent(parent.clone(), SpawnAgentRequest {
- agent_id: "task_manager_agent".to_string(),
- prompt: "Continue after the orchestrator answered: ORCH_ANSWER_USE_RPC".to_string(),
- context: Some("Parent answered: use controller registry".to_string()),
- model: Some("test-model".to_string()),
- parent_agent_id: Some(first.orchestration_id.clone()),
- ..Default::default()
- })
+ .spawn_agent(
+ parent.clone(),
+ SpawnAgentRequest {
+ agent_id: "task_manager_agent".to_string(),
+ prompt: "Continue after the orchestrator answered: ORCH_ANSWER_USE_RPC"
+ .to_string(),
+ context: Some("Parent answered: use controller registry".to_string()),
+ model: Some("test-model".to_string()),
+ parent_agent_id: Some(first.orchestration_id.clone()),
+ ..Default::default()
+ },
+ )
.await
})
.await
@@ -303,28 +310,37 @@ async fn e2e_orchestrator_waits_for_multiple_parallel_coding_subagents() {
let spawned = (async {
let alpha = session
- .spawn_agent(parent.clone(), SpawnAgentRequest {
- agent_id: "task_manager_agent".to_string(),
- prompt: "Work independently on PARALLEL_ALPHA".to_string(),
- model: Some("test-model".to_string()),
- ..Default::default()
- })
+ .spawn_agent(
+ parent.clone(),
+ SpawnAgentRequest {
+ agent_id: "task_manager_agent".to_string(),
+ prompt: "Work independently on PARALLEL_ALPHA".to_string(),
+ model: Some("test-model".to_string()),
+ ..Default::default()
+ },
+ )
.await?;
let beta = session
- .spawn_agent(parent.clone(), SpawnAgentRequest {
- agent_id: "task_manager_agent".to_string(),
- prompt: "Work independently on PARALLEL_BETA".to_string(),
- model: Some("test-model".to_string()),
- ..Default::default()
- })
+ .spawn_agent(
+ parent.clone(),
+ SpawnAgentRequest {
+ agent_id: "task_manager_agent".to_string(),
+ prompt: "Work independently on PARALLEL_BETA".to_string(),
+ model: Some("test-model".to_string()),
+ ..Default::default()
+ },
+ )
.await?;
let gamma = session
- .spawn_agent(parent.clone(), SpawnAgentRequest {
- agent_id: "task_manager_agent".to_string(),
- prompt: "Work independently on PARALLEL_GAMMA".to_string(),
- model: Some("test-model".to_string()),
- ..Default::default()
- })
+ .spawn_agent(
+ parent.clone(),
+ SpawnAgentRequest {
+ agent_id: "task_manager_agent".to_string(),
+ prompt: "Work independently on PARALLEL_GAMMA".to_string(),
+ model: Some("test-model".to_string()),
+ ..Default::default()
+ },
+ )
.await?;
Ok::<_, OrchestrationError>(vec![
alpha.orchestration_id,
@@ -427,12 +443,15 @@ async fn e2e_abort_all_cancels_an_in_flight_child_for_a_concurrent_waiter() {
let spawned = (async {
session
- .spawn_agent(parent.clone(), SpawnAgentRequest {
- agent_id: "task_manager_agent".to_string(),
- prompt: "Park until the orchestrator interrupts".to_string(),
- model: Some("test-model".to_string()),
- ..Default::default()
- })
+ .spawn_agent(
+ parent.clone(),
+ SpawnAgentRequest {
+ agent_id: "task_manager_agent".to_string(),
+ prompt: "Park until the orchestrator interrupts".to_string(),
+ model: Some("test-model".to_string()),
+ ..Default::default()
+ },
+ )
.await
})
.await
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rs b/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rs
index b005046cce..c871e012bd 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/archetype_delegation.rs
@@ -136,7 +136,7 @@ pub(crate) async fn execute_archetype_delegation(
tool_context: Option<&dyn ToolRunContext>,
run_context: crate::agent::tinyagents::host::OpenHumanRunContext,
) -> anyhow::Result<ToolResult> {
-execute_archetype_delegation_with_live_parent(
+ execute_archetype_delegation_with_live_parent(
agent_id,
tool_name,
args,
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 187d3d1dd2..fb3fd29a44 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/continue_subagent.rs
@@ -226,7 +226,7 @@ impl Tool for ContinueSubagentTool {
_options: ToolCallOptions,
tool_context: Option<&dyn ToolRunContext>,
) -> anyhow::Result<ToolResult> {
-self.execute_with_parent_context(
+ self.execute_with_parent_context(
args,
tool_context,
crate::agent::tinyagents::host::OpenHumanRunContext::new(),
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
index 2d187efc58..9d0314553a 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
@@ -239,7 +239,7 @@ impl Tool for SpawnAsyncSubagentTool {
options: ToolCallOptions,
tool_context: Option<&dyn ToolRunContext>,
) -> anyhow::Result<ToolResult> {
-self.execute_with_context_inner(
+ self.execute_with_context_inner(
args,
options,
tool_context,
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
index 9103983472..e0dcdd0520 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents.rs
@@ -239,7 +239,7 @@ impl Tool for SpawnParallelAgentsTool {
tool_context: Option<&dyn ToolRunContext>,
) -> anyhow::Result<ToolResult> {
let parent_call_id = crate::tools::host_extensions::tool_call_id(tool_context);
-let workspace_descriptor = tool_context.and_then(|ctx| ctx.workspace().cloned());
+ let workspace_descriptor = tool_context.and_then(|ctx| ctx.workspace().cloned());
execute_spawn_parallel_agents(
args,
tinyagents_harness::CancellationToken::new(),
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
index 6f337c8142..449c958c51 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_policy_tests.rs
@@ -157,13 +157,16 @@ async fn rejects_more_tasks_than_parent_parallel_limit() {
let tool = SpawnParallelAgentsTool::new();
let parent = parent_context(2);
let result = (async {
- tool.execute_under_parent(json!({
- "tasks": [
- { "agent_id": "researcher", "prompt": "one" },
- { "agent_id": "planner", "prompt": "two" },
- { "agent_id": "critic", "prompt": "three" }
- ]
- }), parent.clone())
+ tool.execute_under_parent(
+ json!({
+ "tasks": [
+ { "agent_id": "researcher", "prompt": "one" },
+ { "agent_id": "planner", "prompt": "two" },
+ { "agent_id": "critic", "prompt": "three" }
+ ]
+ }),
+ parent.clone(),
+ )
.await
})
.await
@@ -183,12 +186,15 @@ async fn collects_immediate_task_validation_failures() {
let parent = parent_context(4);
let result = (async {
- tool.execute_under_parent(json!({
- "tasks": [
- { "agent_id": " ", "prompt": "missing agent", "ownership": "files: none" },
- { "agent_id": "__missing_agent__", "prompt": "unknown agent" }
- ]
- }), parent.clone())
+ tool.execute_under_parent(
+ json!({
+ "tasks": [
+ { "agent_id": " ", "prompt": "missing agent", "ownership": "files: none" },
+ { "agent_id": "__missing_agent__", "prompt": "unknown agent" }
+ ]
+ }),
+ parent.clone(),
+ )
.await
})
.await
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs
index 422a93ed2c..932f7c0e3a 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tool_impl.rs
@@ -39,7 +39,7 @@ impl Tool for SpawnSubagentTool {
_options: ToolCallOptions,
tool_context: Option<&dyn ToolRunContext>,
) -> anyhow::Result<ToolResult> {
-self.execute_with_parent_context(
+ self.execute_with_parent_context(
args,
tool_context,
crate::agent::tinyagents::host::OpenHumanRunContext::new(),
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs
index 9ae691c2ca..38ad607322 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread.rs
@@ -145,7 +145,7 @@ impl Tool for SpawnWorkerThreadTool {
_options: ToolCallOptions,
tool_context: Option<&dyn ToolRunContext>,
) -> anyhow::Result<ToolResult> {
-self.execute_with_parent_context(
+ self.execute_with_parent_context(
args,
tool_context,
crate::agent::tinyagents::host::OpenHumanRunContext::new(),
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rs
index 7e6b06ca01..28ba341e9c 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_worker_thread_tests.rs
@@ -119,7 +119,10 @@ async fn rejects_agent_outside_parent_allowlist() {
let temp = TempDir::new().unwrap();
let parent = test_parent_ctx(temp.path().to_path_buf());
- let live = crate::agent::orchestration::tools::live_parent_run_context("worker-allowlist-test", parent);
+ let live = crate::agent::orchestration::tools::live_parent_run_context(
+ "worker-allowlist-test",
+ parent,
+ );
let tool = SpawnWorkerThreadTool::new();
let result = tool
.execute_with_live_parent_context(
diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs
index c07af627d1..4fa9c7bbee 100644
--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs
+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/host.rs
@@ -123,7 +123,9 @@ impl WorkflowExecutor for OpenHumanWorkflowExecutor {
));
}
let parent = self.parent.clone().ok_or_else(|| {
- OrchestrationError("workflow child spawn requires a parent execution context".to_owned())
+ OrchestrationError(
+ "workflow child spawn requires a parent execution context".to_owned(),
+ )
})?;
let response = self
.session
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
index a5d4fea1c0..e53efe2194 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -74,7 +74,11 @@ struct OpenHumanTurnPrelude {
/// Host prompt/utilisation state, shared by the runtime hooks. It is not
/// generic conversation state and the runtime never persists it.
context: Arc<std::sync::Mutex<crate::agent::context::ContextManager>>,
- tool_policy: Arc<dyn tinyagents_harness::middleware::ToolCallPolicy<crate::agent::tinyagents::host::OpenHumanRunContext>>,
+ tool_policy: Arc<
+ dyn tinyagents_harness::middleware::ToolCallPolicy<
+ crate::agent::tinyagents::host::OpenHumanRunContext,
+ >,
+ >,
tool_dispatcher: Arc<dyn tinytools_agent::dialect::ToolDialect>,
workspace_dir: std::path::PathBuf,
action_dir: std::path::PathBuf,
@@ -278,9 +282,7 @@ impl OpenHumanTurnPrelude {
.filter(|spec| !withheld.contains(&spec.name))
.filter(|spec| {
self.thread_id.is_some()
- || !crate::agent::tinyagents::tool_registration::is_thread_goal_tool(
- &spec.name,
- )
+ || !crate::agent::tinyagents::tool_registration::is_thread_goal_tool(&spec.name)
})
.map(|spec| spec.as_ref().clone())
.collect::<Vec<_>>();
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/parent_snapshot.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/parent_snapshot.rs
index 0f761cbee3..018ced1ee0 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/parent_snapshot.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/parent_snapshot.rs
@@ -37,8 +37,7 @@ impl OpenHumanTurnPrelude {
model_name: self.model_name.clone(),
temperature: self.temperature,
workspace_dir: self.workspace_dir.clone(),
- workspace_descriptor: inherited_workspace
- .or_else(|| self.workspace_descriptor.clone()),
+ workspace_descriptor: inherited_workspace.or_else(|| self.workspace_descriptor.clone()),
agent_config: self.config.clone(),
workflows: Arc::new(workflows),
memory_context: Arc::new(memory_context),
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests.rs
index 6d202ee738..9b22c07073 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests.rs
@@ -249,7 +249,10 @@ fn tool_response(name: &str, args: &str) -> ModelResponse {
/// Uses a no-op memory backend so we don't have to spin up a real one.
/// `options` with `parent` bound as the run's explicit parent execution
/// context, the way a spawning tool or orchestration surface supplies it.
-fn with_parent(parent: ParentExecutionContext, mut options: SubagentRunOptions) -> SubagentRunOptions {
+fn with_parent(
+ parent: ParentExecutionContext,
+ mut options: SubagentRunOptions,
+) -> SubagentRunOptions {
options.run_context.parent = Some(parent);
options
}
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs
index 02b3a1d2f1..9c11cb1b7b 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests_model_resolution_tests.rs
@@ -14,7 +14,14 @@ async fn runner_rejects_spawn_beyond_max_depth() {
depth: MAX_SPAWN_DEPTH,
max_depth: MAX_SPAWN_DEPTH,
},
- async { run_subagent(&def, "x", with_parent(parent.clone(), SubagentRunOptions::default())).await },
+ async {
+ run_subagent(
+ &def,
+ "x",
+ with_parent(parent.clone(), SubagentRunOptions::default()),
+ )
+ .await
+ },
)
.await
})
@@ -52,10 +59,13 @@ async fn typed_mode_model_override_pins_exact_model_for_spawn() {
run_subagent(
&def,
"use the pinned model",
- with_parent(parent.clone(), SubagentRunOptions {
- model_override: Some("deepseek/deepseek-r2".into()),
- ..Default::default()
- }),
+ with_parent(
+ parent.clone(),
+ SubagentRunOptions {
+ model_override: Some("deepseek/deepseek-r2".into()),
+ ..Default::default()
+ },
+ ),
)
.await
})
@@ -90,7 +100,12 @@ async fn typed_mode_emits_child_progress_events_when_sink_attached() {
let def = make_def_named_tools(&["file_read"]);
let outcome = (async {
- run_subagent(&def, "read x", with_parent(parent.clone(), SubagentRunOptions::default())).await
+ run_subagent(
+ &def,
+ "read x",
+ with_parent(parent, SubagentRunOptions::default()),
+ )
+ .await
})
.await
.expect("runner should succeed");
@@ -165,7 +180,12 @@ async fn typed_mode_forwards_child_text_and_thinking_deltas() {
let def = make_def_named_tools(&[]);
let outcome = (async {
- run_subagent(&def, "answer me", with_parent(parent.clone(), SubagentRunOptions::default())).await
+ run_subagent(
+ &def,
+ "answer me",
+ with_parent(parent, SubagentRunOptions::default()),
+ )
+ .await
})
.await
.expect("runner should succeed");
@@ -238,7 +258,12 @@ async fn typed_mode_progress_emission_is_a_noop_without_sink() {
assert!(parent.on_progress.is_none());
let def = make_def_named_tools(&[]);
let outcome = (async {
- run_subagent(&def, "x", with_parent(parent.clone(), SubagentRunOptions::default())).await
+ run_subagent(
+ &def,
+ "x",
+ with_parent(parent.clone(), SubagentRunOptions::default()),
+ )
+ .await
})
.await
.expect("runner should succeed");
@@ -552,14 +577,18 @@ fn nested_subagent_dispatch_runs_on_a_constrained_worker_stack() {
PermissionLevel::Execute
}
async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<ToolResult> {
- let parent = self.parent.get().cloned().expect("parent set before the run");
+ let parent = self
+ .parent
+ .get()
+ .cloned()
+ .expect("parent set before the run");
let outcome = run_subagent(
&self.inner_def,
"inner go",
with_parent(parent, SubagentRunOptions::default()),
)
.await
- .map_err(|e| anyhow::anyhow!("nested run_subagent failed: {e}"))?;
+ .map_err(|e| anyhow::anyhow!("nested run_subagent failed: {e}"))?;
Ok(ToolResult::success(outcome.output))
}
}
@@ -597,7 +626,12 @@ fn nested_subagent_dispatch_runs_on_a_constrained_worker_stack() {
let outer_def = make_def_named_tools(&["delegate_inner"]);
(async {
- run_subagent(&outer_def, "outer go", with_parent(parent.clone(), SubagentRunOptions::default())).await
+ run_subagent(
+ &outer_def,
+ "outer go",
+ with_parent(parent.clone(), SubagentRunOptions::default()),
+ )
+ .await
})
.await
});
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs
index 015125988f..c0d47e6681 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests_slug_filter_typed_mode_tests.rs
@@ -164,20 +164,23 @@ async fn typed_mode_returns_text_through_runner() {
run_subagent(
&def,
"summarise X",
- with_parent(parent.clone(), SubagentRunOptions {
- workspace_descriptor: None,
- skill_filter_override: None,
- context: None,
- model_override: None,
- task_id: Some("t1".into()),
- thread_id: None,
- run_context: Default::default(),
- worker_thread_id: None,
- initial_history: None,
- checkpoint_dir: None,
- worktree_action_dir: None,
- run_queue: None,
- }),
+ with_parent(
+ parent.clone(),
+ SubagentRunOptions {
+ workspace_descriptor: None,
+ skill_filter_override: None,
+ context: None,
+ model_override: None,
+ task_id: Some("t1".into()),
+ thread_id: None,
+ run_context: Default::default(),
+ worker_thread_id: None,
+ initial_history: None,
+ checkpoint_dir: None,
+ worktree_action_dir: None,
+ run_queue: None,
+ },
+ ),
)
.await
})
@@ -213,7 +216,12 @@ async fn capped_no_progress_subagent_returns_incomplete_status() {
def.max_iterations = 2;
let outcome = (async {
- run_subagent(&def, "read the file", with_parent(parent.clone(), SubagentRunOptions::default())).await
+ run_subagent(
+ &def,
+ "read the file",
+ with_parent(parent.clone(), SubagentRunOptions::default()),
+ )
+ .await
})
.await
.expect("a cap halt is still Ok (not Err)");
@@ -265,11 +273,14 @@ async fn run_queue_steer_lands_in_subagent_history() {
run_subagent(
&def,
"investigate the bug",
- with_parent(parent.clone(), SubagentRunOptions {
- task_id: Some("t-steer".into()),
- run_queue: Some(run_queue),
- ..Default::default()
- }),
+ with_parent(
+ parent.clone(),
+ SubagentRunOptions {
+ task_id: Some("t-steer".into()),
+ run_queue: Some(run_queue),
+ ..Default::default()
+ },
+ ),
)
.await
})
@@ -383,20 +394,23 @@ async fn typed_mode_filters_tools_by_skill_filter() {
run_subagent(
&def,
"lookup",
- with_parent(parent.clone(), SubagentRunOptions {
- workspace_descriptor: None,
- skill_filter_override: Some("notion".into()),
- context: None,
- model_override: None,
- task_id: None,
- thread_id: None,
- run_context: Default::default(),
- worker_thread_id: None,
- initial_history: None,
- checkpoint_dir: None,
- worktree_action_dir: None,
- run_queue: None,
- }),
+ with_parent(
+ parent.clone(),
+ SubagentRunOptions {
+ workspace_descriptor: None,
+ skill_filter_override: Some("notion".into()),
+ context: None,
+ model_override: None,
+ task_id: None,
+ thread_id: None,
+ run_context: Default::default(),
+ worker_thread_id: None,
+ initial_history: None,
+ checkpoint_dir: None,
+ worktree_action_dir: None,
+ run_queue: None,
+ },
+ ),
)
.await
})
@@ -437,7 +451,12 @@ async fn typed_mode_executes_one_tool_then_returns() {
let def = make_def_named_tools(&["file_read"]);
let outcome = (async {
- run_subagent(&def, "read x", with_parent(parent.clone(), SubagentRunOptions::default())).await
+ run_subagent(
+ &def,
+ "read x",
+ with_parent(parent.clone(), SubagentRunOptions::default()),
+ )
+ .await
})
.await
.expect("runner should succeed");
@@ -473,7 +492,12 @@ async fn typed_mode_blocks_unallowed_tool_calls() {
let def = make_def_named_tools(&["file_read"]);
let outcome = (async {
- run_subagent(&def, "do thing", with_parent(parent.clone(), SubagentRunOptions::default())).await
+ run_subagent(
+ &def,
+ "do thing",
+ with_parent(parent.clone(), SubagentRunOptions::default()),
+ )
+ .await
})
.await
.expect("runner should succeed");
@@ -529,7 +553,12 @@ async fn subagent_emits_checkpoint_at_iteration_cap_instead_of_erroring() {
def.max_iterations = 2;
let outcome = (async {
- run_subagent(&def, "keep reading forever", with_parent(parent.clone(), SubagentRunOptions::default())).await
+ run_subagent(
+ &def,
+ "keep reading forever",
+ with_parent(parent.clone(), SubagentRunOptions::default()),
+ )
+ .await
})
.await
.expect("hitting the iteration cap should return a checkpoint, not error");
@@ -556,7 +585,12 @@ async fn subagent_checkpoint_falls_back_to_deterministic_when_summary_empty() {
def.max_iterations = 2;
let outcome = (async {
- run_subagent(&def, "keep reading forever", with_parent(parent.clone(), SubagentRunOptions::default())).await
+ run_subagent(
+ &def,
+ "keep reading forever",
+ with_parent(parent.clone(), SubagentRunOptions::default()),
+ )
+ .await
})
.await
.expect("empty summary should fall back, not error");
@@ -585,7 +619,14 @@ async fn runner_allows_spawn_at_max_depth() {
depth: MAX_SPAWN_DEPTH - 1,
max_depth: MAX_SPAWN_DEPTH,
},
- async { run_subagent(&def, "x", with_parent(parent.clone(), SubagentRunOptions::default())).await },
+ async {
+ run_subagent(
+ &def,
+ "x",
+ with_parent(parent.clone(), SubagentRunOptions::default()),
+ )
+ .await
+ },
)
.await
})