Skip to content

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

feat(embed): add dispatch_admission builder to Turn

Steven Enamakel7932dcee36af
diff --git a/crates/openhuman-embed/src/complete_tests.rs b/crates/openhuman-embed/src/complete_tests.rs
index 976f3b8bb3..119d6bd149 100644
--- a/crates/openhuman-embed/src/complete_tests.rs
+++ b/crates/openhuman-embed/src/complete_tests.rs
@@ -528,9 +528,9 @@ async fn repair_cannot_exceed_dispatch_limit() {
.complete(request)
.await;
- assert!(result.is_err(), "the refused repair must be terminal");
let requests = server.received_requests().await.expect("recording on");
assert_eq!(requests.len(), 1, "a refused repair must not reach the server");
+ assert!(result.is_err(), "the refused repair must be terminal");
}
#[test]
diff --git a/crates/openhuman-embed/src/turn.rs b/crates/openhuman-embed/src/turn.rs
index 3891c5fe70..7385501739 100644
--- a/crates/openhuman-embed/src/turn.rs
+++ b/crates/openhuman-embed/src/turn.rs
@@ -429,6 +429,15 @@ impl Turn {
self
}
+ /// Share a host-owned physical-dispatch policy with this turn and its children.
+ pub fn dispatch_admission(
+ mut self,
+ admission: Arc<dyn crate::budget::PhysicalDispatchAdmission>,
+ ) -> Self {
+ self.dispatch_admission = Some(admission);
+ self
+ }
+
/// Narrow the model-directed delegation depth for this turn tree.
pub(crate) fn with_spawn_depth_limit(mut self, limit: usize) -> Self {
self.spawn_depth_limit = Some(limit);