Skip to content

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

chore: apply rustfmt formatting across core crates

Steven Enamakel6d73c66787a7
diff --git a/crates/openhuman-core/src/api/rest.rs b/crates/openhuman-core/src/api/rest.rs
index c950fdb5cc..e162595885 100644
--- a/crates/openhuman-core/src/api/rest.rs
+++ b/crates/openhuman-core/src/api/rest.rs
@@ -380,11 +380,6 @@ pub fn user_id_from_profile_payload(payload: &Value) -> Option<String> {
})
}
-/// Alias for [`user_id_from_profile_payload`] for semantic clarity in auth flows.
-pub fn user_id_from_auth_me_payload(payload: &Value) -> Option<String> {
- user_id_from_profile_payload(payload)
-}
-
/// JSON body returned by the backend when an OAuth connection process is initiated.
#[derive(Debug, Clone, Deserialize)]
pub struct ConnectResponse {
diff --git a/crates/openhuman-core/src/core/legacy_aliases.rs b/crates/openhuman-core/src/core/legacy_aliases.rs
index b230a1d4a9..81ba0b8073 100644
--- a/crates/openhuman-core/src/core/legacy_aliases.rs
+++ b/crates/openhuman-core/src/core/legacy_aliases.rs
@@ -27,8 +27,14 @@ const LEGACY_ALIASES: &[(&str, &str)] = &[
// params (`token`, `userId`, `user`) are a subset of `set_credential`'s;
// its `clear_session` maps to a clear of every kind, which on a desktop
// (never an API-key holder) is the same thing.
- ("openhuman.auth_clear_session", "openhuman.auth_clear_credential"),
- ("openhuman.auth_store_session", "openhuman.auth_set_credential"),
+ (
+ "openhuman.auth_clear_session",
+ "openhuman.auth_clear_credential",
+ ),
+ (
+ "openhuman.auth_store_session",
+ "openhuman.auth_set_credential",
+ ),
// #3565: old desktop clients called the channels controller with a dotted
// namespace/function spelling before the canonical
// `openhuman.<namespace>_<function>` form was established.
diff --git a/crates/openhuman-core/src/desktop/app_state/ops_tests.rs b/crates/openhuman-core/src/desktop/app_state/ops_tests.rs
index 8564a0e4f9..fef5191c9e 100644
--- a/crates/openhuman-core/src/desktop/app_state/ops_tests.rs
+++ b/crates/openhuman-core/src/desktop/app_state/ops_tests.rs
@@ -33,8 +33,6 @@ fn app_state_path_creates_state_dir_and_points_at_app_state_json() {
);
}
-
-
#[test]
fn load_stored_app_state_returns_default_when_missing() {
let tmp = tempdir().unwrap();
@@ -103,8 +101,6 @@ fn save_and_reload_stored_app_state_round_trips() {
assert_eq!(tasks.updated_at_ms, Some(42));
}
-
-
// ── RuntimeSnapshot cache tests ──────────────────────────────────────────────
struct SnapshotCacheResetGuard;
@@ -235,7 +231,6 @@ fn degraded_runtime_snapshot_has_expected_degraded_fields() {
);
}
-
// ── Configurable auth fetch timeout (#5930) ─────────────────────────────────
//
// "5s may be too tight" is the issue's first acceptance criterion. The risk in
@@ -244,8 +239,6 @@ fn degraded_runtime_snapshot_has_expected_degraded_fields() {
// window already closed and pay the full 20s again. The clamp and the derived
// base are what stop that, so both are pinned here.
-
-
fn build_dummy_runtime_snapshot() -> RuntimeSnapshot {
degraded_runtime_snapshot(&Config::default())
}
diff --git a/crates/openhuman-core/src/main.rs b/crates/openhuman-core/src/main.rs
index fb5b5aaa83..d0b1846d53 100644
--- a/crates/openhuman-core/src/main.rs
+++ b/crates/openhuman-core/src/main.rs
@@ -243,12 +243,13 @@ fn main() {
// the slot is empty (root cause of the original userCount=0).
if event.user.is_none() {
event.user =
- openhuman_core::security::credentials::identity::peek_credential_user_identity()
- .and_then(|identity| identity.id)
- .map(|id| sentry::User {
- id: Some(id),
- ..Default::default()
- });
+ openhuman_core::security::credentials::identity::peek_credential_user_identity(
+ )
+ .and_then(|identity| identity.id)
+ .map(|id| sentry::User {
+ id: Some(id),
+ ..Default::default()
+ });
}
// Scrub secrets from exception values and top-level message.
for exc in &mut event.exception.values {
diff --git a/crates/openhuman-core/src/security/credentials/mod.rs b/crates/openhuman-core/src/security/credentials/mod.rs
index c7cdc646e1..79729e7ec9 100644
--- a/crates/openhuman-core/src/security/credentials/mod.rs
+++ b/crates/openhuman-core/src/security/credentials/mod.rs
@@ -15,8 +15,8 @@ pub mod session_support;
pub mod tools;
pub use crate::api::rest::{
- decrypt_handoff_blob, user_id_from_auth_me_payload, user_id_from_profile_payload,
- BackendOAuthClient, ConnectResponse, IntegrationSummary, IntegrationTokensHandoff,
+ decrypt_handoff_blob, user_id_from_profile_payload, BackendOAuthClient, ConnectResponse,
+ IntegrationSummary, IntegrationTokensHandoff,
};
pub use core::*;
pub use credential_ref::{CredentialRef, CredentialRefError, CredentialRefScheme, ResolvedSecret};
diff --git a/crates/openhuman-core/src/security/credentials/schemas_tests.rs b/crates/openhuman-core/src/security/credentials/schemas_tests.rs
index 8d7ff25620..406d14bebd 100644
--- a/crates/openhuman-core/src/security/credentials/schemas_tests.rs
+++ b/crates/openhuman-core/src/security/credentials/schemas_tests.rs
@@ -179,8 +179,7 @@ fn json_output_produces_required_json_output_field() {
fn deserialize_params_parses_set_credential_request() {
let mut m = Map::new();
m.insert("token".into(), Value::String("abc".into()));
- let parsed: crate::security::credentials::SetCredentialRequest =
- deserialize_params(m).unwrap();
+ let parsed: crate::security::credentials::SetCredentialRequest = deserialize_params(m).unwrap();
assert_eq!(parsed.token, "abc");
assert!(parsed.kind.is_none());
assert!(parsed.user_id.is_none());
diff --git a/tests/config_auth_app_state_connectivity_e2e.rs b/tests/config_auth_app_state_connectivity_e2e.rs
index 0378f074b1..26f8b674cc 100644
--- a/tests/config_auth_app_state_connectivity_e2e.rs
+++ b/tests/config_auth_app_state_connectivity_e2e.rs
@@ -2505,7 +2505,6 @@ async fn credentials_secret_helpers_round_trip_with_file_keyring_backend() {
assert_eq!(decrypted, "worker-a-sensitive-value");
}
-
#[tokio::test]
async fn worker_a_controller_schemas_are_fully_exposed() {
let _lock = env_lock();
@@ -3796,14 +3795,6 @@ async fn auth_local_session_normalizes_user_and_app_state_snapshot_uses_stored_i
harness.join.abort();
}
-
-
-
-
-
-
-
-
#[tokio::test]
async fn auth_remote_backend_bearer_only_paths_round_trip_with_a_handed_over_session() {
let _lock = env_lock();
@@ -3829,8 +3820,14 @@ async fn auth_remote_backend_bearer_only_paths_round_trip_with_a_handed_over_ses
)
.await;
let state = payload(&session, "auth_set_credential remote");
- assert_eq!(state.get("credential").and_then(Value::as_str), Some("session"));
- assert_eq!(state.get("userId").and_then(Value::as_str), Some("remote-user-1"));
+ assert_eq!(
+ state.get("credential").and_then(Value::as_str),
+ Some("session")
+ );
+ assert_eq!(
+ state.get("userId").and_then(Value::as_str),
+ Some("remote-user-1")
+ );
assert_eq!(
backend_state.auth_me_hits.load(Ordering::SeqCst),
0,