The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(agent): cover the per-agent run_workflow guard (#7032)
oxoxDev3844da9a32c3
diff --git a/crates/openhuman-core/src/agent/tools/run_workflow_tests.rs b/crates/openhuman-core/src/agent/tools/run_workflow_tests.rsindex fd7c5892f5..5117fb54a8 100644--- a/crates/openhuman-core/src/agent/tools/run_workflow_tests.rs+++ b/crates/openhuman-core/src/agent/tools/run_workflow_tests.rs@@ -162,3 +162,26 @@ fn account_spawn_trips_the_process_backstop() {let err = last.expect_err("the spawn backstop must trip within 600 accounted spawns");assert!(err.contains("backstop"), "got: {err}");}++#[tokio::test]+async fn each_agent_owns_its_workflow_await_guard() {+ use crate::core::runtime::agent_scope::test_agent_context;+ use crate::core::runtime::{context::CoreContext, DomainSet};+ let root = CoreContext::for_test(DomainSet::full(), None);+ let alpha = test_agent_context(&root, "alpha");+ let beta = test_agent_context(&root, "beta");+ let key = "agent-guard-shared-key".to_string();++ let held = CoreContext::scope(std::sync::Arc::clone(&alpha), async {+ super::guard::acquire_await(key.clone()).expect("alpha acquires")+ })+ .await;++ let beta_result =+ CoreContext::scope(beta, async { super::guard::acquire_await(key.clone()) }).await;+ assert!(beta_result.is_ok(), "beta is not blocked by alpha's await");+ let alpha_again =+ CoreContext::scope(alpha, async { super::guard::acquire_await(key.clone()) }).await;+ assert!(alpha_again.is_err(), "alpha still holds its own key");+ drop(held);+}