Skip to content

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

test(orchestration): add coverage for agent orchestration ops

Steven Enamakel5409d9c47902
diff --git a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs b/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
index 94431c1024..d8dccc31cb 100644
--- a/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/ops_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::agent::harness::fork_context::{with_parent_context, ParentExecutionContext};
+use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::harness::host_definition::AgentDefinitionRegistry;
use crate::config::AgentConfig;
use async_trait::async_trait;
@@ -211,9 +211,9 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {
let parent = parent_context(Arc::new(provider.clone()));
let session = AgentOrchestrationSession::new("orchestrator-session");
- let first = with_parent_context(parent.clone(), async {
+ let first = (async {
session
- .spawn_agent(SpawnAgentRequest {
+ .spawn_agent(parent.clone().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()),
@@ -248,9 +248,9 @@ async fn e2e_orchestrator_answers_coding_agent_question_and_resumes_child() {
// `command_center::control`). The orchestrator now records its answer by
// spawning the linked continuation child directly — the same thing
// `follow_up` did internally.
- let follow_up = with_parent_context(parent, async {
+ let follow_up = (async {
session
- .spawn_agent(SpawnAgentRequest {
+ .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()),
@@ -301,9 +301,9 @@ async fn e2e_orchestrator_waits_for_multiple_parallel_coding_subagents() {
let parent = parent_context(Arc::new(provider.clone()));
let session = AgentOrchestrationSession::new("parallel-orchestrator-session");
- let spawned = with_parent_context(parent, async {
+ let spawned = (async {
let alpha = session
- .spawn_agent(SpawnAgentRequest {
+ .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()),
@@ -311,7 +311,7 @@ async fn e2e_orchestrator_waits_for_multiple_parallel_coding_subagents() {
})
.await?;
let beta = session
- .spawn_agent(SpawnAgentRequest {
+ .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()),
@@ -319,7 +319,7 @@ async fn e2e_orchestrator_waits_for_multiple_parallel_coding_subagents() {
})
.await?;
let gamma = session
- .spawn_agent(SpawnAgentRequest {
+ .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()),
@@ -425,9 +425,9 @@ async fn e2e_abort_all_cancels_an_in_flight_child_for_a_concurrent_waiter() {
let parent = parent_context(Arc::new(BlockingModel));
let session = AgentOrchestrationSession::new("abort-session");
- let spawned = with_parent_context(parent, async {
+ let spawned = (async {
session
- .spawn_agent(SpawnAgentRequest {
+ .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()),