Skip to content

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

chore: reformat code for consistent style across multiple crates

Steven Enamakela3b2b4b09072
diff --git a/crates/openhuman-core/src/api/rest.rs b/crates/openhuman-core/src/api/rest.rs
index 59886cb6a1..656f271f44 100644
--- a/crates/openhuman-core/src/api/rest.rs
+++ b/crates/openhuman-core/src/api/rest.rs
@@ -656,7 +656,6 @@ impl BackendOAuthClient {
url.path(),
);
}
-
}
// These are transient infrastructure errors (proxy/CDN/backend
@@ -947,7 +946,6 @@ impl BackendOAuthClient {
}
self.authed_json(bearer_jwt, Method::GET, &path, None).await
}
-
}
/// AES-256-GCM decrypt compatible with backend `encryptMessageFromString` (IV 16 + tag 16 + ciphertext, base64).
diff --git a/crates/openhuman-core/src/api/rest_tests.rs b/crates/openhuman-core/src/api/rest_tests.rs
index 20149a1cd4..6199daadbf 100644
--- a/crates/openhuman-core/src/api/rest_tests.rs
+++ b/crates/openhuman-core/src/api/rest_tests.rs
@@ -1,7 +1,6 @@
use super::{
- backend_api_body_shape, flatten_authed_error,
- is_unmatched_route_404, key_bytes_from_string, parse_message_path, BackendApiError,
- BackendOAuthClient, BACKEND_API_BODY_SHAPE_MAX_BYTES,
+ backend_api_body_shape, flatten_authed_error, is_unmatched_route_404, key_bytes_from_string,
+ parse_message_path, BackendApiError, BackendOAuthClient, BACKEND_API_BODY_SHAPE_MAX_BYTES,
};
use crate::api::headers::sanitize_client_version;
use crate::api::product::{
diff --git a/crates/openhuman-core/src/api/transport/mod.rs b/crates/openhuman-core/src/api/transport/mod.rs
index a163e1da24..ffa7a86cb9 100644
--- a/crates/openhuman-core/src/api/transport/mod.rs
+++ b/crates/openhuman-core/src/api/transport/mod.rs
@@ -28,8 +28,8 @@ pub mod plain;
pub use error::BackendTransportError;
pub use install::{
- clear_backend_transport, install_backend_transport, installed_backend_transport,
- is_installed, resolve_backend_transport,
+ clear_backend_transport, install_backend_transport, installed_backend_transport, is_installed,
+ resolve_backend_transport,
};
/// One `(name, value)` query pair; a `None` value omits the pair.
diff --git a/crates/openhuman-core/src/channels/controllers/ops/discord.rs b/crates/openhuman-core/src/channels/controllers/ops/discord.rs
index c7e801faee..8f077f12a1 100644
--- a/crates/openhuman-core/src/channels/controllers/ops/discord.rs
+++ b/crates/openhuman-core/src/channels/controllers/ops/discord.rs
@@ -3,7 +3,6 @@
//! The managed link flow (`channels.discord_link_*`) needs a TinyHumans
//! account and lives in `openhuman-tinyhumans` (`hosted::channel_link`).
-
use crate::config::Config;
use crate::rpc::RpcOutcome;
use crate::security::credentials;
diff --git a/crates/openhuman-core/src/channels/controllers/ops/messaging.rs b/crates/openhuman-core/src/channels/controllers/ops/messaging.rs
index d0fdf56256..ef743a6efb 100644
--- a/crates/openhuman-core/src/channels/controllers/ops/messaging.rs
+++ b/crates/openhuman-core/src/channels/controllers/ops/messaging.rs
@@ -28,7 +28,12 @@ pub async fn channel_send_message(
let result = client
.send_channel_message(channel, &jwt, message)
.await
- .map_err(|e| format!("failed to send channel message: {}", crate::api::flatten_authed_error(e)))?;
+ .map_err(|e| {
+ format!(
+ "failed to send channel message: {}",
+ crate::api::flatten_authed_error(e)
+ )
+ })?;
log::debug!("[channels] send_message response: {:?}", result);
@@ -55,7 +60,12 @@ pub async fn channel_send_reaction(
let result = client
.send_channel_reaction(channel, &jwt, reaction)
.await
- .map_err(|e| format!("failed to send channel reaction: {}", crate::api::flatten_authed_error(e)))?;
+ .map_err(|e| {
+ format!(
+ "failed to send channel reaction: {}",
+ crate::api::flatten_authed_error(e)
+ )
+ })?;
log::debug!("[channels] send_reaction response: {:?}", result);
@@ -83,7 +93,12 @@ pub async fn channel_create_thread(
let result = client
.create_channel_thread(channel, &jwt, title)
.await
- .map_err(|e| format!("failed to create channel thread: {}", crate::api::flatten_authed_error(e)))?;
+ .map_err(|e| {
+ format!(
+ "failed to create channel thread: {}",
+ crate::api::flatten_authed_error(e)
+ )
+ })?;
log::debug!("[channels] create_thread response: {:?}", result);
@@ -113,7 +128,12 @@ pub async fn channel_update_thread(
let result = client
.update_channel_thread(channel, &jwt, thread_id, action)
.await
- .map_err(|e| format!("failed to update channel thread: {}", crate::api::flatten_authed_error(e)))?;
+ .map_err(|e| {
+ format!(
+ "failed to update channel thread: {}",
+ crate::api::flatten_authed_error(e)
+ )
+ })?;
log::debug!("[channels] update_thread response: {:?}", result);
@@ -141,7 +161,12 @@ pub async fn channel_list_threads(
let result = client
.list_channel_threads(channel, &jwt, active)
.await
- .map_err(|e| format!("failed to list channel threads: {}", crate::api::flatten_authed_error(e)))?;
+ .map_err(|e| {
+ format!(
+ "failed to list channel threads: {}",
+ crate::api::flatten_authed_error(e)
+ )
+ })?;
log::debug!("[channels] list_threads response: {:?}", result);
diff --git a/crates/openhuman-core/src/channels/controllers/schemas_tests.rs b/crates/openhuman-core/src/channels/controllers/schemas_tests.rs
index 38528de5d5..2b355e724b 100644
--- a/crates/openhuman-core/src/channels/controllers/schemas_tests.rs
+++ b/crates/openhuman-core/src/channels/controllers/schemas_tests.rs
@@ -121,7 +121,10 @@ fn hosted_link_functions_are_not_served_by_the_core() {
// `channels.telegram_login_*` / `channels.discord_link_*` need a TinyHumans
// account and are registered by `openhuman-tinyhumans`; the core must not
// register them too (the extension would collide) nor advertise them.
- let names: Vec<&str> = all_controller_schemas().iter().map(|s| s.function).collect();
+ let names: Vec<&str> = all_controller_schemas()
+ .iter()
+ .map(|s| s.function)
+ .collect();
let registered: Vec<&str> = all_registered_controllers()
.iter()
.map(|c| c.schema.function)
diff --git a/crates/openhuman-core/src/core/runtime/services.rs b/crates/openhuman-core/src/core/runtime/services.rs
index e0f549f95d..8bb14faa79 100644
--- a/crates/openhuman-core/src/core/runtime/services.rs
+++ b/crates/openhuman-core/src/core/runtime/services.rs
@@ -499,7 +499,9 @@ pub fn spawn_socket_auto_connect(
// read leaves no token (Sentry 35911). That is a user-state
// race, not a fault: warn so it stays a breadcrumb.
if e.contains("no session token stored") {
- log::warn!("[socket] Auto-connect skipped — session cleared before connect: {e}");
+ log::warn!(
+ "[socket] Auto-connect skipped — session cleared before connect: {e}"
+ );
} else {
log::error!("[socket] Auto-connect failed: {e}");
}
diff --git a/crates/openhuman-core/src/integrations/client/budget_gate_tests.rs b/crates/openhuman-core/src/integrations/client/budget_gate_tests.rs
index cab13c4b7f..ed32a58e16 100644
--- a/crates/openhuman-core/src/integrations/client/budget_gate_tests.rs
+++ b/crates/openhuman-core/src/integrations/client/budget_gate_tests.rs
@@ -297,3 +297,30 @@ fn usage_budget_exhausted_honors_remaining_and_bypass() {
"bypassCycleLimit": true,
})));
}
+
+// ── Sentry 36649: no credential → no request, no streak ─────────────────
+
+#[tokio::test]
+async fn probe_without_a_credential_fails_before_the_backoff_and_any_request() {
+ let tmp = tempfile::TempDir::new().unwrap();
+ let config = Config {
+ workspace_dir: tmp.path().join("workspace"),
+ action_dir: tmp.path().join("workspace"),
+ config_path: tmp.path().join("config.toml"),
+ api_url: Some("http://127.0.0.1:9".into()),
+ ..Config::default()
+ };
+ let err = probe_usage(&config).await.unwrap_err();
+ assert!(
+ err.contains("no backend session token"),
+ "the credential error is returned as-is, not a network failure: {err}"
+ );
+ assert!(
+ !USAGE_FAILURE_CACHE.is_fresh(
+ &effective_backend_api_url(&config.api_url),
+ Instant::now(),
+ USAGE_FAILURE_BACKOFF
+ ),
+ "a missing credential must not open a failure-backoff streak"
+ );
+}
diff --git a/crates/openhuman-core/src/security/credentials/mod.rs b/crates/openhuman-core/src/security/credentials/mod.rs
index ac01fd1104..c60394e064 100644
--- a/crates/openhuman-core/src/security/credentials/mod.rs
+++ b/crates/openhuman-core/src/security/credentials/mod.rs
@@ -15,7 +15,9 @@ pub mod sentry_scope;
pub mod session_support;
pub mod tools;
-pub use crate::api::rest::{decrypt_handoff_blob, user_id_from_profile_payload, BackendOAuthClient};
+pub use crate::api::rest::{
+ decrypt_handoff_blob, user_id_from_profile_payload, BackendOAuthClient,
+};
pub use core::*;
pub use credential_ref::{CredentialRef, CredentialRefError, CredentialRefScheme, ResolvedSecret};
pub use http_creds::{
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 a033c668ea..b53af1ae2c 100644
--- a/crates/openhuman-core/src/security/credentials/ops_credential_tests.rs
+++ b/crates/openhuman-core/src/security/credentials/ops_credential_tests.rs
@@ -555,7 +555,6 @@ async fn clear_credential_without_a_kind_removes_everything() {
);
}
-
// ── set_credential (local session) ─────────────────────────────
/// A local session token requires a non-empty user payload — the backend
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 816bef6c00..29e79a78a7 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
@@ -39,7 +39,6 @@ async fn auth_get_session_token_json_returns_null_when_empty() {
assert!(out.value["token"].is_null());
}
-
// ── store_provider_credentials (validation + store path) ──────
#[tokio::test]
diff --git a/crates/openhuman-core/src/security/credentials/tools.rs b/crates/openhuman-core/src/security/credentials/tools.rs
index 682add0f03..debc759f54 100644
--- a/crates/openhuman-core/src/security/credentials/tools.rs
+++ b/crates/openhuman-core/src/security/credentials/tools.rs
@@ -24,7 +24,10 @@ use tinytools::{Tool, ToolResult};
/// (`hosted::oauth`) and are registered only when that layer is installed, so
/// the tools reach them by wire name instead of calling them directly. With no
/// hosted layer the tool reports the `BACKEND_UNAVAILABLE:` sentinel.
-async fn invoke_hosted(method: &str, params: serde_json::Map<String, Value>) -> anyhow::Result<Value> {
+async fn invoke_hosted(
+ method: &str,
+ params: serde_json::Map<String, Value>,
+) -> anyhow::Result<Value> {
match crate::core::all::try_invoke_registered_rpc(method, params).await {
Some(Ok(value)) => Ok(strip_log_envelope(value)),
Some(Err(err)) => Err(anyhow::anyhow!("{err}")),
diff --git a/crates/openhuman-core/src/security/credentials/tools_tests.rs b/crates/openhuman-core/src/security/credentials/tools_tests.rs
index 699f218bbe..54ad753f97 100644
--- a/crates/openhuman-core/src/security/credentials/tools_tests.rs
+++ b/crates/openhuman-core/src/security/credentials/tools_tests.rs
@@ -34,10 +34,7 @@ async fn oauth_tools_report_backend_unavailable_without_the_hosted_layer() {
.execute(json!({}))
.await
.expect_err("no hosted layer");
- assert!(
- err.to_string().contains("BACKEND_UNAVAILABLE:"),
- "{err}"
- );
+ assert!(err.to_string().contains("BACKEND_UNAVAILABLE:"), "{err}");
let err = OAuthConnectUrlTool::new(cfg())
.execute(json!({"provider": "github", "skill_id": "s"}))
.await
diff --git a/crates/openhuman-tinyhumans/src/hosted/announcements/ops.rs b/crates/openhuman-tinyhumans/src/hosted/announcements/ops.rs
index f67c36f2fc..82d23ae368 100644
--- a/crates/openhuman-tinyhumans/src/hosted/announcements/ops.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/announcements/ops.rs
@@ -32,7 +32,11 @@ fn is_not_found<T>(result: &Result<T, SdkError>) -> bool {
/// propagates.
pub async fn get_latest_announcement(config: &Config) -> Result<RpcOutcome<Value>, String> {
let client = HostedClient::from_config(config)?;
- let result = client.sdk().announcements().get_latest_announcements().await;
+ let result = client
+ .sdk()
+ .announcements()
+ .get_latest_announcements()
+ .await;
if is_not_found(&result) {
log::debug!("[hosted][announcements] 404 on GET /announcements/latest — no announcement");
return Ok(RpcOutcome::single_log(
diff --git a/crates/openhuman-tinyhumans/src/hosted/announcements/ops_tests.rs b/crates/openhuman-tinyhumans/src/hosted/announcements/ops_tests.rs
index 0f14dffb11..c4b2588afa 100644
--- a/crates/openhuman-tinyhumans/src/hosted/announcements/ops_tests.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/announcements/ops_tests.rs
@@ -23,7 +23,11 @@ fn only_a_404_status_counts_as_not_found() {
async fn latest_via(server: &MockServer) -> Result<Option<Value>, String> {
let client =
HostedClient::with_credential(&server.uri(), BackendCredential::Session("jwt".into()));
- let result = client.sdk().announcements().get_latest_announcements().await;
+ let result = client
+ .sdk()
+ .announcements()
+ .get_latest_announcements()
+ .await;
if is_not_found(&result) {
return Ok(None);
}
@@ -69,7 +73,9 @@ async fn backend_404_is_no_announcement_and_null_passes_through() {
let server = MockServer::start().await;
Mock::given(method("GET"))
.and(path("/announcements/latest"))
- .respond_with(ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": null})))
+ .respond_with(
+ ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": null})),
+ )
.mount(&server)
.await;
assert_eq!(latest_via(&server).await.unwrap(), Some(Value::Null));
diff --git a/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs b/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs
index 2d45ff3de0..1152adf942 100644
--- a/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/billing/ops.rs
@@ -13,9 +13,8 @@
use reqwest::Method;
use serde_json::{Map, Value};
use tinyhumans_sdk::api::payments::{
- CoinbaseInterval, CoinbasePlan, CreateCoinbaseChargeRequest,
- CreditTopUpRequest, PaymentGateway, PurchaseStripePlanRequest,
- UpdateAutoRechargeCardRequest,
+ CoinbaseInterval, CoinbasePlan, CreateCoinbaseChargeRequest, CreditTopUpRequest,
+ PaymentGateway, PurchaseStripePlanRequest, UpdateAutoRechargeCardRequest,
};
use tinyhumans_sdk::api::types::{BillingPlan, CodeRequest};
@@ -297,7 +296,11 @@ pub async fn create_coinbase_charge(
let client = HostedClient::from_config(config)?;
let data = client.finish_value(
"POST /payments/coinbase/charge",
- client.sdk().payments().create_coinbase_charge(&request).await,
+ client
+ .sdk()
+ .payments()
+ .create_coinbase_charge(&request)
+ .await,
)?;
Ok(RpcOutcome::single_log(
data,
diff --git a/crates/openhuman-tinyhumans/src/hosted/billing/ops_tests.rs b/crates/openhuman-tinyhumans/src/hosted/billing/ops_tests.rs
index 0c1ad62375..acece6ff92 100644
--- a/crates/openhuman-tinyhumans/src/hosted/billing/ops_tests.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/billing/ops_tests.rs
@@ -169,7 +169,8 @@ async fn purchase_plan_rejects_unknown_plan_before_any_request() {
#[tokio::test]
async fn billing_calls_send_schema_current_requests() {
let server = MockServer::start().await;
- let ok = || ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": {"ok": true}}));
+ let ok =
+ || ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": {"ok": true}}));
Mock::given(method("GET"))
.and(path("/payments/credits/transactions"))
.and(query_param("limit", "20"))
diff --git a/crates/openhuman-tinyhumans/src/hosted/channel_link/managed.rs b/crates/openhuman-tinyhumans/src/hosted/channel_link/managed.rs
index 1268aeca08..c78d65c9ec 100644
--- a/crates/openhuman-tinyhumans/src/hosted/channel_link/managed.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/channel_link/managed.rs
@@ -72,8 +72,12 @@ async fn fetch_profile(client: &HostedClient) -> Result<Value, String> {
/// The first non-empty string among `keys` on `profile`.
fn profile_id<'a>(profile: &'a Value, keys: &[&str]) -> Option<&'a str> {
- keys.iter()
- .find_map(|k| profile.get(*k).and_then(Value::as_str).filter(|s| !s.is_empty()))
+ keys.iter().find_map(|k| {
+ profile
+ .get(*k)
+ .and_then(Value::as_str)
+ .filter(|s| !s.is_empty())
+ })
}
/// Store the `channel:<channel>:managed_dm` credential marker.
diff --git a/crates/openhuman-tinyhumans/src/hosted/channel_link/ops.rs b/crates/openhuman-tinyhumans/src/hosted/channel_link/ops.rs
index 70b90411e2..4603ffbf32 100644
--- a/crates/openhuman-tinyhumans/src/hosted/channel_link/ops.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/channel_link/ops.rs
@@ -25,7 +25,10 @@ fn normalize_channel(channel: &str) -> Result<String, String> {
}
/// `POST /auth/channels/{channel}/link-token` with an existing client.
-pub(super) async fn link_token_payload(client: &HostedClient, channel: &str) -> Result<Value, String> {
+pub(super) async fn link_token_payload(
+ client: &HostedClient,
+ channel: &str,
+) -> Result<Value, String> {
client.finish_value(
"POST /auth/channels/{channel}/link-token",
client.sdk().auth().create_channel_link_token(channel).await,
diff --git a/crates/openhuman-tinyhumans/src/hosted/channel_link/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/channel_link/schemas.rs
index 5d3ff0e152..d66f60f40d 100644
--- a/crates/openhuman-tinyhumans/src/hosted/channel_link/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/channel_link/schemas.rs
@@ -41,7 +41,7 @@ pub fn all_channel_link_registered_controllers() -> Vec<RegisteredController> {
schema: channel_link_schemas("auth_create_channel_link_token"),
handler: handle_auth_create_channel_link_token,
}];
- controllers.extend([
+ controllers.extend([
RegisteredController {
schema: channel_link_schemas("telegram_login_start"),
handler: handle_telegram_login_start,
@@ -82,7 +82,7 @@ pub fn channel_link_schemas(function: &str) -> ControllerSchema {
required: true,
}],
},
- f if CHANNEL_FUNCTIONS.contains(&f) => {
+ f if CHANNEL_FUNCTIONS.contains(&f) => {
openhuman_core::channels::contract_schema::contract_controller_schema(f)
}
_ => ControllerSchema {
diff --git a/crates/openhuman-tinyhumans/src/hosted/client.rs b/crates/openhuman-tinyhumans/src/hosted/client.rs
index 7b88d98245..7b96163ba5 100644
--- a/crates/openhuman-tinyhumans/src/hosted/client.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/client.rs
@@ -120,8 +120,8 @@ impl HostedClient {
/// normalisation `BackendOAuthClient::new` applies, so a completions-style
/// `api_url` (`https://host/v1/chat/completions`) still reaches `/teams/...`.
fn backend_origin(api_url: &str) -> Result<String, String> {
- let mut url = url::Url::parse(api_url.trim())
- .map_err(|e| format!("Invalid API base URL: {e}"))?;
+ let mut url =
+ url::Url::parse(api_url.trim()).map_err(|e| format!("Invalid API base URL: {e}"))?;
if !matches!(url.scheme(), "http" | "https") || url.host_str().is_none() {
return Err("API base URL must be an absolute http(s) URL with host".to_string());
}
diff --git a/crates/openhuman-tinyhumans/src/hosted/client_tests.rs b/crates/openhuman-tinyhumans/src/hosted/client_tests.rs
index ba1e1d55c4..bdd06157ad 100644
--- a/crates/openhuman-tinyhumans/src/hosted/client_tests.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/client_tests.rs
@@ -132,7 +132,9 @@ fn offline_local_session_fails_before_any_request() {
// Unroutable: a request here would fail loudly, not return the sentinel.
let config = test_config(&tmp, "http://127.0.0.1:9");
store_session(&config, "desktop.test.local");
- let err = HostedClient::from_config(&config).err().expect("local refuses");
+ let err = HostedClient::from_config(&config)
+ .err()
+ .expect("local refuses");
assert_eq!(
err,
openhuman_core::security::credentials::session_support::LOCAL_SESSION_BACKEND_UNAVAILABLE
diff --git a/crates/openhuman-tinyhumans/src/hosted/oauth/ops.rs b/crates/openhuman-tinyhumans/src/hosted/oauth/ops.rs
index a0500d7bc3..f306f3ea30 100644
--- a/crates/openhuman-tinyhumans/src/hosted/oauth/ops.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/oauth/ops.rs
@@ -120,8 +120,8 @@ pub async fn oauth_fetch_integration_tokens(
.ok_or_else(|| "integration tokens response missing encrypted payload".to_string())?;
let plaintext = decrypt_handoff_blob(encrypted, encryption_key.trim())
.map_err(|e| format!("integration tokens handoff: {e:#}"))?;
- let tokens: IntegrationTokensHandoff = serde_json::from_str(&plaintext)
- .map_err(|e| format!("parse decrypted token JSON: {e}"))?;
+ let tokens: IntegrationTokensHandoff =
+ serde_json::from_str(&plaintext).map_err(|e| format!("parse decrypted token JSON: {e}"))?;
Ok(RpcOutcome::single_log(
serde_json::to_value(&tokens).map_err(|e| e.to_string())?,
"integration tokens retrieved",
diff --git a/crates/openhuman-tinyhumans/src/hosted/oauth/ops_tests.rs b/crates/openhuman-tinyhumans/src/hosted/oauth/ops_tests.rs
index 533f0fb8bb..4be227333f 100644
--- a/crates/openhuman-tinyhumans/src/hosted/oauth/ops_tests.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/oauth/ops_tests.rs
@@ -53,7 +53,9 @@ async fn connect_forwards_non_empty_query_and_shapes_the_result() {
.and(path("/auth/github/connect"))
.and(query_param("skillId", "s1"))
.and(query_param("encryptionMode", "encrypted"))
- .respond_with(ok(json!({"oauthUrl": "https://gh/authorize", "state": "st"})))
+ .respond_with(ok(
+ json!({"oauthUrl": "https://gh/authorize", "state": "st"}),
+ ))
.expect(1)
.mount(&server)
.await;
diff --git a/crates/openhuman-tinyhumans/src/hosted/oauth/schemas_tests.rs b/crates/openhuman-tinyhumans/src/hosted/oauth/schemas_tests.rs
index 1af20eeff5..3ce51fce4b 100644
--- a/crates/openhuman-tinyhumans/src/hosted/oauth/schemas_tests.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/oauth/schemas_tests.rs
@@ -21,10 +21,20 @@ fn catalog_keeps_the_auth_oauth_wire_names() {
#[test]
fn connect_requires_provider_and_tokens_require_id_and_key() {
let connect = oauth_schemas("auth_oauth_connect");
- let required: Vec<_> = connect.inputs.iter().filter(|f| f.required).map(|f| f.name).collect();
+ let required: Vec<_> = connect
+ .inputs
+ .iter()
+ .filter(|f| f.required)
+ .map(|f| f.name)
+ .collect();
assert_eq!(required, vec!["provider"]);
let tokens = oauth_schemas("auth_oauth_fetch_integration_tokens");
- let required: Vec<_> = tokens.inputs.iter().filter(|f| f.required).map(|f| f.name).collect();
+ let required: Vec<_> = tokens
+ .inputs
+ .iter()
+ .filter(|f| f.required)
+ .map(|f| f.name)
+ .collect();
assert_eq!(required, vec!["integrationId", "key"]);
assert_eq!(oauth_schemas("nope").function, "unknown");
}
diff --git a/crates/openhuman-tinyhumans/src/hosted/team/ops.rs b/crates/openhuman-tinyhumans/src/hosted/team/ops.rs
index 3e60f6e85d..5db6f5981e 100644
--- a/crates/openhuman-tinyhumans/src/hosted/team/ops.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/team/ops.rs
@@ -50,10 +50,10 @@ pub async fn get_usage(config: &Config) -> Result<RpcOutcome<Value>, String> {
let client = HostedClient::from_config(config)?;
let backend_key = effective_backend_api_url(&config.api_url);
budget_gate::usage_with_failure_backoff(&backend_key, || async {
- client.finish_value(
- "GET /teams/me/usage",
- client.sdk().teams().get_my_usage().await,
- )
+ client.finish_value(
+ "GET /teams/me/usage",
+ client.sdk().teams().get_my_usage().await,
+ )
})
.await
}
diff --git a/crates/openhuman-tinyhumans/src/hosted/team/ops_tests.rs b/crates/openhuman-tinyhumans/src/hosted/team/ops_tests.rs
index 62c215eeff..33f0702ba7 100644
--- a/crates/openhuman-tinyhumans/src/hosted/team/ops_tests.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/team/ops_tests.rs
@@ -210,28 +210,37 @@ async fn team_calls_encode_ids_and_send_typed_bodies() {
let server = MockServer::start().await;
Mock::given(method("GET"))
.and(path("/teams/t%2F1/members"))
- .respond_with(ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": []})))
+ .respond_with(
+ ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": []})),
+ )
.expect(1)
.mount(&server)
.await;
Mock::given(method("POST"))
.and(path("/teams/t1/invites"))
.and(body_json(json!({"maxUses": 3})))
- .respond_with(ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": {"code": "c"}})))
+ .respond_with(
+ ResponseTemplate::new(200)
+ .set_body_json(json!({"success": true, "data": {"code": "c"}})),
+ )
.expect(1)
.mount(&server)
.await;
Mock::given(method("PUT"))
.and(path("/teams/t1/members/u1/role"))
.and(body_json(json!({"role": "admin"})))
- .respond_with(ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": {}})))
+ .respond_with(
+ ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": {}})),
+ )
.expect(1)
.mount(&server)
.await;
Mock::given(method("POST"))
.and(path("/teams/join"))
.and(body_json(json!({"code": "JOIN"})))
- .respond_with(ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": {}})))
+ .respond_with(
+ ResponseTemplate::new(200).set_body_json(json!({"success": true, "data": {}})),
+ )
.expect(1)
.mount(&server)
.await;
@@ -244,12 +253,20 @@ async fn team_calls_encode_ids_and_send_typed_bodies() {
let tmp = TempDir::new().unwrap();
let config = test_support::signed_in(&tmp, &server.uri());
- assert_eq!(list_members(&config, " t/1 ").await.unwrap().value, json!([]));
assert_eq!(
- create_invite(&config, "t1", Some(3), None).await.unwrap().value,
+ list_members(&config, " t/1 ").await.unwrap().value,
+ json!([])
+ );
+ assert_eq!(
+ create_invite(&config, "t1", Some(3), None)
+ .await
+ .unwrap()
+ .value,
json!({"code": "c"})
);
- change_member_role(&config, "t1", "u1", "admin").await.unwrap();
+ change_member_role(&config, "t1", "u1", "admin")
+ .await
+ .unwrap();
join_team(&config, " JOIN ").await.unwrap();
let err = list_teams(&config).await.unwrap_err();
assert!(err.starts_with("SESSION_EXPIRED:"), "{err}");
diff --git a/crates/openhuman-tinyhumans/src/hosted/webhooks/ops_tests.rs b/crates/openhuman-tinyhumans/src/hosted/webhooks/ops_tests.rs
index bf5cc314ef..4b4fc8022d 100644
--- a/crates/openhuman-tinyhumans/src/hosted/webhooks/ops_tests.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/webhooks/ops_tests.rs
@@ -121,7 +121,10 @@ async fn tunnel_crud_round_trips_through_the_sdk() {
let out = list_tunnels(&config).await.unwrap();
assert_eq!(out.value["tunnels"][0]["id"], json!("t-1"));
- assert!(out.logs.iter().any(|l| l.contains("webhook tunnels fetched")));
+ assert!(out
+ .logs
+ .iter()
+ .any(|l| l.contains("webhook tunnels fetched")));
let out = create_tunnel(&config, " my-hook ", Some(" desc ".into()))
.await
diff --git a/crates/openhuman-tinyhumans/src/hosted/webhooks/schemas.rs b/crates/openhuman-tinyhumans/src/hosted/webhooks/schemas.rs
index adee182d44..7da5ac36dc 100644
--- a/crates/openhuman-tinyhumans/src/hosted/webhooks/schemas.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/webhooks/schemas.rs
@@ -190,8 +190,12 @@ fn handle_create_tunnel(params: Map<String, Value>) -> ControllerFuture {
let config = config_rpc::load_config_with_timeout().await?;
let payload = deserialize_params::<WebhookCreateTunnelParams>(params)?;
to_json(
- crate::hosted::webhooks::create_tunnel(&config, payload.name.trim(), payload.description)
- .await?,
+ crate::hosted::webhooks::create_tunnel(
+ &config,
+ payload.name.trim(),
+ payload.description,
+ )
+ .await?,
)
})
}
diff --git a/crates/openhuman-tinyhumans/src/hosted/webhooks/schemas_tests.rs b/crates/openhuman-tinyhumans/src/hosted/webhooks/schemas_tests.rs
index f1be057929..49a5570619 100644
--- a/crates/openhuman-tinyhumans/src/hosted/webhooks/schemas_tests.rs
+++ b/crates/openhuman-tinyhumans/src/hosted/webhooks/schemas_tests.rs
@@ -15,10 +15,7 @@ fn catalog_is_the_six_hosted_tunnel_functions_under_webhooks() {
let names: Vec<&str> = schemas.iter().map(|s| s.function).collect();
assert_eq!(names, FUNCTIONS);
assert!(schemas.iter().all(|s| s.namespace == "webhooks"));
- assert_eq!(
- all_webhooks_registered_controllers().len(),
- FUNCTIONS.len()
- );
+ assert_eq!(all_webhooks_registered_controllers().len(), FUNCTIONS.len());
}
#[test]
@@ -34,7 +31,10 @@ fn input_contracts_are_unchanged() {
}
let update = webhooks_schemas("update_tunnel");
for optional in ["name", "description", "isActive"] {
- assert!(update.inputs.iter().any(|f| f.name == optional && !f.required));
+ assert!(update
+ .inputs
+ .iter()
+ .any(|f| f.name == optional && !f.required));
}
}
diff --git a/tests/config_auth_app_state_connectivity_e2e.rs b/tests/config_auth_app_state_connectivity_e2e.rs
index e2f0a295f1..d16d8b0cbf 100644
--- a/tests/config_auth_app_state_connectivity_e2e.rs
+++ b/tests/config_auth_app_state_connectivity_e2e.rs
@@ -2427,14 +2427,18 @@ async fn credentials_public_ops_cover_service_and_missing_session_error_paths()
.await
.expect_err("blank channel should fail")
.contains("channel is required"));
- assert!(channel_link::auth_create_channel_link_token(&config, "matrix")
- .await
- .expect_err("unsupported channel should fail")
- .contains("unsupported channel"));
- assert!(channel_link::auth_create_channel_link_token(&config, "telegram")
- .await
- .expect_err("missing session should fail")
- .contains("no backend session token"));
+ assert!(
+ channel_link::auth_create_channel_link_token(&config, "matrix")
+ .await
+ .expect_err("unsupported channel should fail")
+ .contains("unsupported channel")
+ );
+ assert!(
+ channel_link::auth_create_channel_link_token(&config, "telegram")
+ .await
+ .expect_err("missing session should fail")
+ .contains("no backend session token")
+ );
assert!(oauth::oauth_connect(
&config,
"github",