Skip to content

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

style(web_chat): reflow test assertions and imports

Steven Enamakel7652f98d9a8f
diff --git a/crates/openhuman-core/src/web_chat/web_tests_turn_lifecycle_tests.rs b/crates/openhuman-core/src/web_chat/web_tests_turn_lifecycle_tests.rs
index ba72bfbd2b..8da80536e4 100644
--- a/crates/openhuman-core/src/web_chat/web_tests_turn_lifecycle_tests.rs
+++ b/crates/openhuman-core/src/web_chat/web_tests_turn_lifecycle_tests.rs
@@ -163,12 +163,10 @@ async fn a_refused_message_publishes_no_turn_events() {
.await
.expect_err("the guardrail refuses it");
assert!(matches!(error, StartChatError::Guardrail { .. }), "{error}");
- assert!(
- !in_flight_entries_for_test(&DispatchCtx::ambient())
- .await
- .iter()
- .any(|(k, _)| k == "lifecycle-refused")
- );
+ assert!(!in_flight_entries_for_test(&DispatchCtx::ambient())
+ .await
+ .iter()
+ .any(|(k, _)| k == "lifecycle-refused"));
while let Ok(event) = rx.try_recv() {
assert_ne!(
event.context().thread_id,
@@ -185,15 +183,15 @@ async fn a_refused_message_publishes_no_turn_events() {
/// `chat_error` after which the thread is free and no session is cached.
#[tokio::test]
async fn a_turn_with_an_unavailable_local_provider_ends_in_one_classified_chat_error() {
- use crate::core::runtime::{DomainSet, context::CoreContext};
+ use crate::core::runtime::{context::CoreContext, DomainSet};
let _serial = FORCED_ERROR_TEST_LOCK.lock().await;
// Root chat turns need the process's hosted definition catalogue. Other
// tests may initialize it first, so the idempotent `OnceLock` initializer
// is intentionally best-effort here.
let _ = crate::agent::harness::host_definition::AgentDefinitionRegistry::init_global_builtins();
use wiremock::{
- Mock, MockServer, ResponseTemplate,
matchers::{method, path},
+ Mock, MockServer, ResponseTemplate,
};
let server = MockServer::start().await;
@@ -355,16 +353,12 @@ async fn a_turn_with_an_unavailable_local_provider_ends_in_one_classified_chat_e
// The terminal event is the go-ahead for the next message: the thread is
// free, and the failed turn left no cached agent behind.
- assert!(
- !in_flight_entries_for_test(&ctx)
- .await
- .iter()
- .any(|(k, _)| k == thread_id)
- );
- assert!(
- !crate::web_chat::ops::thread_sessions(&ctx)
- .lock()
- .await
- .contains_key(&key_for(&ctx, thread_id))
- );
+ assert!(!in_flight_entries_for_test(&ctx)
+ .await
+ .iter()
+ .any(|(k, _)| k == thread_id));
+ assert!(!crate::web_chat::ops::thread_sessions(&ctx)
+ .lock()
+ .await
+ .contains_key(&key_for(&ctx, thread_id)));
}