The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test: add missing test files for orchestration operations
Steven Enamakel04187dc53bfb
diff --git a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/ops_tests.rsindex b76eb2fc18..eefde89445 100644--- a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/ops_tests.rs@@ -78,7 +78,7 @@ fn parent_context(model: Arc<dyn ChatModel<()>>) -> ParentExecutionContext {ParentExecutionContext {workspace_descriptor: None,agent_definition_id: "orchestrator".to_string(),- allowed_subagent_ids: ["researcher".to_string()].into_iter().collect(),+ allowed_subagent_ids: ["task_manager_agent".to_string()].into_iter().collect(),turn_model_source: crate::agent::tinyagents::TurnModelSource::from_model_with_profile(model,ModelProfile {@@ -273,7 +273,7 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {let first = with_parent_context(parent.clone(), async {session.spawn_agent(SpawnAgentRequest {- agent_id: "code_executor".to_string(),+ 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()@@ -283,7 +283,7 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {.await.expect("spawn coding agent");- // These waits spawn a *real* builtin (`code_executor`) sub-agent on the+ // These waits spawn a *real* builtin (`task_manager_agent`) sub-agent on the// detached executor, which builds the full agent (prompt assembly, tool// resolution, registry) before the mock model returns — ~2.7s per child.// The wait budget must clear that with CI headroom; a tight 2s expires first@@ -310,7 +310,7 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {let follow_up = with_parent_context(parent, async {session.spawn_agent(SpawnAgentRequest {- agent_id: "code_executor".to_string(),+ 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()),@@ -363,7 +363,7 @@ async fn e2e_orchestrator_waits_for_multiple_parallel_coding_subagents() {let spawned = with_parent_context(parent, async {let alpha = session.spawn_agent(SpawnAgentRequest {- agent_id: "code_executor".to_string(),+ agent_id: "task_manager_agent".to_string(),prompt: "Work independently on PARALLEL_ALPHA".to_string(),model: Some("test-model".to_string()),..Default::default()@@ -371,7 +371,7 @@ async fn e2e_orchestrator_waits_for_multiple_parallel_coding_subagents() {.await?;let beta = session.spawn_agent(SpawnAgentRequest {- agent_id: "code_executor".to_string(),+ agent_id: "task_manager_agent".to_string(),prompt: "Work independently on PARALLEL_BETA".to_string(),model: Some("test-model".to_string()),..Default::default()@@ -379,7 +379,7 @@ async fn e2e_orchestrator_waits_for_multiple_parallel_coding_subagents() {.await?;let gamma = session.spawn_agent(SpawnAgentRequest {- agent_id: "code_executor".to_string(),+ agent_id: "task_manager_agent".to_string(),prompt: "Work independently on PARALLEL_GAMMA".to_string(),model: Some("test-model".to_string()),..Default::default()@@ -487,7 +487,7 @@ async fn e2e_abort_all_cancels_an_in_flight_child_for_a_concurrent_waiter() {let spawned = with_parent_context(parent, async {session.spawn_agent(SpawnAgentRequest {- agent_id: "code_executor".to_string(),+ agent_id: "task_manager_agent".to_string(),prompt: "Park until the orchestrator interrupts".to_string(),model: Some("test-model".to_string()),..Default::default()diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rsindex 88c61edebc..203df7797a 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent_tests.rs@@ -78,7 +78,7 @@ fn wait_only_fleet_omits_steering_guidance_and_instruction() {let payload = async_subagent_ref_payload("sub-123","subsess-456",- "researcher",+ "task_manager_agent",Some("thread-worker"),false,"created",@@ -99,7 +99,7 @@ fn wait_only_fleet_omits_steering_guidance_and_instruction() {"steer_subagent leaked into the envelope");- let message = format_async_subagent_accepted("researcher", &serialized, &fleet);+ let message = format_async_subagent_accepted("task_manager_agent", &serialized, &fleet);let prose = message.split("[async_subagent_ref]").next().unwrap();assert!(prose.contains("wait for completion"));assert!(@@ -113,7 +113,7 @@ fn async_reference_payload_includes_agent_id_and_control_instructions() {let payload = async_subagent_ref_payload("sub-123","subsess-456",- "researcher",+ "task_manager_agent",Some("thread-worker"),false,"created",@@ -121,8 +121,8 @@ fn async_reference_payload_includes_agent_id_and_control_instructions() {&FleetToolSet::all(),);- assert_eq!(payload["agent_id"], "researcher");- assert_eq!(payload["agentId"], "researcher");+ assert_eq!(payload["agent_id"], "task_manager_agent");+ assert_eq!(payload["agentId"], "task_manager_agent");assert_eq!(payload["instructions"]["wait"]["tool"], "wait_subagent");assert_eq!(payload["instructions"]["timeout_tick"]["arguments"]["timeout_secs"],@@ -147,7 +147,7 @@ fn async_reference_matches_the_orchestrator_fleet_vocabulary() {let payload = async_subagent_ref_payload("sub-123","subsess-456",- "researcher",+ "task_manager_agent",None,false,"created",@@ -196,7 +196,7 @@ fn async_reference_matches_the_orchestrator_fleet_vocabulary() {.iter().any(|a| a.contains("delivered to you automatically")));- let message = format_async_subagent_accepted("researcher", &serialized, &fleet);+ let message = format_async_subagent_accepted("task_manager_agent", &serialized, &fleet);let prose = message.split("[async_subagent_ref]").next().unwrap();assert!(prose.contains("delivered to you automatically"));assert!(!prose.contains("wait for completion"));@@ -343,7 +343,7 @@ fn attach_workflow_proposal_without_proposal_returns_summary_unchanged() {temp.path(),Some("thread-x"),"sub-task-2",- "researcher",+ "task_manager_agent",&[ChatMessage::tool("no proposal here")],"research done".to_string(),);@@ -387,7 +387,7 @@ async fn errors_clearly_when_no_parent_thread_for_delivery() {let result = with_parent_context(parent_context(workspace.path()), async {SpawnAsyncSubagentTool::new().execute(json!({- "agent_id": "researcher",+ "agent_id": "task_manager_agent","prompt": "investigate x",})).await@@ -432,7 +432,7 @@ async fn guard_does_not_fire_when_parent_thread_is_bound() {SpawnAsyncSubagentTool::new().execute_with_context(json!({- "agent_id": "researcher",+ "agent_id": "task_manager_agent","prompt": "investigate x",}),ToolCallOptions::default(),@@ -454,7 +454,7 @@ fn parent_context(workspace_dir: &Path) -> ParentExecutionContext {ParentExecutionContext {workspace_descriptor: None,agent_definition_id: "orchestrator".into(),- allowed_subagent_ids: HashSet::from(["researcher".to_string()]),+ allowed_subagent_ids: HashSet::from(["task_manager_agent".to_string()]),turn_model_source: crate::agent::tinyagents::TurnModelSource::from_model(Arc::new(tinyagents_harness::testkit::ScriptedModel::replies(vec!["done"]),)),diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rsindex 7ea7ac5726..f00f20af1a 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_tests.rs@@ -5,7 +5,7 @@ use tempfile::TempDir;fn sample_outcome(output: &str) -> SubagentRunOutcome {SubagentRunOutcome {- agent_id: "researcher".into(),+ agent_id: "task_manager_agent".into(),task_id: "sub-test-1".into(),output: output.to_string(),elapsed: Duration::from_millis(120),@@ -70,7 +70,7 @@ fn parameters_schema_advertises_optional_model_override() {#[test]fn render_worker_thread_result_carries_machine_readable_envelope() {let outcome = sample_outcome("done");- let rendered = render_worker_thread_result("worker-abc", "researcher", &outcome);+ let rendered = render_worker_thread_result("worker-abc", "task_manager_agent", &outcome);assert!(rendered.contains("Spawned worker thread `worker-abc`"));assert!(rendered.contains("[worker_thread_ref]"));assert!(rendered.contains("[/worker_thread_ref]"));@@ -81,7 +81,7 @@ fn render_worker_thread_result_carries_machine_readable_envelope() {serde_json::from_str(&rendered[start..end]).expect("valid json envelope");assert_eq!(payload["thread_id"], "worker-abc");assert_eq!(payload["label"], "worker");- assert_eq!(payload["agent_id"], "researcher");+ assert_eq!(payload["agent_id"], "task_manager_agent");assert_eq!(payload["task_id"], "sub-test-1");assert_eq!(payload["iterations"], 3);}@@ -92,7 +92,7 @@ fn persist_worker_thread_creates_thread_with_tasks_label_and_messages() {let outcome = sample_outcome("the answer is 42");let thread_id = persist_worker_thread(temp.path(),- "researcher",+ "task_manager_agent","draft a long research plan",&outcome,)@@ -137,7 +137,7 @@ async fn missing_prompt_returns_error() {let tool = SpawnSubagentTool;let result = tool.execute(json!({- "agent_id": "researcher"+ "agent_id": "task_manager_agent"})).await.unwrap();@@ -151,7 +151,7 @@ async fn no_registry_returns_clear_error() {let tool = SpawnSubagentTool;let result = tool.execute(json!({- "agent_id": "researcher",+ "agent_id": "task_manager_agent","prompt": "find x",})).await@@ -178,7 +178,7 @@ async fn unknown_agent_id_lists_available() {assert!(result.is_error);let out = result.output();// Should list at least one valid built-in.- assert!(out.contains("code_executor") || out.contains("researcher"));+ assert!(out.contains("code_executor") || out.contains("task_manager_agent"));}#[test]@@ -196,7 +196,7 @@ async fn dedicated_thread_flag_no_longer_returns_disabled_error() {let tool = SpawnSubagentTool;let result = tool.execute(json!({- "agent_id": "researcher",+ "agent_id": "task_manager_agent","prompt": "find x","dedicated_thread": true,}))@@ -229,7 +229,7 @@ async fn legacy_archetype_alias_is_normalized_to_agent_id() {let tool = SpawnSubagentTool;let result = tool.execute(json!({- "archetype": "researcher",+ "archetype": "task_manager_agent","prompt": "research the reusable async default path",})).await@@ -262,7 +262,7 @@ async fn async_default_self_heals_to_blocking_without_delivery_thread() {let _ = AgentDefinitionRegistry::init_global_builtins();let result = SpawnSubagentTool.execute(json!({- "agent_id": "researcher",+ "agent_id": "task_manager_agent","prompt": "work with no delivery thread",})).awaitdiff --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.rsindex 6683613856..b8acb7a5b8 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@@ -150,7 +150,7 @@ async fn spawn_from_thread(workspace: &std::path::Path, thread_id: &str) -> tiny&(),tinyagents_harness::ids::CallId::new("spawn-worker-thread-test"),json!({- "agent_id": "researcher",+ "agent_id": "task_manager_agent","prompt": "do it","task_title": "Task"}),@@ -171,7 +171,7 @@ async fn rejects_agent_outside_parent_allowlist() {let tool = SpawnWorkerThreadTool::new();let result = tool.execute(json!({- "agent_id": "researcher",+ "agent_id": "task_manager_agent","prompt": "do it","task_title": "Task"}))@@ -180,7 +180,7 @@ async fn rejects_agent_outside_parent_allowlist() {assert!(result.is_error);assert!(result.output().contains(- "spawn_worker_thread: agent 'researcher' is not in parent agent 'orchestrator' subagents.allowlist"+ "spawn_worker_thread: agent 'task_manager_agent' is not in parent agent 'orchestrator' subagents.allowlist"));}).await;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rsindex 3b57800090..c955f8b242 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs@@ -33,7 +33,7 @@ async fn spawn_subagent_tool_runs_child_agent_e2e() {async {SpawnSubagentTool::new().execute(json!({- "agent_id": "researcher",+ "agent_id": "task_manager_agent","prompt": format!("Investigate {SPAWN_SUBAGENT_CANARY}"),"context": "parent supplied context","model": "test-model",@@ -60,8 +60,8 @@ async fn archetype_delegation_tool_runs_child_agent_e2e() {"archetype-delegation-child-answer",)]));let tool = ArchetypeDelegationTool {- tool_name: "delegate_researcher".to_string(),- agent_id: DelegationTarget("researcher".to_string()),+ tool_name: "delegate_task_manager_agent".to_string(),+ agent_id: DelegationTarget("task_manager_agent".to_string()),tool_description: "Delegate research work.".to_string(),};@@ -109,8 +109,8 @@ async fn archetype_delegation_defaults_to_async_with_durable_session_e2e() {"async-delegation-child-answer",)]));let tool = ArchetypeDelegationTool {- tool_name: "delegate_researcher".to_string(),- agent_id: DelegationTarget("researcher".to_string()),+ tool_name: "delegate_task_manager_agent".to_string(),+ agent_id: DelegationTarget("task_manager_agent".to_string()),tool_description: "Delegate research work.".to_string(),};@@ -169,7 +169,7 @@ async fn archetype_delegation_defaults_to_async_with_durable_session_e2e() {tokio::time::sleep(std::time::Duration::from_millis(50)).await;}let session = finished.expect("durable session reached Idle after background completion");- assert_eq!(session.agent_id, "researcher");+ assert_eq!(session.agent_id, "task_manager_agent");assert!(session.latest_history@@ -202,7 +202,7 @@ async fn continue_subagent_resumes_idle_durable_session_e2e() {let _ = env_logger::builder().is_test(true).try_init();let _ = AgentDefinitionRegistry::init_global_builtins();let registry = AgentDefinitionRegistry::global().expect("registry");- let definition = registry.get("researcher").expect("researcher definition");+ let definition = registry.get("task_manager_agent").expect("task_manager_agent definition");let workspace = tempfile::TempDir::new().expect("workspace");let provider = Arc::new(ScriptedModel::new(vec![("continue-durable-canary",@@ -223,7 +223,7 @@ async fn continue_subagent_resumes_idle_durable_session_e2e() {selector: SubagentSessionSelector {parent_session: "tools-e2e-continue-session".into(),parent_thread_id: Some("thread-continue-parent".into()),- agent_id: "researcher".into(),+ agent_id: "task_manager_agent".into(),toolkit: None,// Pin the seeded session to the parent's scripted provider —// continue_subagent forwards session.model into the resume, so@@ -341,7 +341,7 @@ async fn continue_subagent_without_checkpoint_or_durable_session_names_the_rosteContinueSubagentTool::new().execute(json!({"task_id": "sub-does-not-exist",- "agent_id": "researcher",+ "agent_id": "task_manager_agent","message": "hello?"})).await@@ -375,7 +375,7 @@ async fn spawn_worker_thread_tool_persists_worker_thread_e2e() {async {SpawnWorkerThreadTool::new().execute(json!({- "agent_id": "researcher",+ "agent_id": "task_manager_agent","prompt": format!("Handle long task {WORKER_THREAD_CANARY}"),"task_title": "Long delegated task","model": "test-model"@@ -416,7 +416,7 @@ fn parent_context(ParentExecutionContext {workspace_descriptor: None,agent_definition_id: "orchestrator".into(),- allowed_subagent_ids: ["researcher".to_string()]+ allowed_subagent_ids: ["task_manager_agent".to_string()].into_iter().collect(),turn_model_source: crate::agent::tinyagents::TurnModelSource::from_model(model),