Skip to content

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

test(orchestration): add helper to clear driver task owner state

Steven Enamakel08448df1d9ce
diff --git a/crates/openhuman-core/src/agent/orchestration/completion_owners.rs b/crates/openhuman-core/src/agent/orchestration/completion_owners.rs
index f354fccf24..e9d71370c7 100644
--- a/crates/openhuman-core/src/agent/orchestration/completion_owners.rs
+++ b/crates/openhuman-core/src/agent/orchestration/completion_owners.rs
@@ -174,6 +174,19 @@ pub(crate) fn clear_driver_cancel_reason(ctx: &crate::core::runtime::DispatchCtx
.remove(&driver_task_key(ctx, task_id));
}
+#[cfg(test)]
+pub(crate) fn clear_driver_task_owner_for_test(
+ ctx: &crate::core::runtime::DispatchCtx,
+ task_id: &str,
+) {
+ let key = driver_task_key(ctx, task_id);
+ let mut st = owners();
+ st.driver_tasks.remove(&key);
+ st.terminal_driver_tasks.remove(&key);
+ st.terminal_driver_task_order
+ .retain(|existing| existing != &key);
+}
+
/// Return registered task scopes for one exact workspace/thread pair.
pub(crate) fn driver_tasks_for_thread(
ctx: &crate::core::runtime::DispatchCtx,