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 files

Steven Enamakel86c0668e2415
diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
index 5bb40dd8ea..4e1217de7b 100644
--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
@@ -317,7 +317,10 @@ fn build_routes_live_facts_to_the_web_tools_directly() {
assert!(body.contains("anything broader via deep `web_answer_tool`"));
assert!(body.contains("`depth: \"deep\"`"));
assert!(body.contains("`web_contents_tool`"));
- assert!(!body.contains("`research`"), "the removed research delegate must not be named");
+ assert!(
+ !body.contains("`research`"),
+ "the removed research delegate must not be named"
+ );
assert!(body.contains("weather, forecasts, prices, recent news"));
assert!(body.contains("\"use live data\""));
// A lead-in line is welcome, but only in the same message as the call.
diff --git a/crates/openhuman-core/src/agent/registry/defaults_tests.rs b/crates/openhuman-core/src/agent/registry/defaults_tests.rs
index a20032f39d..cae01d0e78 100644
--- a/crates/openhuman-core/src/agent/registry/defaults_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/defaults_tests.rs
@@ -6,7 +6,10 @@ fn default_agents_include_core_personas() {
let ids: Vec<&str> = agents.iter().map(|agent| agent.id.as_str()).collect();
assert!(ids.contains(&"orchestrator"));
assert!(ids.contains(&"planner"));
- assert!(!ids.contains(&"researcher"), "the researcher agent was removed");
+ assert!(
+ !ids.contains(&"researcher"),
+ "the researcher agent was removed"
+ );
assert!(ids.contains(&"code_executor"));
assert!(agents
.iter()
diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs b/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
index b95968c885..3fe222b86e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/harness_tool_registration.rs
@@ -13,10 +13,9 @@ use tinyagents_registry::{
};
use crate::agent::orchestration::tools::{
- CloseSubagentDispatch, ContinueSubagentDispatch,
- DelegateGraphDispatch, DelegationDispatch, ListSubagentsDispatch, SpawnAsyncSubagentDispatch,
- SpawnParallelAgentsDispatch, SpawnSubagentDispatch, SpawnWorkerThreadDispatch,
- SteerSubagentDispatch, WaitSubagentDispatch,
+ CloseSubagentDispatch, ContinueSubagentDispatch, DelegateGraphDispatch, DelegationDispatch,
+ ListSubagentsDispatch, SpawnAsyncSubagentDispatch, SpawnParallelAgentsDispatch,
+ SpawnSubagentDispatch, SpawnWorkerThreadDispatch, SteerSubagentDispatch, WaitSubagentDispatch,
};
use crate::agent::tinyagents::host::OpenHumanRunContext;
use crate::agent::tinyagents::tools::{CanonicalSharedToolAdapter, EarlyExitHook};
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
index 176145f44e..1179f5ec52 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
@@ -299,7 +299,5 @@ pub(crate) fn effective_max_iterations(max_iterations: usize) -> usize {
/// (`subagent_host::ops::runner`). Widen this predicate in lockstep if that
/// ever stops being true.
pub(crate) fn is_subagent_spawn_or_delegate_tool(name: &str) -> bool {
- name == "spawn_subagent"
- || name.starts_with("delegate_")
- || name == "spawn_worker_thread"
+ name == "spawn_subagent" || name.starts_with("delegate_") || name == "spawn_worker_thread"
}
diff --git a/crates/openhuman-core/src/config/mod.rs b/crates/openhuman-core/src/config/mod.rs
index 0d44cc7076..40761dc908 100644
--- a/crates/openhuman-core/src/config/mod.rs
+++ b/crates/openhuman-core/src/config/mod.rs
@@ -43,28 +43,29 @@ pub use schema::{
build_runtime_proxy_client_with_timeouts, output_language_directive, runtime_proxy_config,
set_runtime_proxy_config, AgentConfig, AuditConfig, AutonomyConfig, BrowserComputerUseConfig,
BrowserConfig, CapabilityProviderConfig, CapabilityProviderTrustState, ChannelsConfig,
- ComposioConfig, Config, ContextConfig, CostConfig, CronConfig, CurlConfig, DashboardConfig,
- DelegateAgentConfig, DiagramViewerConfig, DictationActivationMode, DictationConfig,
- DiscordConfig, DockerRuntimeConfig, EmailConfig, EmbeddingRouteConfig, GitbooksConfig,
- HeartbeatConfig, HttpHeader, HttpRequestConfig, IMessageConfig, IntegrationToggle,
- IntegrationsConfig, LarkConfig, LearningConfig, LegacySearchInputs, LinqConfig, LlmBackend,
- LocalAiConfig, MatrixConfig, McpAuthConfig, McpClientConfig, McpClientIdentityConfig,
- McpServerConfig, MemoryConfig, MemoryTreeConfig, ModelRouteConfig, MultimodalConfig,
- MultimodalFileConfig, ObservabilityConfig, OrchestratorModelConfig, PrivacyConfig, PrivacyMode,
- ProxyConfig, ProxyScope, ReflectionSource, ReliabilityConfig, ResourceLimitsConfig,
- RuntimeConfig, RuntimePoolConfig, RuntimePoolLangConfig, SandboxBackend, SandboxConfig,
- SchedulerConfig, SchedulerGateConfig, SchedulerGateMode, SearchConfig, SearchEngineCredentials,
- SearchPresentation, SearchProviderSettings, SearchRoute, SearxngConfig, SecretsConfig,
- SecurityConfig, ShellConfig, SlackConfig, StorageConfig, StorageProviderConfig,
- StorageProviderSection, StreamMode, SttEngine, TeamModelConfig, TelegramConfig,
- TokenjuiceConfig, UpdateConfig, UpdateRestartStrategy, VoiceActivationMode, VoiceServerConfig,
- WebSearchConfig, WebhookConfig, YuanbaoConfig, DEFAULT_CLOUD_LLM_MODEL,
- DEFAULT_MEMORY_SYNC_INTERVAL_SECS, DEFAULT_MODEL, LEGACY_TIER_MODELS,
- MANAGED_MULTIMODAL_MODELS, MANAGED_SEARCH_PROVIDERS, MEMORY_SYNC_INTERVAL_PRESETS_SECS,
- MODEL_IMAGE_GENERATION_AGENT, MODEL_MANAGED_DEFAULT, MODEL_MEDIA_UNDERSTANDING,
- MODEL_VIDEO_GENERATION_AGENT, SEARCH_ENGINE_BRAVE, SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA,
- SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL, SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY,
- SEARCH_PROVIDERS, SEARCH_ROLES, SEARCH_ROLE_ANSWER, SEARCH_ROLE_CONTENTS, SEARCH_ROLE_SEARCH,
+ ComposioConfig, ComputerConfig, Config, ContextConfig, CostConfig, CronConfig, CurlConfig,
+ DashboardConfig, DecisionModel, DelegateAgentConfig, DiagramViewerConfig,
+ DictationActivationMode, DictationConfig, DiscordConfig, DockerRuntimeConfig, EmailConfig,
+ EmbeddingRouteConfig, GitbooksConfig, HeartbeatConfig, HttpHeader, HttpRequestConfig,
+ IMessageConfig, IntegrationToggle, IntegrationsConfig, LarkConfig, LearningConfig,
+ LegacySearchInputs, LinqConfig, LlmBackend, LocalAiConfig, MatrixConfig, McpAuthConfig,
+ McpClientConfig, McpClientIdentityConfig, McpServerConfig, MemoryConfig, MemoryTreeConfig,
+ ModelRouteConfig, MultimodalConfig, MultimodalFileConfig, ObservabilityConfig,
+ OrchestratorModelConfig, PrivacyConfig, PrivacyMode, ProxyConfig, ProxyScope, ReflectionSource,
+ ReliabilityConfig, ResourceLimitsConfig, RuntimeConfig, RuntimePoolConfig,
+ RuntimePoolLangConfig, SandboxBackend, SandboxConfig, SchedulerConfig, SchedulerGateConfig,
+ SchedulerGateMode, SearchConfig, SearchEngineCredentials, SearchPresentation,
+ SearchProviderSettings, SearchRoute, SearxngConfig, SecretsConfig, SecurityConfig, ShellConfig,
+ SlackConfig, StorageConfig, StorageProviderConfig, StorageProviderSection, StreamMode,
+ SttEngine, TeamModelConfig, TelegramConfig, TokenjuiceConfig, UpdateConfig,
+ UpdateRestartStrategy, VoiceActivationMode, VoiceServerConfig, WebSearchConfig, WebhookConfig,
+ YuanbaoConfig, DEFAULT_CLOUD_LLM_MODEL, DEFAULT_MEMORY_SYNC_INTERVAL_SECS, DEFAULT_MODEL,
+ LEGACY_TIER_MODELS, MANAGED_MULTIMODAL_MODELS, MANAGED_SEARCH_PROVIDERS,
+ MEMORY_SYNC_INTERVAL_PRESETS_SECS, MODEL_IMAGE_GENERATION_AGENT, MODEL_MANAGED_DEFAULT,
+ MODEL_MEDIA_UNDERSTANDING, MODEL_VIDEO_GENERATION_AGENT, SEARCH_ENGINE_BRAVE,
+ SEARCH_ENGINE_DISABLED, SEARCH_ENGINE_EXA, SEARCH_ENGINE_MANAGED, SEARCH_ENGINE_PARALLEL,
+ SEARCH_ENGINE_QUERIT, SEARCH_ENGINE_TAVILY, SEARCH_PROVIDERS, SEARCH_ROLES, SEARCH_ROLE_ANSWER,
+ SEARCH_ROLE_CONTENTS, SEARCH_ROLE_SEARCH,
};
// Kept as a separate re-export (issue #4117) so the large alphabetized group
// above stays byte-identical and rustfmt-stable.
diff --git a/crates/openhuman-core/src/config/ops/computer.rs b/crates/openhuman-core/src/config/ops/computer.rs
index ad369790e2..0c3b767879 100644
--- a/crates/openhuman-core/src/config/ops/computer.rs
+++ b/crates/openhuman-core/src/config/ops/computer.rs
@@ -43,7 +43,10 @@ fn model_id(raw: String) -> Result<Option<String>, String> {
}
/// Apply `update` to a copy of `[computer]`, validating every field first.
-pub fn patched(current: &ComputerConfig, update: ComputerSettingsPatch) -> Result<ComputerConfig, String> {
+pub fn patched(
+ current: &ComputerConfig,
+ update: ComputerSettingsPatch,
+) -> Result<ComputerConfig, String> {
let mut computer = current.clone();
if let Some(raw) = update.decision_model {
computer.decision_model = parse_decision_model(&raw)?;
diff --git a/crates/openhuman-core/src/config/ops/computer_tests.rs b/crates/openhuman-core/src/config/ops/computer_tests.rs
index a023740d79..408057543b 100644
--- a/crates/openhuman-core/src/config/ops/computer_tests.rs
+++ b/crates/openhuman-core/src/config/ops/computer_tests.rs
@@ -15,7 +15,10 @@ fn patch_selects_decision_model_and_rescue_settings() {
.unwrap();
assert_eq!(next.decision_model, DecisionModel::OpenJev);
assert_eq!(next.rescue_model.as_deref(), Some("openai/gpt-6-luna"));
- assert_eq!(next.planner_model.as_deref(), Some("anthropic/claude-sonnet-5"));
+ assert_eq!(
+ next.planner_model.as_deref(),
+ Some("anthropic/claude-sonnet-5")
+ );
assert_eq!(next.max_rescues, Some(0));
assert!(next.sage_fast);
}
diff --git a/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs b/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs
index 02e6695d62..9780e5e26e 100644
--- a/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs
+++ b/crates/openhuman-core/src/config/schema/tools/search_search_config_tests_tests.rs
@@ -340,9 +340,8 @@ fn credentials_resolve_per_provider() {
#[test]
fn v2_managed_tinyfish_without_a_key_is_turned_off() {
- let mut cfg = legacy(
- "schema_version = 2\n[providers.tinyfish]\nenabled = true\nroute = \"managed\"\n",
- );
+ let mut cfg =
+ legacy("schema_version = 2\n[providers.tinyfish]\nenabled = true\nroute = \"managed\"\n");
assert!(cfg.migrate_legacy(LegacySearchInputs::default()));
assert_eq!(
provider(&cfg, "tinyfish"),
diff --git a/crates/openhuman-core/src/config/schemas/controllers/agent.rs b/crates/openhuman-core/src/config/schemas/controllers/agent.rs
index 363e1b163c..7113b1a3d0 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/agent.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/agent.rs
@@ -7,8 +7,8 @@ use crate::core::all::ControllerFuture;
use super::super::helpers::{
deserialize_params, to_json, AgentSettingsUpdate, AutonomySettingsUpdate,
- BrowserSettingsUpdate, ComputerSettingsUpdate, MemorySyncSettingsUpdate, PrivacyModeUpdate, SandboxSettingsUpdate,
- SetBrowserAllowAllParams,
+ BrowserSettingsUpdate, ComputerSettingsUpdate, MemorySyncSettingsUpdate, PrivacyModeUpdate,
+ SandboxSettingsUpdate, SetBrowserAllowAllParams,
};
pub(crate) fn handle_get_autonomy_settings(_params: Map<String, Value>) -> ControllerFuture {
diff --git a/crates/openhuman-core/src/config/schemas/controllers/registry.rs b/crates/openhuman-core/src/config/schemas/controllers/registry.rs
index dc3f15ca1e..f2867c5ffc 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/registry.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/registry.rs
@@ -8,8 +8,8 @@ use super::agent::{
handle_get_agent_settings, handle_get_autonomy_settings, handle_get_memory_sync_settings,
handle_get_privacy_mode, handle_get_sandbox_settings, handle_set_browser_allow_all,
handle_set_privacy_mode, handle_update_agent_settings, handle_update_autonomy_settings,
- handle_update_browser_settings, handle_update_computer_settings, handle_update_memory_sync_settings,
- handle_update_sandbox_settings,
+ handle_update_browser_settings, handle_update_computer_settings,
+ handle_update_memory_sync_settings, handle_update_sandbox_settings,
};
use super::inference::{
handle_get_client_config, handle_get_config, handle_get_runtime_flags, handle_resolve_api_url,
diff --git a/crates/openhuman-core/src/modules/browser.rs b/crates/openhuman-core/src/modules/browser.rs
index 155cd66c5c..c93794ea8d 100644
--- a/crates/openhuman-core/src/modules/browser.rs
+++ b/crates/openhuman-core/src/modules/browser.rs
@@ -10,9 +10,9 @@ use std::sync::Arc;
use serde::{de::DeserializeOwned, Serialize};
use tinycomputer_bus::agent::Capabilities;
use tinycomputer_bus::browser::{
- names, Action, ActionOutcome, DownloadInfo, DownloadWaitRequest, NavigateRequest, PageState, PageText,
- ReadRequest, SessionId, SessionInfo, SessionOptions, SessionRef, SessionRequest, Snapshot,
- SnapshotRequest, Viewport,
+ names, Action, ActionOutcome, DownloadInfo, DownloadWaitRequest, NavigateRequest, PageState,
+ PageText, ReadRequest, SessionId, SessionInfo, SessionOptions, SessionRef, SessionRequest,
+ Snapshot, SnapshotRequest, Viewport,
};
use tinycomputer_bus::DesktopResponse;
@@ -190,7 +190,10 @@ impl BrowserClient {
) -> Result<PageState, BrowserCallError> {
self.check_url(&request.url)?;
let page: PageState = self
- .call(names::methods::NAVIGATE, SessionRequest::new(session.clone(), request))
+ .call(
+ names::methods::NAVIGATE,
+ SessionRequest::new(session.clone(), request),
+ )
.await?;
self.check_returned_url(&page.url)?;
Ok(page)
@@ -202,7 +205,10 @@ impl BrowserClient {
request: SnapshotRequest,
) -> Result<Snapshot, BrowserCallError> {
let snapshot: Snapshot = self
- .call(names::methods::SNAPSHOT, SessionRequest::new(session.clone(), request))
+ .call(
+ names::methods::SNAPSHOT,
+ SessionRequest::new(session.clone(), request),
+ )
.await?;
self.check_returned_url(&snapshot.url)?;
Ok(snapshot)
@@ -214,7 +220,10 @@ impl BrowserClient {
action: Action,
) -> Result<ActionOutcome, BrowserCallError> {
let outcome: ActionOutcome = self
- .call(names::methods::PERFORM, SessionRequest::new(session.clone(), action))
+ .call(
+ names::methods::PERFORM,
+ SessionRequest::new(session.clone(), action),
+ )
.await?;
self.check_returned_url(&outcome.page.url)?;
Ok(outcome)
@@ -226,7 +235,10 @@ impl BrowserClient {
request: ReadRequest,
) -> Result<PageText, BrowserCallError> {
let page: PageText = self
- .call(names::methods::READ_PAGE, SessionRequest::new(session.clone(), request))
+ .call(
+ names::methods::READ_PAGE,
+ SessionRequest::new(session.clone(), request),
+ )
.await?;
self.check_returned_url(&page.url)?;
Ok(page)
@@ -249,7 +261,7 @@ impl BrowserClient {
names::methods::WAIT_DOWNLOAD,
SessionRequest::new(session.clone(), request),
)
- .await
+ .await
}
pub async fn close_session(&self, session: &SessionId) -> Result<(), BrowserCallError> {
diff --git a/crates/openhuman-core/src/modules/browser_task.rs b/crates/openhuman-core/src/modules/browser_task.rs
index 76c21b64c3..3a58410acc 100644
--- a/crates/openhuman-core/src/modules/browser_task.rs
+++ b/crates/openhuman-core/src/modules/browser_task.rs
@@ -127,8 +127,7 @@ pub async fn cancel(config: &Config, id: TaskId) -> Result<TaskView, String> {
}
async fn follow(config: &Config, mut view: TaskView) -> Result<TaskView, String> {
- let deadline =
- Instant::now() + Duration::from_secs(config.browser.task_timeout_secs.max(1));
+ let deadline = Instant::now() + Duration::from_secs(config.browser.task_timeout_secs.max(1));
while matches!(view.status, tinycomputer_bus::agent::TaskStatus::Running) {
let left = deadline.saturating_duration_since(Instant::now());
if left.is_zero() {
diff --git a/crates/openhuman-core/src/tools/impl/browser/browser.rs b/crates/openhuman-core/src/tools/impl/browser/browser.rs
index 258e44b6d5..572299e371 100644
--- a/crates/openhuman-core/src/tools/impl/browser/browser.rs
+++ b/crates/openhuman-core/src/tools/impl/browser/browser.rs
@@ -19,9 +19,9 @@ use std::{
sync::{Arc, Mutex as StdMutex},
time::Instant,
};
-use tinycomputer_bus::agent::{ContinueTaskRequest, TaskId, TaskStatus, TaskView};
#[cfg(test)]
use std::{collections::HashMap, time::Duration};
+use tinycomputer_bus::agent::{ContinueTaskRequest, TaskId, TaskStatus, TaskView};
use tinycomputer_bus::browser::{
Action, DownloadState, DownloadWaitRequest, LocateBy, Locator, NavigateRequest, ReadRequest,
ScrollDirection, SessionId, SessionOptions, SnapshotRequest, Target, WaitState,
@@ -560,13 +560,15 @@ async fn approve_task_action(pending: &Pending) -> anyhow::Result<bool> {
&digest_hex[..12]
);
let args = json!({"action": "task_step", "target": summary, "exact_action_sha256": digest_hex});
- Ok(match gate.intercept_forced("browser", &summary, args).await {
- GateOutcome::Allow => true,
- GateOutcome::Deny { reason } => {
- tracing::debug!(%reason, "[browser] task action denied by host");
- false
- }
- })
+ Ok(
+ match gate.intercept_forced("browser", &summary, args).await {
+ GateOutcome::Allow => true,
+ GateOutcome::Deny { reason } => {
+ tracing::debug!(%reason, "[browser] task action denied by host");
+ false
+ }
+ },
+ )
}
fn required<'a>(args: &'a Value, key: &str) -> anyhow::Result<&'a str> {
diff --git a/crates/openhuman-core/src/tools/impl/browser/browser_computer_tests.rs b/crates/openhuman-core/src/tools/impl/browser/browser_computer_tests.rs
index b5dbdbf0f8..c172ae00a0 100644
--- a/crates/openhuman-core/src/tools/impl/browser/browser_computer_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/browser/browser_computer_tests.rs
@@ -125,7 +125,13 @@ async fn needs_approval_view_is_held_behind_a_token_and_cleared_by_other_states(
let output = tool.report(paused).await.unwrap();
let token = output["pending"]["token"].as_str().unwrap().to_owned();
assert_eq!(output["pending"]["task_id"], "t-1");
- assert!(tool.pending.lock().await.as_ref().unwrap().matches(&json!({"token": token})));
+ assert!(tool
+ .pending
+ .lock()
+ .await
+ .as_ref()
+ .unwrap()
+ .matches(&json!({"token": token})));
let done: TaskView = serde_json::from_value(json!({
"id": "t-1",