Skip to content

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

chore: reformat long lines and reorder imports

Steven Enamakelb46873593537
diff --git a/app/src-tauri/src/core_rpc.rs b/app/src-tauri/src/core_rpc.rs
index 017b4197f4..d090f9b9d5 100644
--- a/app/src-tauri/src/core_rpc.rs
+++ b/app/src-tauri/src/core_rpc.rs
@@ -101,9 +101,12 @@ pub(crate) async fn post_json_rpc(
// Remote gateway that slipped past persistence is still rejected here.
let relay_token = relay_bearer_header(token);
#[cfg(feature = "gateways")]
- if relay_token.is_some() && crate::gateway::types::validate_remote_transport(url, token).is_err()
+ if relay_token.is_some()
+ && crate::gateway::types::validate_remote_transport(url, token).is_err()
{
- return Err(format!("refusing to send a bearer to {url} over an insecure transport"));
+ return Err(format!(
+ "refusing to send a bearer to {url} over an insecure transport"
+ ));
}
let client = reqwest::Client::builder()
@@ -196,8 +199,8 @@ fn unwrap_rpc_outcome(value: serde_json::Value) -> serde_json::Value {
#[cfg(test)]
mod tests {
- use super::relay_bearer_header;
use super::redact_url_for_log;
+ use super::relay_bearer_header;
#[test]
fn bearer_header_present_for_real_token() {
diff --git a/app/src-tauri/src/gateway/provision.rs b/app/src-tauri/src/gateway/provision.rs
index e63ab128a5..13e44925fe 100644
--- a/app/src-tauri/src/gateway/provision.rs
+++ b/app/src-tauri/src/gateway/provision.rs
@@ -405,8 +405,6 @@ async fn destroy_quietly(sandbox: &dyn Sandbox, box_id: &BoxId) {
/// paths the core must be stopped explicitly or it keeps running headless.
async fn stop_quietly(sandbox: &dyn Sandbox, box_id: &BoxId, process: &ProcessId) {
if let Err(error) = sandbox.stop(box_id, process).await {
- log::warn!(
- "[gateway][provision] could not stop core {process} in box {box_id}: {error}"
- );
+ log::warn!("[gateway][provision] could not stop core {process} in box {box_id}: {error}");
}
}
diff --git a/app/src-tauri/src/gateway/types.rs b/app/src-tauri/src/gateway/types.rs
index c5fa858242..7198e404c5 100644
--- a/app/src-tauri/src/gateway/types.rs
+++ b/app/src-tauri/src/gateway/types.rs
@@ -163,7 +163,10 @@ impl GatewaySpec {
/// Reused by [`validate_remote_transport`] and by the transport layer to allow
/// plain HTTP only to the local core, never to a remote one carrying a bearer.
fn is_loopback_host(host: &str) -> bool {
- let h = host.trim_start_matches('[').trim_end_matches(']').to_ascii_lowercase();
+ let h = host
+ .trim_start_matches('[')
+ .trim_end_matches(']')
+ .to_ascii_lowercase();
h == "127.0.0.1" || h == "::1" || h == "localhost" || h.ends_with(".localhost")
}
@@ -191,7 +194,8 @@ pub fn validate_remote_transport(url: &str, token: Option<&str>) -> Result<(), S
let has_bearer = token.map(str::trim).is_some_and(|t| !t.is_empty());
if has_bearer && scheme == "http" && !is_loopback_host(parsed.host_str().unwrap_or_default()) {
return Err(
- "a remote core with a bearer token must be reached over https, not plain http".to_owned(),
+ "a remote core with a bearer token must be reached over https, not plain http"
+ .to_owned(),
);
}
Ok(())