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: tidy json-rpc e2e suites and relocate misplaced doc comments
Steven Enamakelf68f65fd195a
diff --git a/tests/in_process_all.rs b/tests/in_process_all.rsindex 9ff0a5ad56..7074459047 100644--- a/tests/in_process_all.rs+++ b/tests/in_process_all.rs@@ -25,6 +25,8 @@#![allow(dead_code)]+#[path = "support/config_auth_harness.rs"]+pub mod config_auth_harness;#[path = "support/env_guard.rs"]pub mod env_guard;#[path = "support/rpc_auth.rs"]@@ -35,7 +37,5 @@ pub mod rpc_harness;pub mod scripted_stack;#[path = "support/tinyhumans_boot.rs"]pub mod tinyhumans_boot;-#[path = "support/config_auth_harness.rs"]-pub mod config_auth_harness;include!(concat!(env!("OUT_DIR"), "/in_process_mods.rs"));diff --git a/tests/json_rpc_agent_team_e2e.rs b/tests/json_rpc_agent_team_e2e.rsindex b68da6ca9e..465ea83bb8 100644--- a/tests/json_rpc_agent_team_e2e.rs+++ b/tests/json_rpc_agent_team_e2e.rs@@ -606,7 +606,6 @@ async fn json_rpc_agent_registry_manages_defaults_and_custom_agents() {rpc_join.abort();}-#[test]fn json_rpc_protocol_auth_and_agent_hello() {run_json_rpc_e2e_on_agent_stack(@@ -756,7 +755,6 @@ async fn json_rpc_protocol_auth_and_agent_hello_inner() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_agent_work_list_groups_runs_by_bucket() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -861,7 +859,6 @@ async fn json_rpc_agent_work_list_groups_runs_by_bucket() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_agent_team_coordination_roundtrip() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1210,7 +1207,6 @@ async fn json_rpc_agent_team_coordination_roundtrip() {rpc_join.abort();}-#[tokio::test]async fn billing_rpc_e2e() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1493,7 +1489,6 @@ async fn team_rpc_e2e() {rpc_join.abort();}-#[test]fn json_rpc_agent_team_live_member_run_roundtrip() {run_json_rpc_e2e_on_agent_stack(@@ -1895,7 +1890,6 @@ async fn json_rpc_agent_run_mode_set_and_get_round_trip() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_agent_context_breakdown_default_agent_returns_sections() {// `agent.context_breakdown` (wire method `openhuman.agent_context_breakdown`,@@ -1964,7 +1958,6 @@ async fn json_rpc_agent_context_breakdown_default_agent_returns_sections() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_commands_list_merges_builtins() {// `commands.list` (wire method `openhuman.commands_list`, no params) must@@ -2039,4 +2032,3 @@ async fn json_rpc_commands_list_merges_builtins() {api_join.abort();rpc_join.abort();}-diff --git a/tests/json_rpc_auth_security_e2e.rs b/tests/json_rpc_auth_security_e2e.rsindex 9452691c6b..3d426ea554 100644--- a/tests/json_rpc_auth_security_e2e.rs+++ b/tests/json_rpc_auth_security_e2e.rs@@ -90,7 +90,6 @@ async fn notification_settings_roundtrip_and_disabled_ingest_skip() {rpc_join.abort();}-#[tokio::test]async fn credentials_crud_roundtrip() {// Tests the provider-credential lifecycle over the JSON-RPC transport:@@ -591,7 +590,6 @@ async fn external_process_with_guessed_token_is_rejected() {rpc_join.abort();}-#[tokio::test]async fn rpc_update_apply_can_be_disabled_by_config_policy() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -932,12 +930,3 @@ async fn auth_store_provider_credentials_writes_an_owner_only_store_file() {mock_join.abort();rpc_join.abort();}--/// #5947 — `validate_only` is a dry run for **stt**, not only for tts.-///-/// It used to be checked inside the `"tts"` arm alone. Every provider the-/// settings modal can reach maps to `"stt"`, so the modal's dry-run request-/// fell through to a live transcription — the opposite of what "Test Key"-/// promises. A reserved slug is used because it is the one dry-run answer that-/// is fully determined with no network: there is no user-held key to check, so-/// the handler reports success without calling a provider.diff --git a/tests/json_rpc_flows_e2e.rs b/tests/json_rpc_flows_e2e.rsindex d150bb946b..0cf9720aa7 100644--- a/tests/json_rpc_flows_e2e.rs+++ b/tests/json_rpc_flows_e2e.rs@@ -190,7 +190,6 @@ async fn json_rpc_cron_origin_delivery_lands_in_the_asking_thread_inner() {rpc_join.abort();}-#[test]fn json_rpc_cron_add_run_list_round_trip_over_the_tinyflows_module() {run_json_rpc_e2e_on_agent_stack(@@ -322,7 +321,6 @@ async fn json_rpc_cron_add_run_list_round_trip_over_the_tinyflows_module_inner()rpc_join.abort();}-#[tokio::test]async fn json_rpc_workflow_run_definitions_and_runs_roundtrip() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -428,7 +426,6 @@ async fn json_rpc_workflow_run_definitions_and_runs_roundtrip() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_workflows_lifecycle_round_trip() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -613,7 +610,6 @@ fn approval_gated_graph_json() -> Value {/// parked run rather than the already-completed one (cancelling a terminal run/// is an error).#[cfg(feature = "flows")]-#[tokio::test]async fn json_rpc_flows_lifecycle_round_trip() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -838,7 +834,6 @@ async fn json_rpc_flows_lifecycle_round_trip() {/// `openhuman.flows_run_detached` controller (schema + handler wiring), not/// just the `ops::flows_run_detached` fn directly.#[cfg(feature = "flows")]-#[tokio::test]async fn json_rpc_flows_run_detached_returns_before_run_completes() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -953,7 +948,6 @@ async fn json_rpc_flows_run_detached_returns_before_run_completes() {/// `openhuman.flows_update` controller (schema + handler wiring), not just/// the `ops::flows_update` fn directly.#[cfg(feature = "flows")]-#[tokio::test]async fn json_rpc_flows_update_forces_require_approval_on_side_effect_graph() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1049,7 +1043,6 @@ async fn json_rpc_flows_update_forces_require_approval_on_side_effect_graph() {/// end-to-end (schema + handler wiring), independent of the agent-backed/// `flows_discover`, which needs a provider.#[cfg(feature = "flows")]-#[tokio::test]async fn json_rpc_flows_suggestion_lifecycle_methods_are_wired() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1236,7 +1229,6 @@ fn opus_sonnet_demo_graph() -> Value {/// Runs on the agent-sized worker stack because the builder/scout turns and the/// agent-node run drive the full harness (deep async stacks).#[cfg(feature = "flows")]-#[test]fn json_rpc_flows_full_arc_discover_build_create_run() {run_json_rpc_e2e_on_agent_stack(@@ -1488,7 +1480,6 @@ async fn json_rpc_flows_full_arc_discover_build_create_run_inner() {/// Keep one valid and one invalid `flows_validate` wire call at the host/// boundary; the engine validation details are covered by TinyFlows.#[cfg(feature = "flows")]-#[tokio::test]async fn json_rpc_flows_validate_wire_shape() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1562,7 +1553,6 @@ async fn json_rpc_flows_validate_wire_shape() {/// `openhuman.flows_import` returns a native graph without persisting a flow row.#[cfg(feature = "flows")]-#[tokio::test]async fn json_rpc_flows_import_does_not_persist() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1622,7 +1612,6 @@ async fn json_rpc_flows_import_does_not_persist() {/// Composio source fails and is tolerated (the RPC still returns the HTTP half/// rather than erroring).#[cfg(feature = "flows")]-#[tokio::test]async fn json_rpc_flows_list_connections_aggregates_secret_free() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1821,7 +1810,6 @@ async fn json_rpc_workflow_run_engine_executes_builtin_to_completion_inner() {mock_join.abort();}-#[tokio::test]async fn json_rpc_flows_strict_create_refuses_binding_to_undeclared_agent_field() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1860,4 +1848,3 @@ async fn json_rpc_flows_strict_create_refuses_binding_to_undeclared_agent_field(// ---------------------------------------------------------------------------// Migration import guard: refusing the null memory driver (#5799)// ----------------------------------------------------------------------------diff --git a/tests/json_rpc_inference_e2e.rs b/tests/json_rpc_inference_e2e.rsindex a90c63c662..5b6ad97869 100644--- a/tests/json_rpc_inference_e2e.rs+++ b/tests/json_rpc_inference_e2e.rs@@ -812,6 +812,14 @@ async fn voice_cloud_transcribe_registered_e2e() {// inject fakes without touching the filesystem.+/// #5947 — `validate_only` is a dry run for **stt**, not only for tts.+///+/// It used to be checked inside the `"tts"` arm alone. Every provider the+/// settings modal can reach maps to `"stt"`, so the modal's dry-run request+/// fell through to a live transcription — the opposite of what "Test Key"+/// promises. A reserved slug is used because it is the one dry-run answer that+/// is fully determined with no network: there is no user-held key to check, so+/// the handler reports success without calling a provider.#[tokio::test]async fn voice_test_provider_honours_validate_only_for_the_stt_workload() {let _env_lock = json_rpc_e2e_env_lock_async().await;diff --git a/tests/json_rpc_mcp_e2e.rs b/tests/json_rpc_mcp_e2e.rsindex 134e10ceca..8870a3e83b 100644--- a/tests/json_rpc_mcp_e2e.rs+++ b/tests/json_rpc_mcp_e2e.rs@@ -863,4 +863,3 @@ async fn mcp_clients_registry_settings_roundtrip() {mock_join.abort();rpc_join.abort();}-diff --git a/tests/json_rpc_misc_e2e.rs b/tests/json_rpc_misc_e2e.rsindex 3f692fc129..447bbaaad8 100644--- a/tests/json_rpc_misc_e2e.rs+++ b/tests/json_rpc_misc_e2e.rs@@ -46,7 +46,6 @@ async fn json_rpc_modules_list_reports_the_serving_source() {}#[cfg(feature = "modules")]-#[tokio::test]async fn json_rpc_modules_browser_forget_sites_removes_learned_sites() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -122,7 +121,6 @@ async fn json_rpc_modules_browser_forget_sites_removes_learned_sites() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_tokenjuice_detect_and_cache_stats() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -158,7 +156,6 @@ async fn json_rpc_tokenjuice_detect_and_cache_stats() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_tokenjuice_settings_and_savings() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -235,7 +232,6 @@ async fn json_rpc_tokenjuice_settings_and_savings() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_tool_registry_lists_and_gets_entries() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -329,7 +325,6 @@ async fn json_rpc_tool_registry_lists_and_gets_entries() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_removed_harness_provisioning_is_unavailable() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -363,7 +358,6 @@ async fn json_rpc_removed_harness_provisioning_is_unavailable() {rpc_join.abort();}-#[test]fn json_rpc_prompt_injection_is_rejected_before_model_call() {run_json_rpc_e2e_on_agent_stack(@@ -471,7 +465,6 @@ async fn json_rpc_prompt_injection_is_rejected_before_model_call_inner() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_plan_review_decide_unknown_and_invalid() {// The plan-review gate is in-memory and parks a live turn; over RPC we can@@ -534,7 +527,6 @@ async fn json_rpc_plan_review_decide_unknown_and_invalid() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_run_ledger_lifecycle() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -652,7 +644,6 @@ async fn json_rpc_run_ledger_lifecycle() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_rejects_non_object_params_with_clear_error() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -694,7 +685,6 @@ async fn json_rpc_rejects_non_object_params_with_clear_error() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_removed_screen_intelligence_methods_are_not_found() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -728,7 +718,6 @@ async fn json_rpc_removed_screen_intelligence_methods_are_not_found() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_app_state_snapshot_returns_runtime_shape() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -816,7 +805,9 @@ async fn json_rpc_app_state_snapshot_returns_runtime_shape() {rpc_join.abort();}-+/// Verify that when `chat_onboarding_completed` is unset in config.toml (fresh+/// user), the `openhuman.app_state_snapshot` RPC surfaces the flag as `false`+/// (its serde default). The field is deprecated but still surfaced for backward compat.#[tokio::test]async fn json_rpc_app_state_snapshot_chat_onboarding_defaults_false() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -994,7 +985,6 @@ async fn about_app_rpc_list_lookup_and_search() {rpc_join.abort();}-#[tokio::test]async fn skills_uninstall_rpc_e2e() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1104,6 +1094,13 @@ async fn skills_uninstall_rpc_e2e() {/// POST /rpc without any Authorization header → 401 with error=unauthorized.+/// Task-sources CRUD + status + dry-run over JSON-RPC.+///+/// Exercises `openhuman.task_sources_{add,list,get,update,remove,status,+/// list_tasks,preview_filter}` against an isolated HOME workspace. The+/// fetch/preview paths require no network here: with no signed-in+/// Composio session, `preview_filter` returns a clean JSON-RPC error+/// rather than hanging.#[tokio::test]async fn json_rpc_task_sources_crud_and_status() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1407,6 +1404,8 @@ async fn json_rpc_task_sources_fetch_pipeline_e2e() {/// the user-scope root (`$HOME/.openhuman/workflows/<slug>/`), which the temp/// `HOME` isolates per-test.+/// E2E: the retired dictation and voice-server config methods are absent from+/// the JSON-RPC surface.#[tokio::test]async fn json_rpc_retired_dictation_and_voice_server_methods_are_unknown() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1451,7 +1450,6 @@ async fn json_rpc_retired_dictation_and_voice_server_methods_are_unknown() {// at the END of the file per the multi-agent coordination protocol (#3370 epic).// ─────────────────────────────────────────────────────────────────────────────-#[tokio::test]async fn json_rpc_memory_diff_surface_is_gone_and_memory_still_answers() {let _env_lock = json_rpc_e2e_env_lock_async().await;diff --git a/tests/json_rpc_threads_e2e.rs b/tests/json_rpc_threads_e2e.rsindex dff13b2bd4..8e0e69d808 100644--- a/tests/json_rpc_threads_e2e.rs+++ b/tests/json_rpc_threads_e2e.rs@@ -204,7 +204,6 @@ async fn json_rpc_thread_goal_and_todos_get_and_queue_remove_are_wired() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_thread_title_create_and_update() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -299,7 +298,6 @@ async fn json_rpc_thread_title_create_and_update() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_thread_working_dir_binds_before_the_first_message() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -412,7 +410,6 @@ async fn json_rpc_thread_working_dir_binds_before_the_first_message() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_thread_not_found_errors_are_structured() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -480,7 +477,6 @@ async fn json_rpc_thread_not_found_errors_are_structured() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_thread_generate_title_falls_back_when_provider_path_is_unavailable() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -590,7 +586,6 @@ async fn json_rpc_thread_generate_title_falls_back_when_provider_path_is_unavailrpc_join.abort();}-#[tokio::test]async fn json_rpc_thread_turn_state_lifecycle() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -800,7 +795,6 @@ async fn json_rpc_thread_turn_state_lifecycle() {rpc_join.abort();}-#[tokio::test]async fn json_rpc_threads_token_usage_reads_persisted_thread_totals() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -990,7 +984,6 @@ fn seed_raw_transcript(workspace: &Path, stem: &str, thread_id: &str, body: &[&sstd::fs::write(raw_dir.join(format!("{stem}.jsonl")), buf).expect("write transcript");}-#[tokio::test]async fn json_rpc_threads_transcript_get_projects_and_paginates() {let _env_lock = json_rpc_e2e_env_lock_async().await;@@ -1418,7 +1411,6 @@ async fn json_rpc_threads_edit_message_truncates_and_restarts_turn_inner() {rpc_join.abort();}-#[test]fn json_rpc_threads_regenerate_truncates_and_restarts_turn() {run_json_rpc_e2e_on_agent_stack(diff --git a/tests/json_rpc_wallet_e2e.rs b/tests/json_rpc_wallet_e2e.rsindex 31ca45beb9..bc5dfded4e 100644--- a/tests/json_rpc_wallet_e2e.rs+++ b/tests/json_rpc_wallet_e2e.rs@@ -749,7 +749,3 @@ async fn json_rpc_wallet_network_defaults_returns_network_rows() {mock_join.abort();rpc_join.abort();}--/// Verify that when `chat_onboarding_completed` is unset in config.toml (fresh-/// user), the `openhuman.app_state_snapshot` RPC surfaces the flag as `false`-/// (its serde default). The field is deprecated but still surfaced for backward compat.diff --git a/tests/json_rpc_web_chat_e2e.rs b/tests/json_rpc_web_chat_e2e.rsindex 90d2a99e66..d4e95c926e 100644--- a/tests/json_rpc_web_chat_e2e.rs+++ b/tests/json_rpc_web_chat_e2e.rs@@ -187,7 +187,6 @@ async fn json_rpc_web_chat_routing_cases_use_expected_backend_models_inner() {rpc_join.abort();}-#[test]fn json_rpc_web_chat_custom_chat_provider_uses_stored_key_and_rebuilds_on_route_change() {run_json_rpc_e2e_on_agent_stack(@@ -582,7 +581,6 @@ async fn json_rpc_web_chat_custom_chat_provider_uses_stored_key_and_rebuilds_on_rpc_join.abort();}-#[test]fn json_rpc_web_chat_custom_chat_provider_with_auth_none_omits_auth_header() {run_json_rpc_e2e_on_agent_stack(@@ -806,7 +804,6 @@ async fn json_rpc_web_chat_custom_chat_provider_with_auth_none_omits_auth_headerrpc_join.abort();}-#[test]fn json_rpc_channel_web_chat_with_speak_reply_invokes_reply_speech() {run_json_rpc_e2e_on_agent_stack(@@ -931,6 +928,3 @@ async fn json_rpc_channel_web_chat_with_speak_reply_invokes_reply_speech_inner()}// ── Model resolution and voice settings ─────────────────────────────────--/// E2E: the retired dictation and voice-server config methods are absent from-/// the JSON-RPC surface.diff --git a/tests/support/config_auth_harness.rs b/tests/support/config_auth_harness.rsindex 5b47ce2ae1..ab1d664222 100644--- a/tests/support/config_auth_harness.rs+++ b/tests/support/config_auth_harness.rs@@ -28,13 +28,14 @@ pub use openhuman_core::config::schema::{};pub use openhuman_core::config::{clear_active_user, default_projects_dir, pre_login_user_dir, read_active_user_id,- user_openhuman_dir, write_active_user_id, Config, DaemonConfig,- UpdateRestartStrategy,+ user_openhuman_dir, write_active_user_id, Config, DaemonConfig, UpdateRestartStrategy,};pub use openhuman_core::core::events::DomainEvent;pub use openhuman_core::desktop::app_state::app_state_schemas;pub use openhuman_core::security::credentials::bus::SessionExpiredSubscriber;-pub use openhuman_core::security::credentials::profiles::{AuthProfile, AuthProfilesStore, TokenSet};+pub use openhuman_core::security::credentials::profiles::{+ AuthProfile, AuthProfilesStore, TokenSet,+};pub use openhuman_core::security::credentials::{clear_composio_api_key, decrypt_secret, encrypt_secret, get_composio_api_key,list_provider_credentials_by_prefix, normalize_provider, rpc_store_composio_api_key,@@ -131,7 +132,10 @@ pub(crate) fn bearer(headers: &HeaderMap) -> Option<&str> {.and_then(|value| value.to_str().ok())}-pub(crate) async fn mock_auth_me(State(state): State<MockBackendState>, headers: HeaderMap) -> Json<Value> {+pub(crate) async fn mock_auth_me(+ State(state): State<MockBackendState>,+ headers: HeaderMap,+) -> Json<Value> {state.auth_me_hits.fetch_add(1, Ordering::SeqCst);let auth = bearer(&headers).unwrap_or_default();Json(json!({@@ -227,7 +231,9 @@ pub(crate) fn encrypt_handoff_blob(key: &str, plaintext: &str) -> String {base64::engine::general_purpose::STANDARD.encode(combined)}-pub(crate) async fn mock_revoke_integration(AxumPath(_integration_id): AxumPath<String>) -> Json<Value> {+pub(crate) async fn mock_revoke_integration(+ AxumPath(_integration_id): AxumPath<String>,+) -> Json<Value> {Json(json!({ "success": true, "data": { "revoked": true } }))}@@ -329,4 +335,3 @@ pub(crate) fn schema_method_names(value: &Value, namespace: &str) -> Vec<String>methods.sort();methods}-diff --git a/tests/support/rpc_e2e_harness.rs b/tests/support/rpc_e2e_harness.rsindex c839a33a6f..a245a3960e 100644--- a/tests/support/rpc_e2e_harness.rs+++ b/tests/support/rpc_e2e_harness.rs@@ -117,7 +117,8 @@ pub(crate) fn with_chat_completion_requests<T>(f: impl FnOnce(&mut Vec<Value>) -// different node. Matching entries are still served in strict FIFO order among// themselves, so a two-turn tool loop (tool_call turn, then terminal-text turn)// stays ordered.-pub(crate) static FORCED_CHAT_COMPLETIONS: OnceLock<Mutex<VecDeque<ForcedChatCompletion>>> = OnceLock::new();+pub(crate) static FORCED_CHAT_COMPLETIONS: OnceLock<Mutex<VecDeque<ForcedChatCompletion>>> =+ OnceLock::new();#[derive(Clone)]pub(crate) struct ForcedChatCompletion {@@ -128,7 +129,9 @@ pub(crate) struct ForcedChatCompletion {body: Value,}-pub(crate) fn with_forced_chat_completions<T>(f: impl FnOnce(&mut VecDeque<ForcedChatCompletion>) -> T) -> T {+pub(crate) fn with_forced_chat_completions<T>(+ f: impl FnOnce(&mut VecDeque<ForcedChatCompletion>) -> T,+) -> T {let mutex = FORCED_CHAT_COMPLETIONS.get_or_init(|| Mutex::new(VecDeque::new()));match mutex.lock() {Ok(mut guard) => f(&mut guard),@@ -1165,4 +1168,3 @@ pub(crate) fn ensure_test_rpc_auth() {init_rpc_token(&token_dir).expect("init rpc auth token for json_rpc_e2e");});}-