Skip to content

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

chore: files changed crates/openhuman-embed/tests/runtime_agents.rs

Steven Enamakelc54827e3ee55
diff --git a/crates/openhuman-embed/tests/runtime_agents.rs b/crates/openhuman-embed/tests/runtime_agents.rs
index 658bb3f91c..402a3adf87 100644
--- a/crates/openhuman-embed/tests/runtime_agents.rs
+++ b/crates/openhuman-embed/tests/runtime_agents.rs
@@ -574,11 +574,14 @@ fn one_runtime_hosts_independently_configured_agents() {
drop(withholding_agent);
drop(gamma);
drop(budget_agent);
- eprintln!("DBGIDS {:?}", runtime.agent_ids());
- assert_eq!(
- runtime.agent_ids(),
- vec!["alpha".to_string(), "beta".to_string()]
- );
+ // The id is released once the dropped agent's deferred MCP cleanup
+ // completes (see `Agent`), so wait for it rather than assuming the
+ // drop is synchronous.
+ common::eventually("dropped agents to release their ids", || {
+ (runtime.agent_ids() == vec!["alpha".to_string(), "beta".to_string()])
+ .then_some(())
+ })
+ .await;
let _gamma_again = runtime
.agent(AgentSpec::new("gamma"))
.expect("id reusable after drop");