Skip to content

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

test(orchestration): assert paused job is visible under exact owner scope

Steven Enamakelb621bddd45c9
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_paused_cancel_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_paused_cancel_tests.rs
index 6941271c75..2d79886481 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_paused_cancel_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_paused_cancel_tests.rs
@@ -151,6 +151,38 @@ async fn cancelling_a_paused_driver_settles_once_with_its_reason() {
.is_some(),
"spawn records the owner scope needed by the cancel RPC"
);
+ let owner_scope = crate::agent::orchestration::completion_owners::driver_task_owner(
+ &live.data.dispatch_ctx(),
+ &task_id,
+ )
+ .expect("spawn owner metadata remains available");
+ let registry_owner = crate::agent::tinyagents::tool_registration::subagent_owner_key(
+ &owner_scope.workspace_dir,
+ &owner_scope.parent_session,
+ owner_scope.parent_thread_id.as_deref(),
+ );
+ let registry_scope = tinyagents_orchestration::subagent::ParentJobScope::new(
+ owner_scope.workspace.clone(),
+ owner_scope.parent_thread_id.clone().expect("parent thread"),
+ );
+ let scoped_jobs = jobs
+ .list_for_parent_scope(&registry_owner, &registry_scope)
+ .expect("list exact owner-scoped driver jobs");
+ assert!(
+ scoped_jobs.iter().any(|job| {
+ job.extensions
+ .get("task_id")
+ .and_then(serde_json::Value::as_str)
+ == Some(task_id.as_str())
+ }),
+ "exact owner/workspace/thread scope must include the paused job; owner={registry_owner}, workspace={:?}, thread={:?}, jobs={:?}",
+ owner_scope.workspace,
+ owner_scope.parent_thread_id,
+ scoped_jobs
+ .iter()
+ .map(|job| (&job.id, &job.status, &job.extensions))
+ .collect::<Vec<_>>(),
+ );
assert_eq!(
live.data
.dispatch_ctx()