Skip to content

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

chore: reformat test files to comply with rustfmt

Steven Enamakeld70accacdbc9
diff --git a/crates/openhuman-core/src/agent/artifacts/ops_tests.rs b/crates/openhuman-core/src/agent/artifacts/ops_tests.rs
index d66413c1fd..c6bf751c93 100644
--- a/crates/openhuman-core/src/agent/artifacts/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/artifacts/ops_tests.rs
@@ -320,8 +320,7 @@ struct DefaultFilesDir {
impl DefaultFilesDir {
async fn under(tmp: &TempDir) -> Self {
- let lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let lock = crate::config::TEST_ENV_LOCK.lock().await;
let previous = std::env::var_os("OPENHUMAN_PROJECTS_DIR");
let projects = tmp.path().join("projects");
unsafe {
diff --git a/crates/openhuman-core/src/agent/artifacts/store_tests.rs b/crates/openhuman-core/src/agent/artifacts/store_tests.rs
index f481156d58..c3e84277d0 100644
--- a/crates/openhuman-core/src/agent/artifacts/store_tests.rs
+++ b/crates/openhuman-core/src/agent/artifacts/store_tests.rs
@@ -79,9 +79,7 @@ async fn list_pagination() {
let tmp = TempDir::new().unwrap();
for i in 0..5_u32 {
- let ts = Utc
- .with_ymd_and_hms(2025, 1, i + 1, 0, 0, 0)
- .unwrap();
+ let ts = Utc.with_ymd_and_hms(2025, 1, i + 1, 0, 0, 0).unwrap();
save_artifact_meta(tmp.path(), &make_meta(&format!("id-{i}"), "x", ts))
.await
.unwrap();
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs
index 9696a0d863..9871a316b9 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs
@@ -6,8 +6,7 @@ use tokio::sync::MutexGuard;
/// `threads::ops` purge test (which holds the same lock); a module-local
/// mutex wouldn't prevent that cross-module race.
fn test_guard() -> MutexGuard<'static, ()> {
- crate::config::TEST_ENV_LOCK
- .blocking_lock()
+ crate::config::TEST_ENV_LOCK.blocking_lock()
}
fn c(task: &str, agent: &str, summary: &str) -> CompletedBackgroundAgent {
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
index e9fd6a4b62..3859568bbd 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
@@ -12,9 +12,7 @@ use std::time::Duration;
use tinyagents_graph::orchestration::OrchestrationTaskStatus;
use tinyagents_harness::ids::TaskId;
use tinyagents_harness::run_queue::{QueueLane, RunQueue};
-use tinyagents_harness::steering::{
- SteeringCommand, SteeringHandle,
-};
+use tinyagents_harness::steering::{SteeringCommand, SteeringHandle};
use tinyagents_orchestration::subagent::FinishedOutcome;
use tinyagents_orchestration::subagent::{
DetachedSubagentStatus, WaitError, WaitOutcome, DETACHED_LEDGER_TIMEOUT_MS,
@@ -35,14 +33,12 @@ mod wire_tests;
/// wiping entries a test here is mid-way through.
fn test_guard() -> tokio::sync::MutexGuard<'static, ()> {
// Recover from a poisoned guard so one panicking test doesn't cascade.
- crate::config::TEST_ENV_LOCK
- .blocking_lock()
+ crate::config::TEST_ENV_LOCK.blocking_lock()
}
async fn test_guard_async() -> tokio::sync::MutexGuard<'static, ()> {
// Recover from a poisoned guard so one panicking test doesn't cascade.
- crate::config::TEST_ENV_LOCK
- .lock().await
+ crate::config::TEST_ENV_LOCK.lock().await
}
fn dummy_abort() -> AbortHandle {
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs
index bf1f3242d1..32a8b95b6a 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_control_tests.rs
@@ -27,8 +27,7 @@ fn require_str_rejects_blank_and_missing() {
#[tokio::test]
async fn cancel_unknown_task_is_a_noop_false() {
- let _lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _lock = crate::config::TEST_ENV_LOCK.lock().await;
let mut params = Map::new();
params.insert("taskId".into(), json!("sub-does-not-exist"));
let out = handle_subagent_cancel(params).await.expect("handler ok");
@@ -61,8 +60,7 @@ async fn cancel_of_a_finished_run_reports_its_outcome_and_rewrites_nothing() {
use tinyagents_harness::run_queue::RunQueue;
use tinyagents_orchestration::subagent::DetachedSubagentStatus;
- let _lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("tempdir");
// Snapshot the durable session store before and after: a real cancel
// would `mark_failed` the session and rewrite this file.
@@ -117,8 +115,7 @@ async fn cancel_of_a_finished_run_reports_its_outcome_and_rewrites_nothing() {
#[tokio::test]
async fn steer_unknown_task_is_a_noop_false() {
- let _lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _lock = crate::config::TEST_ENV_LOCK.lock().await;
let mut params = Map::new();
params.insert("taskId".into(), json!("sub-does-not-exist"));
params.insert("message".into(), json!("redirect"));
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
index e75932151a..02f4174e49 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_parallel_agents_tests.rs
@@ -337,48 +337,48 @@ impl ParallelHarnessProvider {
}
let response = if flattened.contains(RESEARCH_PROMPT_CANARY) {
- if flattened.contains("research-step-3-ok") {
- Ok(text_response(RESEARCH_DONE_CANARY))
- } else if flattened.contains("research-step-2-ok") {
- Ok(tool_response(
- "fixture_step",
- json!({ "branch": "research", "step": 3 }),
- ))
- } else if flattened.contains("research-step-1-ok") {
- Ok(tool_response(
- "fixture_step",
- json!({ "branch": "research", "step": 2 }),
- ))
- } else {
- Ok(tool_response(
- "fixture_step",
- json!({ "branch": "research", "step": 1 }),
- ))
- }
- } else if flattened.contains(PLANNER_PROMPT_CANARY) {
- if flattened.contains("planner-step-3-ok") {
- Ok(text_response(PLANNER_DONE_CANARY))
- } else if flattened.contains("planner-step-2-ok") {
- Ok(tool_response(
- "fixture_step",
- json!({ "branch": "planner", "step": 3 }),
- ))
- } else if flattened.contains("planner-step-1-ok") {
- Ok(tool_response(
- "fixture_step",
- json!({ "branch": "planner", "step": 2 }),
- ))
- } else {
- Ok(tool_response(
- "fixture_step",
- json!({ "branch": "planner", "step": 1 }),
- ))
- }
+ if flattened.contains("research-step-3-ok") {
+ Ok(text_response(RESEARCH_DONE_CANARY))
+ } else if flattened.contains("research-step-2-ok") {
+ Ok(tool_response(
+ "fixture_step",
+ json!({ "branch": "research", "step": 3 }),
+ ))
+ } else if flattened.contains("research-step-1-ok") {
+ Ok(tool_response(
+ "fixture_step",
+ json!({ "branch": "research", "step": 2 }),
+ ))
+ } else {
+ Ok(tool_response(
+ "fixture_step",
+ json!({ "branch": "research", "step": 1 }),
+ ))
+ }
+ } else if flattened.contains(PLANNER_PROMPT_CANARY) {
+ if flattened.contains("planner-step-3-ok") {
+ Ok(text_response(PLANNER_DONE_CANARY))
+ } else if flattened.contains("planner-step-2-ok") {
+ Ok(tool_response(
+ "fixture_step",
+ json!({ "branch": "planner", "step": 3 }),
+ ))
+ } else if flattened.contains("planner-step-1-ok") {
+ Ok(tool_response(
+ "fixture_step",
+ json!({ "branch": "planner", "step": 2 }),
+ ))
} else {
- Err(tinyinference_llm::Error::Model(format!(
- "unexpected subagent payload: {flattened}"
- )))
- } ;
+ Ok(tool_response(
+ "fixture_step",
+ json!({ "branch": "planner", "step": 1 }),
+ ))
+ }
+ } else {
+ Err(tinyinference_llm::Error::Model(format!(
+ "unexpected subagent payload: {flattened}"
+ )))
+ };
self.state
.active_subagent_calls
diff --git a/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs b/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs
index 93eaaa86ba..e2684b2ab3 100644
--- a/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/worktree_schemas_tests.rs
@@ -80,8 +80,7 @@ fn list_view_surfaces_managed_worktree() {
/// override is process-global.
#[tokio::test]
async fn handle_list_degrades_for_non_git_action_dir() {
- let _env = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = tempfile::tempdir().unwrap();
let action_dir = tmp.path().join("actions");
std::fs::create_dir_all(&action_dir).unwrap();
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
index 1e8a9f4c49..07384c9e3c 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_attribution_tests.rs
@@ -329,8 +329,12 @@ fn zero_reasoning_turn_leaves_root_without_reasoning_attr() {
]);
c.finish(20);
let turn = find(c.spans(), "agent.turn");
- assert!(!turn.attributes.contains_key("gen_ai.usage.reasoning_tokens"));
- assert!(!turn.attributes.contains_key("gen_ai.usage.cache_creation_tokens"));
+ assert!(!turn
+ .attributes
+ .contains_key("gen_ai.usage.reasoning_tokens"));
+ assert!(!turn
+ .attributes
+ .contains_key("gen_ai.usage.cache_creation_tokens"));
}
// ── run-type classification ─────────────────────────────────────────────────
diff --git a/crates/openhuman-core/src/agent/session_host/typed_transcript_compat_tests.rs b/crates/openhuman-core/src/agent/session_host/typed_transcript_compat_tests.rs
index 545389b954..e7f323fbb6 100644
--- a/crates/openhuman-core/src/agent/session_host/typed_transcript_compat_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/typed_transcript_compat_tests.rs
@@ -307,7 +307,8 @@ fn typed_and_legacy_rows_bridge_to_identical_model_messages() {
AssistantMessage, ContentBlock, ImageRef, Message, ToolMessage, UserMessage,
};
- let messages = [Message::User(UserMessage {
+ let messages = [
+ Message::User(UserMessage {
content: vec![
ContentBlock::Text("see ".into()),
ContentBlock::Image(ImageRef {
@@ -328,7 +329,8 @@ fn typed_and_legacy_rows_bridge_to_identical_model_messages() {
content: vec![ContentBlock::Text("echo:x".into())],
trusted_verbatim: false,
artifact: None,
- })];
+ }),
+ ];
let rows: Vec<_> = messages
.iter()
.filter_map(message_to_native_chat_message)
@@ -366,7 +368,8 @@ fn regenerate_typed_session_compat() {
let legacy = std::fs::read_to_string(fixture(&format!("{name}.jsonl"))).expect("raw");
let tools = legacy
.lines()
- .filter_map(|line| serde_json::from_str::<Value>(line).ok()).rfind(|value| value.get("kind").and_then(Value::as_str) == Some("tools"))
+ .filter_map(|line| serde_json::from_str::<Value>(line).ok())
+ .rfind(|value| value.get("kind").and_then(Value::as_str) == Some("tools"))
.map(|value| value["tools"].clone())
.expect("legacy fixture records its tools");
append_tools_record(&path, &tools).expect("tools record");
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs
index dd61c3b211..f422595f94 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph_failed_run_tests.rs
@@ -109,7 +109,8 @@ async fn failed_subagent_run_keeps_its_unanswered_round_out_of_history() {
let raw = std::fs::read_to_string(&path).expect("raw transcript");
let marker_line = raw
.lines()
- .filter_map(|line| serde_json::from_str::<serde_json::Value>(line).ok()).rfind(|line| line.get("role").and_then(|role| role.as_str()) == Some("assistant"))
+ .filter_map(|line| serde_json::from_str::<serde_json::Value>(line).ok())
+ .rfind(|line| line.get("role").and_then(|role| role.as_str()) == Some("assistant"))
.expect("failure marker line");
assert_eq!(
marker_line.get("iteration").and_then(|n| n.as_u64()),
diff --git a/crates/openhuman-core/src/channels/bus/delivery_tests.rs b/crates/openhuman-core/src/channels/bus/delivery_tests.rs
index ffbd4f8dfe..17f4efc7a6 100644
--- a/crates/openhuman-core/src/channels/bus/delivery_tests.rs
+++ b/crates/openhuman-core/src/channels/bus/delivery_tests.rs
@@ -13,8 +13,7 @@ fn outbound_body_has_stable_idempotency_key() {
#[tokio::test]
async fn sender_methods_report_unavailable_without_a_hosted_session() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("temporary workspace");
let _workspace_env = EnvVarGuard::workspace_unlocked(workspace.path());
let sender = BackendProgressiveSender;
diff --git a/crates/openhuman-core/src/channels/host/channel_events_tests.rs b/crates/openhuman-core/src/channels/host/channel_events_tests.rs
index 57e83495c6..cccf6ec3a6 100644
--- a/crates/openhuman-core/src/channels/host/channel_events_tests.rs
+++ b/crates/openhuman-core/src/channels/host/channel_events_tests.rs
@@ -41,12 +41,7 @@ fn approval_subscriber(channels: &[Arc<RecordingChannel>]) -> ChannelApprovalSur
ChannelApprovalSurfaceSubscriber::new(Arc::new(map))
}
-fn received(
- channel: &str,
- reply_target: &str,
- thread_ts: Option<&str>,
- ws: &Path,
-) -> DomainEvent {
+fn received(channel: &str, reply_target: &str, thread_ts: Option<&str>, ws: &Path) -> DomainEvent {
DomainEvent::ChannelMessageReceived {
channel: channel.into(),
message_id: "m1".into(),
diff --git a/crates/openhuman-core/src/channels/runtime/session_tests.rs b/crates/openhuman-core/src/channels/runtime/session_tests.rs
index ce57938575..593f0c7155 100644
--- a/crates/openhuman-core/src/channels/runtime/session_tests.rs
+++ b/crates/openhuman-core/src/channels/runtime/session_tests.rs
@@ -63,8 +63,7 @@ async fn logout_drops_the_old_runtime_and_aborts_owned_workers() {
async fn clear_session_invalidates_old_channels_and_opens_a_fresh_generation() {
// Logout resolves the signed-out workspace through HOME. Keep the real
// user profile untouched and restore the process environment on panic too.
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
struct RestoreHome(Option<std::ffi::OsString>);
impl Drop for RestoreHome {
fn drop(&mut self) {
diff --git a/crates/openhuman-core/src/config/app_env_tests.rs b/crates/openhuman-core/src/config/app_env_tests.rs
index bafa569287..35f1fde663 100644
--- a/crates/openhuman-core/src/config/app_env_tests.rs
+++ b/crates/openhuman-core/src/config/app_env_tests.rs
@@ -14,8 +14,7 @@ fn app_env_from_env_reads_runtime_var() {
// `.openhuman-staging` process-wide, which breaks any concurrent test
// resolving the root openhuman dir. Hold the crate-wide env lock too,
// in the established order (TEST_ENV_LOCK before the backend lock).
- let _env_guard = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env_guard = crate::config::TEST_ENV_LOCK.blocking_lock();
let _guard = env_test_lock();
let prev = std::env::var(APP_ENV_VAR).ok();
std::env::set_var(APP_ENV_VAR, "staging");
@@ -30,8 +29,7 @@ fn app_env_from_env_reads_runtime_var() {
#[test]
fn app_env_empty_primary_falls_through_to_secondary() {
// Same staging-root hazard as `app_env_from_env_reads_runtime_var`.
- let _env_guard = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env_guard = crate::config::TEST_ENV_LOCK.blocking_lock();
let _guard = env_test_lock();
let prev_p = std::env::var(APP_ENV_VAR).ok();
let prev_s = std::env::var(VITE_APP_ENV_VAR).ok();
diff --git a/crates/openhuman-core/src/config/ops/loader_io_chain_tests.rs b/crates/openhuman-core/src/config/ops/loader_io_chain_tests.rs
index d7f4874ade..b3c57c6c75 100644
--- a/crates/openhuman-core/src/config/ops/loader_io_chain_tests.rs
+++ b/crates/openhuman-core/src/config/ops/loader_io_chain_tests.rs
@@ -95,8 +95,7 @@ async fn load_config_with_timeout_rejects_directory_config() {
let config_path = tmp.path().join("config.toml");
std::fs::create_dir(&config_path).unwrap();
- let _g = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _g = crate::config::TEST_ENV_LOCK.lock().await;
let prev = std::env::var("OPENHUMAN_WORKSPACE").ok();
std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path().to_str().unwrap());
diff --git a/crates/openhuman-core/src/config/schema/load_active_user_and_dirs_tests.rs b/crates/openhuman-core/src/config/schema/load_active_user_and_dirs_tests.rs
index cae31212b0..5c7367be92 100644
--- a/crates/openhuman-core/src/config/schema/load_active_user_and_dirs_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load_active_user_and_dirs_tests.rs
@@ -102,8 +102,7 @@ fn user_openhuman_dir_builds_correct_path() {
async fn resolve_dirs_uses_active_user_when_present() {
// `resolve_runtime_config_dirs` reads `OPENHUMAN_WORKSPACE`; hold the shared
// env lock and clear it so a sibling test's override cannot leak in.
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let prior_workspace = std::env::var_os("OPENHUMAN_WORKSPACE");
std::env::remove_var("OPENHUMAN_WORKSPACE");
let tmp = tempfile::tempdir().unwrap();
@@ -152,8 +151,7 @@ fn default_root_dir_name_uses_staging_suffix_for_staging_env() {
// openhuman dir (e.g. the credentials active-session guard, which silently
// stops finding `active_user.toml` once the root becomes `.openhuman-staging`).
// Take the same lock those tests hold.
- let _env_guard = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env_guard = crate::config::TEST_ENV_LOCK.blocking_lock();
let prior = std::env::var(crate::config::app_env::APP_ENV_VAR).ok();
std::env::set_var(crate::config::app_env::APP_ENV_VAR, "staging");
diff --git a/crates/openhuman-core/src/config/schema/proxy_tests.rs b/crates/openhuman-core/src/config/schema/proxy_tests.rs
index 6253d99d03..5351d8d98b 100644
--- a/crates/openhuman-core/src/config/schema/proxy_tests.rs
+++ b/crates/openhuman-core/src/config/schema/proxy_tests.rs
@@ -422,8 +422,7 @@ fn supported_service_selectors_is_nonempty() {
#[test]
fn apply_and_clear_process_env_follow_the_proxy_scope() {
- let _lock = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _lock = crate::config::TEST_ENV_LOCK.blocking_lock();
let keys = [
"HTTP_PROXY",
"HTTPS_PROXY",
diff --git a/crates/openhuman-core/src/core/all_tests.rs b/crates/openhuman-core/src/core/all_tests.rs
index cb968ca6d0..b6ad4cfaa7 100644
--- a/crates/openhuman-core/src/core/all_tests.rs
+++ b/crates/openhuman-core/src/core/all_tests.rs
@@ -85,9 +85,11 @@ fn validate_registry_rejects_duplicate_required_inputs() {
#[test]
fn validate_registry_accepts_valid_registry() {
- let declared = [schema("ns1", "fn1", vec![]),
+ let declared = [
+ schema("ns1", "fn1", vec![]),
schema("ns1", "fn2", vec![]),
- schema("ns2", "fn1", vec![])];
+ schema("ns2", "fn1", vec![]),
+ ];
let registered = declared
.iter()
.map(|s| RegisteredController {
diff --git a/crates/openhuman-core/src/desktop/notifications/bus_tests_2_tests.rs b/crates/openhuman-core/src/desktop/notifications/bus_tests_2_tests.rs
index 7f05574750..f2ea724fd3 100644
--- a/crates/openhuman-core/src/desktop/notifications/bus_tests_2_tests.rs
+++ b/crates/openhuman-core/src/desktop/notifications/bus_tests_2_tests.rs
@@ -438,8 +438,7 @@ async fn the_active_workspace_s_outage_is_announced() {
// after it, so scope exit destroys the guard first and the env var is
// cleared while this lock is still held. Releasing the lock early would
// let the next test set its own override and have this guard erase it.
- let _lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _lock = crate::config::TEST_ENV_LOCK.lock().await;
let active = tempfile::TempDir::new().unwrap();
let _guard = EnvVarGuard::workspace_unlocked(active.path());
@@ -465,8 +464,7 @@ async fn a_switched_away_workspace_s_outage_is_not_announced() {
// after it, so scope exit destroys the guard first and the env var is
// cleared while this lock is still held. Releasing the lock early would
// let the next test set its own override and have this guard erase it.
- let _lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _lock = crate::config::TEST_ENV_LOCK.lock().await;
let active = tempfile::TempDir::new().unwrap();
let switched_away = tempfile::TempDir::new().unwrap();
let _guard = EnvVarGuard::workspace_unlocked(active.path());
diff --git a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
index ec331d927b..f904ab8be0 100644
--- a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
@@ -9,8 +9,7 @@ fn enforce_local_only_inference_errors_on_external_when_local_only() {
// same lock before mutating the process-global live policy so parallel
// cloud-model construction cannot observe this temporary LocalOnly mode.
let _inference = crate::inference::inference_test_guard();
- let _env = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env = crate::config::TEST_ENV_LOCK.blocking_lock();
use crate::config::PrivacyMode;
use crate::security::SecurityPolicy;
let ws = std::env::temp_dir().join("openhuman_factory_privacy_test");
diff --git a/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs b/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs
index fa37f9ea69..4cb907b7ce 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs
@@ -138,8 +138,7 @@ async fn an_off_profile_still_discloses_a_registered_summary() {
/// module happens to be installed for other tests in this binary.
#[tokio::test]
async fn a_module_disabled_in_configuration_discloses_a_wanted_summary() {
- let _lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _lock = crate::config::TEST_ENV_LOCK.lock().await;
let previous = std::env::var_os("TINYJUICE_TEST_MODULE");
// SAFETY: serialized by TEST_ENV_LOCK; restored below for every exit path.
unsafe { std::env::remove_var("TINYJUICE_TEST_MODULE") };
diff --git a/crates/openhuman-core/src/integrations/composio/client/network_tests.rs b/crates/openhuman-core/src/integrations/composio/client/network_tests.rs
index 3407b0edfc..97fbd05eaf 100644
--- a/crates/openhuman-core/src/integrations/composio/client/network_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/client/network_tests.rs
@@ -9,8 +9,7 @@ const HTTPS_BASE: &str = "https://backend.composio.dev/api/v3";
/// Run `body` with a runtime proxy config installed, then restore the old one.
fn with_proxy<T>(config: ProxyConfig, body: impl FnOnce() -> T) -> T {
- let _lock = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _lock = crate::config::TEST_ENV_LOCK.blocking_lock();
let previous = runtime_proxy_config();
set_runtime_proxy_config(config);
let result = body();
diff --git a/crates/openhuman-core/src/integrations/composio/client_tests.rs b/crates/openhuman-core/src/integrations/composio/client_tests.rs
index f7784cbd50..0b3865d831 100644
--- a/crates/openhuman-core/src/integrations/composio/client_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/client_tests.rs
@@ -538,8 +538,7 @@ async fn direct_reads_go_through_the_hosts_runtime_proxy() {
use crate::config::{runtime_proxy_config, set_runtime_proxy_config};
let _module = module_guard().await;
- let _env = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = tempfile::tempdir().unwrap();
let config = module_test_config(&tmp);
let (proxy, proxied) = connect_proxy();
diff --git a/crates/openhuman-core/src/integrations/composio/connected_integrations.rs b/crates/openhuman-core/src/integrations/composio/connected_integrations.rs
index 66de21ba33..8617290e13 100644
--- a/crates/openhuman-core/src/integrations/composio/connected_integrations.rs
+++ b/crates/openhuman-core/src/integrations/composio/connected_integrations.rs
@@ -15,13 +15,13 @@ mod connectable_slug_tests;
#[path = "connected_integrations_catalog_description_tests_tests.rs"]
mod catalog_description_tests;
-#[cfg(test)]
-pub(crate) use cache::{composio_cache_test_lock, composio_cache_test_lock_async};
pub(crate) use cache::sync_cache_with_connections;
pub use cache::{
cached_active_integrations, cached_active_integrations_including_expired, connected_set_hash,
invalidate_connected_integrations_cache,
};
+#[cfg(test)]
+pub(crate) use cache::{composio_cache_test_lock, composio_cache_test_lock_async};
pub use fetch::{
fetch_connected_integrations, fetch_connected_integrations_status,
FetchConnectedIntegrationsStatus,
diff --git a/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs b/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs
index c1c6b2155e..c9ef1d1d59 100644
--- a/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs
@@ -260,7 +260,8 @@ async fn authorize_in_direct_mode_refuses_with_app_composio_dev_hint() {
// Also hold the composio cache lock so we don't race against ops_tests
// that mutate INTEGRATIONS_CACHE at the same time as we reload config.
let _cache_guard =
- crate::integrations::composio::connected_integrations::composio_cache_test_lock_async().await;
+ crate::integrations::composio::connected_integrations::composio_cache_test_lock_async()
+ .await;
let _env_guard = TEST_ENV_LOCK.lock().await;
let tmp = tempfile::tempdir().expect("tempdir");
diff --git a/crates/openhuman-core/src/mcp/audit/schemas_tests.rs b/crates/openhuman-core/src/mcp/audit/schemas_tests.rs
index deef8554d8..78b32e81e4 100644
--- a/crates/openhuman-core/src/mcp/audit/schemas_tests.rs
+++ b/crates/openhuman-core/src/mcp/audit/schemas_tests.rs
@@ -23,8 +23,7 @@ fn domain_schema_exports_match_internal_controller() {
#[tokio::test]
async fn handle_list_returns_persisted_audit_records() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = tempfile::tempdir().expect("tempdir");
unsafe {
std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path());
diff --git a/crates/openhuman-core/src/mcp/server/tools_tests_tag_and_dispatch_tests.rs b/crates/openhuman-core/src/mcp/server/tools_tests_tag_and_dispatch_tests.rs
index e575433d70..d35c6db3bc 100644
--- a/crates/openhuman-core/src/mcp/server/tools_tests_tag_and_dispatch_tests.rs
+++ b/crates/openhuman-core/src/mcp/server/tools_tests_tag_and_dispatch_tests.rs
@@ -164,8 +164,7 @@ fn tree_tag_accepts_max_size_tags() {
#[tokio::test]
async fn call_tool_records_write_argument_rejection() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = tempfile::tempdir().expect("tempdir");
unsafe {
std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path());
diff --git a/crates/openhuman-core/src/memory/ops/files_tests.rs b/crates/openhuman-core/src/memory/ops/files_tests.rs
index 14b464dc3e..8151b46a15 100644
--- a/crates/openhuman-core/src/memory/ops/files_tests.rs
+++ b/crates/openhuman-core/src/memory/ops/files_tests.rs
@@ -6,8 +6,7 @@ use crate::config::TEST_ENV_LOCK;
#[tokio::test]
async fn write_read_and_list_memory_files_roundtrip() {
- let _guard = TEST_ENV_LOCK
- .lock().await;
+ let _guard = TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().expect("tempdir");
let _workspace = EnvVarGuard::workspace_unlocked(tmp.path());
@@ -60,8 +59,7 @@ async fn write_read_and_list_memory_files_roundtrip() {
#[tokio::test]
async fn list_memory_files_skips_internal_sqlite_artifacts() {
- let _guard = TEST_ENV_LOCK
- .lock().await;
+ let _guard = TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().expect("tempdir");
let _workspace = EnvVarGuard::workspace_unlocked(tmp.path());
@@ -93,8 +91,7 @@ async fn list_memory_files_skips_internal_sqlite_artifacts() {
#[tokio::test]
async fn list_memory_files_rejects_non_directory_target() {
- let _guard = TEST_ENV_LOCK
- .lock().await;
+ let _guard = TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().expect("tempdir");
let _workspace = EnvVarGuard::workspace_unlocked(tmp.path());
@@ -118,8 +115,7 @@ async fn list_memory_files_rejects_non_directory_target() {
#[tokio::test]
async fn read_and_write_memory_files_reject_path_traversal() {
- let _guard = TEST_ENV_LOCK
- .lock().await;
+ let _guard = TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().expect("tempdir");
let _workspace = EnvVarGuard::workspace_unlocked(tmp.path());
@@ -141,8 +137,7 @@ async fn read_and_write_memory_files_reject_path_traversal() {
#[tokio::test]
async fn list_and_read_memory_files_reject_absolute_paths() {
- let _guard = TEST_ENV_LOCK
- .lock().await;
+ let _guard = TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().expect("tempdir");
let _workspace = EnvVarGuard::workspace_unlocked(tmp.path());
@@ -171,8 +166,7 @@ async fn list_and_read_memory_files_reject_absolute_paths() {
#[tokio::test]
async fn read_memory_file_surfaces_missing_file_error() {
- let _guard = TEST_ENV_LOCK
- .lock().await;
+ let _guard = TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().expect("tempdir");
let _workspace = EnvVarGuard::workspace_unlocked(tmp.path());
@@ -189,8 +183,7 @@ async fn read_memory_file_surfaces_missing_file_error() {
#[tokio::test]
async fn read_memory_file_surfaces_invalid_utf8_error() {
- let _guard = TEST_ENV_LOCK
- .lock().await;
+ let _guard = TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().expect("tempdir");
let _workspace = EnvVarGuard::workspace_unlocked(tmp.path());
@@ -214,8 +207,7 @@ async fn read_memory_file_surfaces_invalid_utf8_error() {
async fn write_memory_file_rejects_symlink_targets() {
use std::os::unix::fs::symlink;
- let _guard = TEST_ENV_LOCK
- .lock().await;
+ let _guard = TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().expect("tempdir");
let _workspace = EnvVarGuard::workspace_unlocked(tmp.path());
@@ -242,8 +234,7 @@ async fn write_memory_file_rejects_symlink_targets() {
async fn list_memory_files_skips_symlink_entries() {
use std::os::unix::fs::symlink;
- let _guard = TEST_ENV_LOCK
- .lock().await;
+ let _guard = TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().expect("tempdir");
let _workspace = EnvVarGuard::workspace_unlocked(tmp.path());
diff --git a/crates/openhuman-core/src/memory/ops/sync_tests.rs b/crates/openhuman-core/src/memory/ops/sync_tests.rs
index ba6bfd4761..c5065f2034 100644
--- a/crates/openhuman-core/src/memory/ops/sync_tests.rs
+++ b/crates/openhuman-core/src/memory/ops/sync_tests.rs
@@ -95,8 +95,7 @@ fn sync_result_structs_serialize_expected_fields() {
#[tokio::test]
async fn memory_sync_channel_publishes_targeted_event() {
let _serial = crate::memory::ops::GLOBAL_MEMORY_TEST_LOCK.lock().await;
- let _guard = test_mutex()
- .lock().await;
+ let _guard = test_mutex().lock().await;
let _ = crate::core::bus::init().await;
let (tx, mut rx) = mpsc::unbounded_channel();
let _subscription = BUS
@@ -121,8 +120,7 @@ async fn memory_sync_channel_publishes_targeted_event() {
#[tokio::test]
async fn memory_sync_all_publishes_broadcast_event() {
let _serial = crate::memory::ops::GLOBAL_MEMORY_TEST_LOCK.lock().await;
- let _guard = test_mutex()
- .lock().await;
+ let _guard = test_mutex().lock().await;
let _ = crate::core::bus::init().await;
let (tx, mut rx) = mpsc::unbounded_channel();
let _subscription = BUS
diff --git a/crates/openhuman-core/src/memory/sync_events_bridge_tests.rs b/crates/openhuman-core/src/memory/sync_events_bridge_tests.rs
index f6cd139395..6e3044ae9b 100644
--- a/crates/openhuman-core/src/memory/sync_events_bridge_tests.rs
+++ b/crates/openhuman-core/src/memory/sync_events_bridge_tests.rs
@@ -32,8 +32,7 @@ impl EventHandler<DomainEvent> for StageCollector {
#[tokio::test]
async fn document_canonicalized_emits_stored_and_queued_stages() {
- let _guard = test_mutex()
- .lock().await;
+ let _guard = test_mutex().lock().await;
crate::core::bus::init().await.expect("bus init");
// The bridge emits through `tinymemory_api::events`' sink, and these tests
// used to get it installed as a side effect of the memory host seams. Those
@@ -76,8 +75,7 @@ async fn document_canonicalized_emits_stored_and_queued_stages() {
#[tokio::test]
async fn memory_ingestion_started_emits_ingesting_stage() {
- let _guard = test_mutex()
- .lock().await;
+ let _guard = test_mutex().lock().await;
crate::core::bus::init().await.expect("bus init");
// The bridge emits through `tinymemory_api::events`' sink, and these tests
// used to get it installed as a side effect of the memory host seams. Those
@@ -160,8 +158,7 @@ fn extract_mem_src_id_returns_the_source_segment_of_mem_src_ids() {
#[tokio::test]
async fn bridge_populates_source_id_for_stored_and_queued_from_mem_src() {
- let _guard = test_mutex()
- .lock().await;
+ let _guard = test_mutex().lock().await;
crate::core::bus::init().await.expect("bus init");
// The bridge emits through `tinymemory_api::events`' sink, and these tests
// used to get it installed as a side effect of the memory host seams. Those
@@ -213,8 +210,7 @@ async fn bridge_populates_source_id_for_stored_and_queued_from_mem_src() {
#[tokio::test]
async fn bridge_source_id_is_none_for_non_mem_src_canonicalized() {
- let _guard = test_mutex()
- .lock().await;
+ let _guard = test_mutex().lock().await;
crate::core::bus::init().await.expect("bus init");
// The bridge emits through `tinymemory_api::events`' sink, and these tests
// used to get it installed as a side effect of the memory host seams. Those
@@ -265,8 +261,7 @@ async fn bridge_source_id_is_none_for_non_mem_src_canonicalized() {
#[tokio::test]
async fn bridge_populates_source_id_for_ingesting_from_mem_src() {
- let _guard = test_mutex()
- .lock().await;
+ let _guard = test_mutex().lock().await;
crate::core::bus::init().await.expect("bus init");
// The bridge emits through `tinymemory_api::events`' sink, and these tests
// used to get it installed as a side effect of the memory host seams. Those
@@ -323,8 +318,7 @@ async fn bridge_populates_source_id_for_ingesting_from_mem_src() {
#[tokio::test]
async fn bridge_source_id_is_none_for_ingesting_non_mem_src() {
- let _guard = test_mutex()
- .lock().await;
+ let _guard = test_mutex().lock().await;
crate::core::bus::init().await.expect("bus init");
// The bridge emits through `tinymemory_api::events`' sink, and these tests
// used to get it installed as a side effect of the memory host seams. Those
diff --git a/crates/openhuman-core/src/modules/connectors_tests.rs b/crates/openhuman-core/src/modules/connectors_tests.rs
index 925181b875..eb809972b2 100644
--- a/crates/openhuman-core/src/modules/connectors_tests.rs
+++ b/crates/openhuman-core/src/modules/connectors_tests.rs
@@ -94,8 +94,7 @@ fn direct_mode_hands_the_module_the_hosts_proxy_policy() {
use crate::config::schema::{ProxyConfig, ProxyScope};
use crate::config::{runtime_proxy_config, set_runtime_proxy_config};
- let _env = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env = crate::config::TEST_ENV_LOCK.blocking_lock();
let mut config = bare_config();
config.composio.mode = COMPOSIO_MODE_DIRECT.to_string();
config.composio.api_key = Some("sk-from-file".to_string());
diff --git a/crates/openhuman-core/src/platform/socket/manager_tests.rs b/crates/openhuman-core/src/platform/socket/manager_tests.rs
index 3cda8d4632..c60a133d5a 100644
--- a/crates/openhuman-core/src/platform/socket/manager_tests.rs
+++ b/crates/openhuman-core/src/platform/socket/manager_tests.rs
@@ -255,7 +255,9 @@ async fn emit_cannot_send_past_a_concurrent_teardown_drain() {
let teardown_gate = Arc::clone(&gate);
let teardown = std::thread::spawn(move || {
let mut teardown_guard = teardown_gate.lock();
- locked_tx.send(()).expect("test task is waiting for the lock");
+ locked_tx
+ .send(())
+ .expect("test task is waiting for the lock");
release_rx
.recv()
.expect("test task releases teardown after the pending-while-locked check");
diff --git a/crates/openhuman-core/src/sandbox/docker_exec_tests.rs b/crates/openhuman-core/src/sandbox/docker_exec_tests.rs
index 0266f82ad4..f127214f04 100644
--- a/crates/openhuman-core/src/sandbox/docker_exec_tests.rs
+++ b/crates/openhuman-core/src/sandbox/docker_exec_tests.rs
@@ -38,8 +38,7 @@ fn recorded(out: &Path) -> Vec<String> {
/// Run `f` with `bin` first on `PATH`, serialised against other env tests.
fn with_fake_path<T>(bin: &Path, f: impl FnOnce() -> T) -> T {
- let _guard = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _guard = crate::config::TEST_ENV_LOCK.blocking_lock();
let prev = std::env::var_os("PATH");
let mut paths = vec![bin.to_path_buf()];
if let Some(p) = &prev {
@@ -261,8 +260,7 @@ fn missing_docker_binary_is_an_execution_error() {
let ws = tmp.path().join("ws");
std::fs::create_dir_all(&ws).unwrap();
// Replace PATH wholesale so no `docker` can be found.
- let _guard = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _guard = crate::config::TEST_ENV_LOCK.blocking_lock();
let prev = std::env::var_os("PATH");
std::env::set_var("PATH", tmp.path());
let err = block_on(docker_exec(
diff --git a/crates/openhuman-core/src/security/approval/gate_core_flow_tests.rs b/crates/openhuman-core/src/security/approval/gate_core_flow_tests.rs
index 616ebe345b..60f232d3a0 100644
--- a/crates/openhuman-core/src/security/approval/gate_core_flow_tests.rs
+++ b/crates/openhuman-core/src/security/approval/gate_core_flow_tests.rs
@@ -171,8 +171,7 @@ async fn auto_approve_tool_skips_prompt() {
// live policy. Serialize with the other tests that install/reload it
// (the `live_policy` module test + the autonomy `ops` tests, which all
// take this same lock) so a parallel install can't clobber ours mid-test.
- let _env = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env = crate::config::TEST_ENV_LOCK.lock().await;
let (gate, dir) = test_gate();
// A tool name unique to this test so leaving it in the global allowlist
@@ -212,8 +211,7 @@ async fn auto_approve_tool_skips_prompt() {
/// is never consulted, proving the short-circuit fires above the park.
#[tokio::test]
async fn auto_approve_all_resolves_allow() {
- let _env = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env = crate::config::TEST_ENV_LOCK.lock().await;
let (gate, dir) = test_gate();
let policy = crate::security::SecurityPolicy {
auto_approve_all: true,
@@ -246,8 +244,7 @@ async fn auto_approve_all_resolves_allow() {
/// until a decision is sent on the oneshot.
#[tokio::test]
async fn auto_approve_all_off_still_parks() {
- let _env = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env = crate::config::TEST_ENV_LOCK.lock().await;
let (gate, dir) = test_gate();
let policy = crate::security::SecurityPolicy {
auto_approve_all: false,
@@ -298,8 +295,7 @@ async fn auto_approve_all_off_still_parks() {
/// gate still fails closed for unlabelled call sites.
#[tokio::test]
async fn auto_approve_all_does_not_override_unknown() {
- let _env = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env = crate::config::TEST_ENV_LOCK.lock().await;
let (gate, dir) = test_gate();
let policy = crate::security::SecurityPolicy {
auto_approve_all: true,
@@ -336,8 +332,7 @@ async fn auto_approve_all_does_not_override_unknown() {
/// a park, but the blanket bypass sits above that check too.
#[tokio::test]
async fn auto_approve_all_overrides_require_approval_workflow() {
- let _env = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env = crate::config::TEST_ENV_LOCK.lock().await;
let (gate, dir) = test_gate();
let policy = crate::security::SecurityPolicy {
auto_approve_all: true,
@@ -391,8 +386,7 @@ async fn auto_approve_all_overrides_require_approval_workflow() {
async fn auto_approve_all_allows_a_remote_triage_dispatch_without_an_audit_row() {
use crate::agent::triage::{remote_trigger_origin, TriggerEnvelope};
- let _env = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env = crate::config::TEST_ENV_LOCK.lock().await;
let (gate, dir) = test_gate();
let policy = crate::security::SecurityPolicy {
auto_approve_all: true,
diff --git a/crates/openhuman-core/src/security/approval/gate_ttl_and_triage_tests.rs b/crates/openhuman-core/src/security/approval/gate_ttl_and_triage_tests.rs
index 14c3e9f9ae..ef10226c19 100644
--- a/crates/openhuman-core/src/security/approval/gate_ttl_and_triage_tests.rs
+++ b/crates/openhuman-core/src/security/approval/gate_ttl_and_triage_tests.rs
@@ -266,8 +266,7 @@ async fn intercept_audited_bounded_abandons_park_and_leaves_row_pending() {
#[cfg(debug_assertions)]
#[test]
fn effective_ttl_uses_env_override_when_valid() {
- let _env = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env = crate::config::TEST_ENV_LOCK.blocking_lock();
let (gate, _dir) = test_gate_with_ttl(BOOT_TTL_UNDER_TEST);
unsafe { std::env::set_var("OPENHUMAN_APPROVAL_TTL_SECS", "42") };
assert_eq!(
@@ -280,8 +279,7 @@ fn effective_ttl_uses_env_override_when_valid() {
#[test]
fn effective_ttl_falls_back_to_boot_ttl_for_garbage_value() {
- let _env = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env = crate::config::TEST_ENV_LOCK.blocking_lock();
let (gate, _dir) = test_gate_with_ttl(BOOT_TTL_UNDER_TEST);
unsafe { std::env::set_var("OPENHUMAN_APPROVAL_TTL_SECS", "not-a-number") };
assert_eq!(
@@ -294,8 +292,7 @@ fn effective_ttl_falls_back_to_boot_ttl_for_garbage_value() {
#[test]
fn effective_ttl_falls_back_to_boot_ttl_when_unset() {
- let _env = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env = crate::config::TEST_ENV_LOCK.blocking_lock();
let (gate, _dir) = test_gate_with_ttl(BOOT_TTL_UNDER_TEST);
unsafe { std::env::remove_var("OPENHUMAN_APPROVAL_TTL_SECS") };
assert_eq!(
diff --git a/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_bearer_token_tests.rs b/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_bearer_token_tests.rs
index 10c2d96a77..fcc4ead507 100644
--- a/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_bearer_token_tests.rs
+++ b/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_bearer_token_tests.rs
@@ -100,8 +100,7 @@ fn lookup_openai_bearer_token_returns_ok_when_nearly_expiring_and_refresh_fails(
#[tokio::test(flavor = "multi_thread")]
async fn lookup_openai_bearer_token_does_not_persist_blank_refreshed_access_token() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = tempdir().unwrap();
let config = test_config(&tmp);
let store = AuthProfilesStore::new(tmp.path(), false);
diff --git a/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_lifecycle_tests.rs b/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_lifecycle_tests.rs
index 2d703f3dc1..9e5bcb9c68 100644
--- a/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_lifecycle_tests.rs
+++ b/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_lifecycle_tests.rs
@@ -440,8 +440,7 @@ fn codex_import_user_state_errors_classify_as_expected() {
/// RPC surfaces the actionable error.
#[tokio::test]
async fn inference_import_codex_cli_surfaces_error_when_auth_missing() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = tempdir().unwrap();
let config = test_config(&tmp);
let _env_guard = EnvVarGuard::set("CODEX_HOME", tmp.path());
diff --git a/crates/openhuman-core/src/security/credentials/ops/boot_env_tests.rs b/crates/openhuman-core/src/security/credentials/ops/boot_env_tests.rs
index 723b440eef..fe6be4830e 100644
--- a/crates/openhuman-core/src/security/credentials/ops/boot_env_tests.rs
+++ b/crates/openhuman-core/src/security/credentials/ops/boot_env_tests.rs
@@ -14,8 +14,7 @@ fn config_in(tmp: &TempDir) -> Config {
#[test]
fn api_key_env_seeds_only_an_empty_store() {
- let _lock = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _lock = crate::config::TEST_ENV_LOCK.blocking_lock();
let tmp = TempDir::new().unwrap();
let config = config_in(&tmp);
let _guard = EnvVarGuard::unset(BACKEND_API_KEY_ENV);
@@ -45,8 +44,7 @@ fn api_key_env_seeds_only_an_empty_store() {
#[tokio::test]
async fn session_env_is_ignored_without_a_subject_and_when_unset() {
- let _lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _lock = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
let config = config_in(&tmp);
let _guard = EnvVarGuard::unset(BACKEND_SESSION_TOKEN_ENV);
diff --git a/crates/openhuman-core/src/security/credentials/ops_credential_tests.rs b/crates/openhuman-core/src/security/credentials/ops_credential_tests.rs
index 21584678e2..6082b66bc0 100644
--- a/crates/openhuman-core/src/security/credentials/ops_credential_tests.rs
+++ b/crates/openhuman-core/src/security/credentials/ops_credential_tests.rs
@@ -114,8 +114,7 @@ async fn set_credential_requires_a_user_id_for_a_session() {
#[tokio::test]
async fn set_credential_installs_a_session_without_touching_the_backend() {
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
std::fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
@@ -163,8 +162,7 @@ async fn set_credential_installs_a_session_without_touching_the_backend() {
#[tokio::test]
async fn set_credential_derives_the_user_id_from_the_jwt_subject() {
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
std::fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
@@ -189,8 +187,7 @@ async fn set_credential_derives_the_user_id_from_the_jwt_subject() {
#[tokio::test]
async fn set_credential_with_the_same_token_and_user_is_a_cheap_refresh() {
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
std::fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
@@ -233,8 +230,7 @@ async fn set_credential_with_the_same_token_and_user_is_a_cheap_refresh() {
#[tokio::test]
async fn set_credential_for_a_different_user_signs_the_previous_one_out_first() {
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
std::fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
@@ -315,8 +311,7 @@ async fn set_and_clear_api_key_credential() {
// directory the key was stored beside.
#[tokio::test]
async fn clearing_the_session_preserves_a_coexisting_api_key() {
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
std::fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
@@ -389,8 +384,7 @@ async fn clearing_the_session_preserves_a_coexisting_api_key() {
// let an unrelated leftover key silently become the effective one.
#[tokio::test]
async fn clearing_the_session_preserves_the_active_key_over_a_stale_destination_key() {
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
std::fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
@@ -466,8 +460,7 @@ async fn clearing_the_session_preserves_the_active_key_over_a_stale_destination_
// location and leave it clearable/resurrectable later.
#[tokio::test]
async fn clearing_without_a_kind_removes_a_user_scoped_api_key_at_its_source() {
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
std::fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
@@ -519,8 +512,7 @@ async fn clearing_without_a_kind_removes_a_user_scoped_api_key_at_its_source() {
#[tokio::test]
async fn clear_credential_without_a_kind_removes_everything() {
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
std::fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
@@ -554,8 +546,7 @@ async fn clear_credential_without_a_kind_removes_everything() {
/// user from an API response.
#[tokio::test]
async fn store_session_local_token_rejects_missing_user_payload() {
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
std::fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
@@ -576,8 +567,7 @@ async fn store_session_local_token_rejects_missing_user_payload() {
/// summary.
#[tokio::test]
async fn store_session_local_token_succeeds_without_network_and_forces_local_user_id() {
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
std::fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
diff --git a/crates/openhuman-core/src/security/credentials/ops_provider_oauth_tests.rs b/crates/openhuman-core/src/security/credentials/ops_provider_oauth_tests.rs
index bed8588e13..b6aa3ddccf 100644
--- a/crates/openhuman-core/src/security/credentials/ops_provider_oauth_tests.rs
+++ b/crates/openhuman-core/src/security/credentials/ops_provider_oauth_tests.rs
@@ -10,8 +10,7 @@ async fn clear_session_on_empty_store_reports_removed_false() {
// lock) it deletes whichever concurrently-running test currently owns HOME —
// e.g. `deferred_session_without_user_id_does_not_replace_active_user_profile`,
// whose active-session guard then silently stops firing.
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
let _home = EnvVarGuard::set("HOME", tmp.path());
let config = test_config(&tmp);
@@ -369,8 +368,7 @@ async fn credentials_stored_under_one_workspace_dir_invisible_to_another() {
async fn clear_session_on_one_account_does_not_affect_another() {
// See `clear_session_on_empty_store_reports_removed_false`: `clear_session`
// reaches the HOME-derived root, so this test must own HOME while it runs.
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp_a = TempDir::new().unwrap();
let tmp_b = TempDir::new().unwrap();
let _home = EnvVarGuard::set("HOME", tmp_a.path());
@@ -483,8 +481,7 @@ async fn start_login_gated_services_completes_with_all_services_disabled() {
// concurrently-running `store_session` test that would then start real
// background services. (These are the same semantics `TEST_ENV_LOCK` gives
// the HOME-mutating tests.)
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_guard = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = TempDir::new().unwrap();
// Under `#[cfg(test)]` `start_login_gated_services` skips the real services
// by default (they leak across the parallel test run); opt this one test
diff --git a/crates/openhuman-core/src/security/live_policy_tests.rs b/crates/openhuman-core/src/security/live_policy_tests.rs
index 3a26d14ace..b4cb45fd81 100644
--- a/crates/openhuman-core/src/security/live_policy_tests.rs
+++ b/crates/openhuman-core/src/security/live_policy_tests.rs
@@ -4,8 +4,7 @@ use crate::security::AutonomyLevel;
#[test]
fn scoped_policy_is_thread_local_and_restored() {
- let _env = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env = crate::config::TEST_ENV_LOCK.blocking_lock();
let workspace = std::env::temp_dir().join("openhuman_scoped_policy_test");
install(
Arc::new(SecurityPolicy::default()),
@@ -45,8 +44,7 @@ fn install_then_reload_swaps_policy_and_bumps_generation() {
// Serialize against other tests that install/reload this process-global
// (the approval-gate auto_approve test and the autonomy `ops` tests),
// which all take this same lock — otherwise a parallel install races.
- let _env = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env = crate::config::TEST_ENV_LOCK.blocking_lock();
let workspace = std::env::temp_dir().join("openhuman_live_policy_test");
let initial = Arc::new(SecurityPolicy {
autonomy: AutonomyLevel::Supervised,
@@ -79,8 +77,7 @@ fn install_then_reload_swaps_policy_and_bumps_generation() {
#[test]
fn reload_privacy_swaps_mode_and_survives_autonomy_reload() {
// Same process-global lock as the other live-policy tests.
- let _env = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env = crate::config::TEST_ENV_LOCK.blocking_lock();
let workspace = std::env::temp_dir().join("openhuman_privacy_live_test");
let initial = Arc::new(SecurityPolicy {
autonomy: AutonomyLevel::Supervised,
@@ -132,8 +129,7 @@ fn reload_privacy_swaps_mode_and_survives_autonomy_reload() {
fn set_action_dir_swaps_root_and_bumps_generation() {
// Same process-global lock as the reload test — these install/swap the
// shared live policy and would race each other otherwise.
- let _env = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env = crate::config::TEST_ENV_LOCK.blocking_lock();
let workspace = std::env::temp_dir().join("openhuman_set_action_dir_test_ws");
let action = std::env::temp_dir().join("openhuman_set_action_dir_test_action_a");
let initial = Arc::new(SecurityPolicy {
diff --git a/crates/openhuman-core/src/security/ops_tests.rs b/crates/openhuman-core/src/security/ops_tests.rs
index b40ed98f52..a96b4fc88c 100644
--- a/crates/openhuman-core/src/security/ops_tests.rs
+++ b/crates/openhuman-core/src/security/ops_tests.rs
@@ -78,8 +78,7 @@ fn security_policy_info_reflects_configured_action_budget() {
async fn load_and_get_security_policy_info_reflects_env_overlay() {
// Serialize against every other test that mutates process env —
// load_tests.rs uses the same lock so we cannot race with it.
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
for budget in [42_u32, 0_u32] {
// Point the loader at a throwaway workspace so the test does not
diff --git a/crates/openhuman-core/src/skills/catalog/ops_tests.rs b/crates/openhuman-core/src/skills/catalog/ops_tests.rs
index e5d54cff1d..f0bf36cc13 100644
--- a/crates/openhuman-core/src/skills/catalog/ops_tests.rs
+++ b/crates/openhuman-core/src/skills/catalog/ops_tests.rs
@@ -68,13 +68,11 @@ use std::sync::Arc;
const CACHE_DIR_ENV: &str = "OPENHUMAN_SKILL_REGISTRY_CACHE_DIR";
fn env_lock() -> tokio::sync::MutexGuard<'static, ()> {
- crate::skills::catalog::TEST_ENV_LOCK
- .blocking_lock()
+ crate::skills::catalog::TEST_ENV_LOCK.blocking_lock()
}
async fn env_lock_async() -> tokio::sync::MutexGuard<'static, ()> {
- crate::skills::catalog::TEST_ENV_LOCK
- .lock().await
+ crate::skills::catalog::TEST_ENV_LOCK.lock().await
}
fn sample_entry() -> CatalogEntry {
diff --git a/crates/openhuman-core/src/skills/catalog/tools_tests.rs b/crates/openhuman-core/src/skills/catalog/tools_tests.rs
index aa2b17e7f1..9d2b39f742 100644
--- a/crates/openhuman-core/src/skills/catalog/tools_tests.rs
+++ b/crates/openhuman-core/src/skills/catalog/tools_tests.rs
@@ -31,8 +31,7 @@ async fn search_page(args: serde_json::Value) -> serde_json::Value {
#[tokio::test]
async fn search_tool_returns_a_bounded_page_and_where_the_next_one_starts() {
// #6286: a broad query used to return every match in one result.
- let _env = crate::skills::catalog::TEST_ENV_LOCK
- .lock().await;
+ let _env = crate::skills::catalog::TEST_ENV_LOCK.lock().await;
let tmp = tempfile::tempdir().unwrap();
std::env::set_var("OPENHUMAN_SKILL_REGISTRY_CACHE_DIR", tmp.path());
let catalog: Vec<_> = (0..45)
diff --git a/crates/openhuman-core/src/skills/run_log_tests.rs b/crates/openhuman-core/src/skills/run_log_tests.rs
index 73f77f87cb..ea6a74d58c 100644
--- a/crates/openhuman-core/src/skills/run_log_tests.rs
+++ b/crates/openhuman-core/src/skills/run_log_tests.rs
@@ -19,16 +19,22 @@ fn detect_repeated_line_catches_real_failure_modes() {
// The exact text shapes we observed in run adcd2dfd (×23) and
// dffae55d (×8). With defaults (min_len=30, min_count=4) both must
// trip and the worst offender is returned.
- let adcd = std::iter::repeat_n("Now I understand the structure. The keys need to go into the chunk files.", 23)
+ let adcd = std::iter::repeat_n(
+ "Now I understand the structure. The keys need to go into the chunk files.",
+ 23,
+ )
.collect::<Vec<_>>()
.join("\n");
let (line, n) = detect_repeated_line(&adcd, 30, 4).expect("must trip");
assert_eq!(n, 23);
assert!(line.contains("Now I understand the structure"));
- let dffae = std::iter::repeat_n("Good, the repo is cloned. Let me narrow down the search.", 8)
- .collect::<Vec<_>>()
- .join("\n");
+ let dffae = std::iter::repeat_n(
+ "Good, the repo is cloned. Let me narrow down the search.",
+ 8,
+ )
+ .collect::<Vec<_>>()
+ .join("\n");
let (_, n2) = detect_repeated_line(&dffae, 30, 4).expect("must trip");
assert_eq!(n2, 8);
}
diff --git a/crates/openhuman-core/src/skills/runtime/run_machinery_tests.rs b/crates/openhuman-core/src/skills/runtime/run_machinery_tests.rs
index e69de29bb2..8b13789179 100644
--- a/crates/openhuman-core/src/skills/runtime/run_machinery_tests.rs
+++ b/crates/openhuman-core/src/skills/runtime/run_machinery_tests.rs
@@ -0,0 +1 @@
+
diff --git a/crates/openhuman-core/src/threads/ops_conversion_tests.rs b/crates/openhuman-core/src/threads/ops_conversion_tests.rs
index 33b47e7a8a..affe3dc0b1 100644
--- a/crates/openhuman-core/src/threads/ops_conversion_tests.rs
+++ b/crates/openhuman-core/src/threads/ops_conversion_tests.rs
@@ -180,8 +180,7 @@ fn title_log_prefix_is_grep_friendly_and_stable() {
#[tokio::test]
async fn message_append_returns_typed_not_found_for_stale_thread() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
let thread_id = "thread-missing";
@@ -211,8 +210,7 @@ async fn message_append_returns_typed_not_found_for_stale_thread() {
#[tokio::test]
async fn generate_title_returns_typed_not_found_for_stale_thread() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
let thread_id = "thread-missing";
@@ -235,8 +233,7 @@ async fn generate_title_returns_typed_not_found_for_stale_thread() {
#[tokio::test]
async fn generate_title_leaves_custom_title_unchanged() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
let thread_id = "thread-custom";
@@ -275,8 +272,7 @@ async fn generate_title_leaves_custom_title_unchanged() {
#[tokio::test]
async fn generate_title_returns_existing_title_when_no_user_message_exists() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
let thread_id = "thread-no-user";
@@ -297,8 +293,7 @@ async fn generate_title_returns_existing_title_when_no_user_message_exists() {
#[tokio::test]
async fn generate_title_falls_back_to_first_user_message_when_assistant_missing() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
let thread_id = "thread-fallback";
@@ -337,8 +332,7 @@ async fn generate_title_falls_back_to_first_user_message_when_assistant_missing(
#[tokio::test]
async fn thread_delete_removes_persisted_turn_state_snapshot() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
let thread_id = "thread-delete";
@@ -389,8 +383,7 @@ async fn thread_delete_removes_persisted_turn_state_snapshot() {
#[tokio::test]
async fn threads_purge_removes_valid_and_corrupted_turn_state_files() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
create_thread_with_title(&workspace, "thread-a", "Chat Jan 1 1:00 AM").await;
@@ -448,8 +441,7 @@ async fn threads_purge_removes_valid_and_corrupted_turn_state_files() {
#[tokio::test]
async fn turn_state_clear_reports_false_when_snapshot_is_absent() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
@@ -466,8 +458,7 @@ async fn turn_state_clear_reports_false_when_snapshot_is_absent() {
#[tokio::test]
async fn thread_update_title_rejects_empty_and_whitespace_only_titles() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
diff --git a/crates/openhuman-core/src/threads/ops_title_and_cancellation_tests.rs b/crates/openhuman-core/src/threads/ops_title_and_cancellation_tests.rs
index 87bb44490f..d6132af62a 100644
--- a/crates/openhuman-core/src/threads/ops_title_and_cancellation_tests.rs
+++ b/crates/openhuman-core/src/threads/ops_title_and_cancellation_tests.rs
@@ -2,8 +2,7 @@ use super::*;
#[tokio::test]
async fn thread_update_title_persists_new_title() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
@@ -27,8 +26,7 @@ async fn thread_update_title_persists_new_title() {
#[tokio::test]
async fn thread_update_title_returns_error_for_missing_thread() {
- let _env_lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
let _workspace_guard = EnvVarGuard::set("OPENHUMAN_WORKSPACE", workspace.path());
diff --git a/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs b/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
index 78c73a07f5..f5583ddf48 100644
--- a/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
@@ -315,8 +315,7 @@ fn all_tools_registers_brave_engine_lsp_and_tool_stats_when_enabled() {
cfg.learning.enabled = true;
cfg.learning.tool_tracking_enabled = true;
- let _env_guard = crate::config::TEST_ENV_LOCK
- .blocking_lock();
+ let _env_guard = crate::config::TEST_ENV_LOCK.blocking_lock();
unsafe {
std::env::set_var(crate::tools::implementations::LSP_ENABLED_ENV, "1");
}
diff --git a/crates/openhuman-core/src/tools/registry/ops_tests.rs b/crates/openhuman-core/src/tools/registry/ops_tests.rs
index 75c1c2b505..478fcbdeef 100644
--- a/crates/openhuman-core/src/tools/registry/ops_tests.rs
+++ b/crates/openhuman-core/src/tools/registry/ops_tests.rs
@@ -88,8 +88,7 @@ fn diagnostics_reports_inventory_and_policy_surfaces() {
#[tokio::test]
async fn diagnostics_loads_active_capability_provider_config() {
- let _lock = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _lock = crate::config::TEST_ENV_LOCK.lock().await;
let tmp = tempfile::tempdir().expect("tempdir");
let _env = EnvVarGuard::set("OPENHUMAN_WORKSPACE", tmp.path());
std::fs::write(
diff --git a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs
index 4a6c2796bf..f2ef74560e 100644
--- a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs
+++ b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs
@@ -96,10 +96,7 @@ type ToolRegistry = Arc<Vec<Box<dyn Tool>>>;
/// This is not a contrived shape. Every `delegate_*` tool is synthesised into
/// `OpenHumanSessionHost::synthesized_tools`, a different `Arc` from the durable registry
/// (#6145), and seven delegates were already packed.
-fn split_registries(
- name: &'static str,
- level: PermissionLevel,
-) -> (ToolRegistry, ToolRegistry) {
+fn split_registries(name: &'static str, level: PermissionLevel) -> (ToolRegistry, ToolRegistry) {
let mut durable: Vec<Box<dyn Tool>> = Vec::new();
append_pack_tools(&mut durable);
let durable = Arc::new(durable);
diff --git a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs
index 3274dd0075..6d7ba1b7ba 100644
--- a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs
+++ b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs
@@ -336,8 +336,10 @@ fn a_direct_hand_off_closes_its_owners_pack_and_nothing_else() {
// `hand_off_to_skill_setup` is a hypothetical UNPACKED hand-off to the
// skills pack's owner (the real one, `setup_skills`, is packed now; see
// `a_packed_hand_off_leaves_its_owners_pack_open`).
- let delegates = [delegate("hand_off_to_skill_setup", "skill_setup"),
- delegate("create_image", "image_agent")];
+ let delegates = [
+ delegate("hand_off_to_skill_setup", "skill_setup"),
+ delegate("create_image", "image_agent"),
+ ];
let raw = registry_with_all(&[
"skill_registry_install",
"media_generate_image",
diff --git a/crates/openhuman-core/src/voice/bus_tests.rs b/crates/openhuman-core/src/voice/bus_tests.rs
index 12a8dec3d1..f7b8895159 100644
--- a/crates/openhuman-core/src/voice/bus_tests.rs
+++ b/crates/openhuman-core/src/voice/bus_tests.rs
@@ -42,21 +42,24 @@ async fn publishing_a_ptt_commit_reaches_a_subscriber() {
tokio::time::sleep(std::time::Duration::from_millis(50)).await;
let got = events.lock().await;
- let found = got.iter().map(|e| match e {
- VoiceEvent::PttTranscriptCommitted {
- thread_id,
- session_id,
- text_len,
- held_ms,
- finalized_by_watchdog,
- } => Some((
- thread_id.clone(),
- *session_id,
- *text_len,
- *held_ms,
- *finalized_by_watchdog,
- )),
- });
+ let found = got
+ .iter()
+ .map(|e| match e {
+ VoiceEvent::PttTranscriptCommitted {
+ thread_id,
+ session_id,
+ text_len,
+ held_ms,
+ finalized_by_watchdog,
+ } => (
+ thread_id.clone(),
+ *session_id,
+ *text_len,
+ *held_ms,
+ *finalized_by_watchdog,
+ ),
+ })
+ .next();
assert_eq!(
found,
Some(("thread-1".to_string(), 42, 17, 850, false)),
diff --git a/crates/openhuman-core/src/voice/ops_tests.rs b/crates/openhuman-core/src/voice/ops_tests.rs
index 5c2fdb555b..bbc9cb2dcb 100644
--- a/crates/openhuman-core/src/voice/ops_tests.rs
+++ b/crates/openhuman-core/src/voice/ops_tests.rs
@@ -62,7 +62,8 @@ async fn voice_status_detects_stub_binaries() {
.expect("chmod");
}
- let _guard = EnvVarGuard::locked_set_async("PIPER_BIN", &piper_stub.display().to_string()).await;
+ let _guard =
+ EnvVarGuard::locked_set_async("PIPER_BIN", &piper_stub.display().to_string()).await;
let mut config = Config::default();
config.workspace_dir = tmp.path().join("workspace");
diff --git a/crates/openhuman-core/src/voice/realtime_tests.rs b/crates/openhuman-core/src/voice/realtime_tests.rs
index d494b53f78..7c9447c72a 100644
--- a/crates/openhuman-core/src/voice/realtime_tests.rs
+++ b/crates/openhuman-core/src/voice/realtime_tests.rs
@@ -73,7 +73,8 @@ async fn mint_signed_url_authenticates_with_the_api_key() {
use axum::{http::HeaderMap, routing::get, Json, Router};
use std::sync::{Arc, Mutex};
- let seen: Arc<Mutex<Option<(Option<String>, Option<String>)>>> = Arc::default();
+ type SeenHeaders = Option<(Option<String>, Option<String>)>;
+ let seen: Arc<Mutex<SeenHeaders>> = Arc::default();
let app = Router::new().route(
"/voice-agent/get-signed-url",
get({
diff --git a/crates/openhuman-core/src/web3/wallet/ops_tests.rs b/crates/openhuman-core/src/web3/wallet/ops_tests.rs
index 18665d7488..920c11bcf4 100644
--- a/crates/openhuman-core/src/web3/wallet/ops_tests.rs
+++ b/crates/openhuman-core/src/web3/wallet/ops_tests.rs
@@ -215,7 +215,8 @@ fn setup_allows_fresh_without_force() {
async fn reveal_recovery_phrase_returns_error_when_no_wallet() {
let temp = tempfile::tempdir().expect("temp dir");
let _wallet_lock = crate::web3::wallet::test_support::TEST_LOCK.lock().await;
- let _workspace_guard = crate::web3::wallet::test_support::set_workspace_env_for_test(&temp).await;
+ let _workspace_guard =
+ crate::web3::wallet::test_support::set_workspace_env_for_test(&temp).await;
let result = reveal_recovery_phrase().await;
let err = result.expect_err("should error when no wallet configured");
assert!(
diff --git a/crates/openhuman-core/src/web_chat/web_tests_session_and_concurrency_tests.rs b/crates/openhuman-core/src/web_chat/web_tests_session_and_concurrency_tests.rs
index c9e08cd931..18cc1720ac 100644
--- a/crates/openhuman-core/src/web_chat/web_tests_session_and_concurrency_tests.rs
+++ b/crates/openhuman-core/src/web_chat/web_tests_session_and_concurrency_tests.rs
@@ -300,8 +300,11 @@ async fn wedged_turn_hits_wall_clock_backstop_and_emits_turn_timeout_chat_error(
// Panic-safe teardown of the process-global env override: if any assertion
// below unwinds, this guard still clears `OPENHUMAN_WEB_TURN_TIMEOUT_SECS` so
// a 1s backstop can't leak into unrelated tests sharing this process.
- let _env_guard =
- crate::config::test_env::EnvVarGuard::locked_set_async("OPENHUMAN_WEB_TURN_TIMEOUT_SECS", "1").await;
+ let _env_guard = crate::config::test_env::EnvVarGuard::locked_set_async(
+ "OPENHUMAN_WEB_TURN_TIMEOUT_SECS",
+ "1",
+ )
+ .await;
let block = make_block();
set_test_run_chat_task_block(Some(block.clone())).await;
@@ -545,8 +548,7 @@ fn classify_genuine_param_400_keeps_model_mismatch_copy_not_glitch() {
#[tokio::test]
async fn unscoped_cancel_stops_the_threads_detached_subagents() {
let _serial = FORCED_ERROR_TEST_LOCK.lock().await;
- let _registry = crate::config::TEST_ENV_LOCK
- .lock().await;
+ let _registry = crate::config::TEST_ENV_LOCK.lock().await;
use crate::agent::orchestration::running_subagents;
let thread_id = "stop-detached-subagent-thread";
diff --git a/tests/keyring_secretstore_fresh_e2e.rs b/tests/keyring_secretstore_fresh_e2e.rs
index e15f99251b..26175a5199 100644
--- a/tests/keyring_secretstore_fresh_e2e.rs
+++ b/tests/keyring_secretstore_fresh_e2e.rs
@@ -7,7 +7,9 @@ use std::sync::OnceLock;
async fn env_lock_async() -> tokio::sync::MutexGuard<'static, ()> {
static LOCK: OnceLock<tokio::sync::Mutex<()>> = OnceLock::new();
- LOCK.get_or_init(|| tokio::sync::Mutex::new(())).lock().await
+ LOCK.get_or_init(|| tokio::sync::Mutex::new(()))
+ .lock()
+ .await
}
fn parse_keyring_payload(json: &str) -> serde_json::Value {
diff --git a/tests/memory_roundtrip_e2e.rs b/tests/memory_roundtrip_e2e.rs
index fde794427a..ef3889ce50 100644
--- a/tests/memory_roundtrip_e2e.rs
+++ b/tests/memory_roundtrip_e2e.rs
@@ -58,7 +58,10 @@ static MEMORY_SEAMS_INIT: OnceLock<()> = OnceLock::new();
static TEST_ROOT: OnceLock<tempfile::TempDir> = OnceLock::new();
async fn env_lock_async() -> tokio::sync::MutexGuard<'static, ()> {
- ENV_LOCK.get_or_init(|| tokio::sync::Mutex::new(())).lock().await
+ ENV_LOCK
+ .get_or_init(|| tokio::sync::Mutex::new(()))
+ .lock()
+ .await
}
/// This integration target calls memory operations without constructing a core
diff --git a/tests/skills_mcp_registry_live.rs b/tests/skills_mcp_registry_live.rs
index 0a2a9f3d2a..d0f42e420c 100644
--- a/tests/skills_mcp_registry_live.rs
+++ b/tests/skills_mcp_registry_live.rs
@@ -39,8 +39,7 @@ static ENV_LOCK: OnceLock<tokio::sync::Mutex<()>> = OnceLock::new();
async fn env_lock_async() -> tokio::sync::MutexGuard<'static, ()> {
let mutex = ENV_LOCK.get_or_init(|| tokio::sync::Mutex::new(()));
- mutex
- .lock().await
+ mutex.lock().await
}
/// A core RPC stack over a throwaway `HOME`, with no registry overrides.