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(embed): remove agents before dropping handles in tests
Steven Enamakel3d901da6b5db
diff --git a/crates/openhuman-embed/tests/attached_tools.rs b/crates/openhuman-embed/tests/attached_tools.rsindex 8a950b1a6c..cfa9344e1d 100644--- a/crates/openhuman-embed/tests/attached_tools.rs+++ b/crates/openhuman-embed/tests/attached_tools.rs@@ -344,8 +344,8 @@ fn attaching_before_first_turn_preserves_and_executes_native_tools() {text.contains("native-wildcard-survived") && !text.contains("unknown tool"))),"the native executor must actually run: {second}");assert!(first["messages"].to_string().contains("ORIGINAL_FRESH_HOST_PROMPT"));- drop(agent);runtime.remove_agent("fresh-attached").await.unwrap();+ drop(agent);}).await.unwrap();});}diff --git a/crates/openhuman-embed/tests/cron_agents.rs b/crates/openhuman-embed/tests/cron_agents.rsindex 498d1517f8..33ae34e1ba 100644--- a/crates/openhuman-embed/tests/cron_agents.rs+++ b/crates/openhuman-embed/tests/cron_agents.rs@@ -215,8 +215,8 @@ fn a_scheduled_job_runs_a_runtime_agent_with_its_host_tool_as_cron() {Err(CronError::NotFound(_))));- drop(agent);runtime.remove_agent("teeny").await.unwrap();+ drop(agent);drop(runtime);}).awaitdiff --git a/crates/openhuman-embed/tests/host_only_tools.rs b/crates/openhuman-embed/tests/host_only_tools.rsindex 54c047b967..5edbbcc77a 100644--- a/crates/openhuman-embed/tests/host_only_tools.rs+++ b/crates/openhuman-embed/tests/host_only_tools.rs@@ -181,8 +181,8 @@ fn host_only_advertises_exactly_the_host_tools_under_a_bare_prompt() {advertised.sort();assert_eq!(advertised, vec!["find_documents", "read_file"]);assert_eq!(system_text(&requests[0]), BARE_PROMPT);- drop(agent);runtime.remove_agent("analyst").await.unwrap();+ drop(agent);}).await.expect("test task");@@ -250,8 +250,8 @@ fn host_only_refuses_builtin_tools_the_model_names() {assert!(results.contains("read_file-host-result"), "{results}");assert!(results.contains("unknown tool `shell`"), "{results}");assert!(results.contains("unknown tool `write_file`"), "{results}");- drop(agent);runtime.remove_agent("refuser").await.unwrap();+ drop(agent);}).await.expect("test task");@@ -290,8 +290,8 @@ fn host_only_forces_read_only_access_and_sandbox() {);assert!(agent.access().turn_origin().is_none());assert!(agent.config().autonomy.trusted_roots.is_empty());- drop(agent);runtime.remove_agent("readonly").await.unwrap();+ drop(agent);}).await.expect("test task");diff --git a/crates/openhuman-embed/tests/structured_turns.rs b/crates/openhuman-embed/tests/structured_turns.rsindex 1dc95aa091..63d1270655 100644--- a/crates/openhuman-embed/tests/structured_turns.rs+++ b/crates/openhuman-embed/tests/structured_turns.rs@@ -194,8 +194,8 @@ fn a_tool_loop_ends_in_a_structured_answer() {assert_eq!(body["response_format"]["type"], "json_schema", "{body}");assert_eq!(body["max_tokens"], 512, "{body}");}- drop(agent);runtime.remove_agent("structured").await.unwrap();+ drop(agent);}).await.expect("test task");@@ -250,11 +250,11 @@ fn successful_turn_preserves_reported_charges_and_invalid_buyer_cost_is_unknown(assert_eq!(usage.cached_input_tokens, 3);assert_eq!(usage.reasoning_tokens, 2);assert_eq!(metered.lock().unwrap().as_ref().unwrap().cost_usd, expected);- drop(agent);runtime.remove_agent(&format!("reported-cost-{index}")).await.unwrap();+ drop(agent);}}).await@@ -320,10 +320,10 @@ fn untrusted_input_passes_the_prompt_guard_only_on_a_host_only_agent() {1,"only the accepted turn reached the provider");- drop(normal);- drop(host_only);runtime.remove_agent("normal").await.unwrap();runtime.remove_agent("untrusted").await.unwrap();+ drop(normal);+ drop(host_only);}).await.expect("test task");@@ -370,8 +370,8 @@ fn terminal_schema_validation_retries_without_accepting_a_wrong_type() {.unwrap();assert_eq!(outcome.structured, Some(json!({"summary":"incomplete"})));assert_eq!(chat_requests(&provider).await.len(), 2);- drop(agent);runtime.remove_agent("strict-repair").await.unwrap();+ drop(agent);}).await.unwrap();@@ -417,8 +417,8 @@ fn a_complete_json_value_with_a_length_finish_is_not_a_valid_answer() {assert_eq!(failure.attempts, 1);assert!(failure.usage.is_some());assert_eq!(chat_requests(&provider).await.len(), 1);- drop(agent);runtime.remove_agent("strict-length").await.unwrap();+ drop(agent);}).await.unwrap();@@ -450,8 +450,8 @@ fn shared_budget_stops_the_tool_loop_before_its_next_provider_call() {assert_eq!(reads.load(Ordering::SeqCst),1);assert_eq!(chat_requests(&provider).await.len(),1);assert_eq!(ledger.snapshot().spent.cost_micros,100);- drop(agent);runtime.remove_agent("budgeted").await.unwrap();+ drop(agent);}).await.unwrap();});}@@ -517,11 +517,11 @@ fn empty_truncated_terminal_answers_use_only_the_explicit_repair_allowance() {chat_requests(&provider).await.len(),usize::from(retries) + 1);- drop(agent);runtime.remove_agent(&format!("empty-truncated-{retries}")).await.unwrap();+ drop(agent);}}).await