Skip to content

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

test(orchestration): assert blocking delegation records job state

Steven Enamakel14a82bce5b4c
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.rs
index 738a8c11bf..ece3c8da56 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
@@ -159,6 +159,28 @@ async fn archetype_delegation_tool_runs_child_agent_e2e() {
"an async delegation that fell back to blocking must disclose that no worker exists: {output}"
);
assert!(provider.saw(ARCHETYPE_DELEGATION_CANARY));
+
+ let parent_context = live
+ .data
+ .parent
+ .as_ref()
+ .expect("test parent context");
+ let owner = crate::agent::tinyagents::tool_registration::subagent_owner_key(
+ &parent_context.session_id,
+ live.thread_id().map(|id| id.as_str()),
+ );
+ let jobs = crate::core::runtime::slot_for::<
+ tinyagents_orchestration::subagent::SubAgentJobRegistry,
+ >(&live.data.dispatch_ctx());
+ let completed = jobs.list_owned(owner);
+ assert!(
+ completed.iter().any(|job| {
+ job.agent == "task_manager_agent"
+ && job.status
+ == tinyagents_orchestration::subagent::SubAgentJobStatus::Completed
+ }),
+ "blocking delegation must register its real target and terminal state in shared Jobs"
+ );
}
#[tokio::test]