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
fix(dev-connect): reformat long function arguments and route registrations
Steven Enamakel2d37738f23f0
diff --git a/app/src/hooks/__tests__/useDevSkipOnboarding.test.ts b/app/src/hooks/__tests__/useDevSkipOnboarding.test.tsindex 8104a305ab..50888f23b7 100644--- a/app/src/hooks/__tests__/useDevSkipOnboarding.test.ts+++ b/app/src/hooks/__tests__/useDevSkipOnboarding.test.ts@@ -3,11 +3,7 @@ import { describe, expect, it, vi } from 'vitest';import { useDevSkipOnboarding } from '../useDevSkipOnboarding';-const base = {- isBootstrapping: false,- sessionToken: 'jwt',- onboardingCompleted: false,-};+const base = { isBootstrapping: false, sessionToken: 'jwt', onboardingCompleted: false };describe('useDevSkipOnboarding', () => {it('marks onboarding complete once for a signed-in, un-onboarded user', () => {diff --git a/app/src/hooks/useDevSkipOnboarding.ts b/app/src/hooks/useDevSkipOnboarding.tsindex 91f76cd44d..02ea8fda8d 100644--- a/app/src/hooks/useDevSkipOnboarding.ts+++ b/app/src/hooks/useDevSkipOnboarding.ts@@ -16,7 +16,12 @@ interface DevSkipOnboardingInput {* only hiding the stepper, so state keyed off the core flag agrees with the UI.*/export function useDevSkipOnboarding(- { isBootstrapping, sessionToken, onboardingCompleted, setOnboardingCompletedFlag }: DevSkipOnboardingInput,+ {+ isBootstrapping,+ sessionToken,+ onboardingCompleted,+ setOnboardingCompletedFlag,+ }: DevSkipOnboardingInput,enabled: boolean = DEV_SKIP_ONBOARDING): void {const requestedRef = useRef(false);diff --git a/crates/openhuman-core/src/core/dev_connect.rs b/crates/openhuman-core/src/core/dev_connect.rsindex 053a4654db..30dab6c788 100644--- a/crates/openhuman-core/src/core/dev_connect.rs+++ b/crates/openhuman-core/src/core/dev_connect.rs@@ -93,7 +93,8 @@ pub(crate) fn is_direct_navigation(sec_fetch_site: Option<&str>) -> bool {/// Builds the redirect target. The bearer rides in the fragment only.pub(crate) fn build_redirect(app_origin: &str, rpc_url: &str, token: &str) -> String {- let encode = |value: &str| url::form_urlencoded::byte_serialize(value.as_bytes()).collect::<String>();+ let encode =+ |value: &str| url::form_urlencoded::byte_serialize(value.as_bytes()).collect::<String>();format!("{app_origin}/__dev-connect#rpcUrl={}&token={}",encode(rpc_url),@@ -134,7 +135,10 @@ pub async fn dev_connect_handler(};let Some(rpc_url) = header_str("host").and_then(rpc_url_from_host) else {- return refuse(StatusCode::FORBIDDEN, "request did not arrive on a loopback host");+ return refuse(+ StatusCode::FORBIDDEN,+ "request did not arrive on a loopback host",+ );};let Some(token) = crate::core::auth::get_rpc_token() else {@@ -146,7 +150,10 @@ pub async fn dev_connect_handler((StatusCode::FOUND,[- (header::LOCATION, build_redirect(&app_origin, &rpc_url, token)),+ (+ header::LOCATION,+ build_redirect(&app_origin, &rpc_url, token),+ ),(header::CACHE_CONTROL, "no-store".to_string()),(header::REFERRER_POLICY, "no-referrer".to_string()),],diff --git a/crates/openhuman-core/src/core/dev_connect_tests.rs b/crates/openhuman-core/src/core/dev_connect_tests.rsindex dd0d0c4431..6b0052acd8 100644--- a/crates/openhuman-core/src/core/dev_connect_tests.rs+++ b/crates/openhuman-core/src/core/dev_connect_tests.rs@@ -65,7 +65,11 @@ fn cross_site_navigations_are_refused() {#[test]fn redirect_carries_credentials_in_the_fragment_only() {- let target = build_redirect("http://localhost:1420", "http://127.0.0.1:7788/rpc", "a+b/c");+ let target = build_redirect(+ "http://localhost:1420",+ "http://127.0.0.1:7788/rpc",+ "a+b/c",+ );let (before_hash, fragment) = target.split_once('#').expect("fragment");assert_eq!(before_hash, "http://localhost:1420/__dev-connect");assert!(!before_hash.contains("token"));diff --git a/crates/openhuman-core/src/core/jsonrpc.rs b/crates/openhuman-core/src/core/jsonrpc.rsindex 5056aa02ba..aeaaa2090b 100644--- a/crates/openhuman-core/src/core/jsonrpc.rs+++ b/crates/openhuman-core/src/core/jsonrpc.rs@@ -798,7 +798,10 @@ pub fn build_core_http_router(socketio_enabled: bool) -> Router {.route("/ws/dictation", get(dictation_ws_handler)).route("/oauth/mcp/callback", get(oauth_mcp_callback_handler))// Dev-only: hand this core (URL + bearer) to a loopback Vite renderer.- .route("/dev/connect", get(crate::core::dev_connect::dev_connect_handler))+ .route(+ "/dev/connect",+ get(crate::core::dev_connect::dev_connect_handler),+ )// OpenAI-compatible inference endpoint (/v1/chat/completions, /v1/models).nest("/v1", crate::inference::http::router())// Apply `AppState` here so the outer router becomes `Router<()>` and