Skip to content

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

chore: reorder imports and reformat assertions

Steven Enamakel25ff6845b0dd
diff --git a/crates/openhuman-core/src/agent/message_convert.rs b/crates/openhuman-core/src/agent/message_convert.rs
index c502bf4e28..b58174eb1b 100644
--- a/crates/openhuman-core/src/agent/message_convert.rs
+++ b/crates/openhuman-core/src/agent/message_convert.rs
@@ -26,8 +26,8 @@ use crate::inference::provider::ChatResponse;
use tinyagents_runtime::transcript::reasoning_from_content;
#[cfg(test)]
use tinyagents_runtime::transcript::{
- REASONING_EXT_KEY, message_to_display_transcript as message_to_chat_message,
- message_to_native_transcript as message_to_native_chat_message,
+ message_to_display_transcript as message_to_chat_message,
+ message_to_native_transcript as message_to_native_chat_message, REASONING_EXT_KEY,
};
use tinyagents_session::transcript::TranscriptMessage;
diff --git a/crates/openhuman-core/src/agent/message_convert_tests.rs b/crates/openhuman-core/src/agent/message_convert_tests.rs
index 3b65b50c94..9d6acf4d5f 100644
--- a/crates/openhuman-core/src/agent/message_convert_tests.rs
+++ b/crates/openhuman-core/src/agent/message_convert_tests.rs
@@ -26,21 +26,18 @@ fn durable_upload_parts_survive_message_row_replay_without_inline_payloads() {
let Message::User(user) = replay else {
panic!("user row expected")
};
- assert!(
- user.content
- .iter()
- .any(|part| matches!(part, ContentBlock::Audio(MediaRef::Path { .. })))
- );
- assert!(
- user.content
- .iter()
- .any(|part| matches!(part, ContentBlock::Video(MediaRef::Path { .. })))
- );
- assert!(
- user.content
- .iter()
- .any(|part| matches!(part, ContentBlock::Document(MediaRef::Path { .. })))
- );
+ assert!(user
+ .content
+ .iter()
+ .any(|part| matches!(part, ContentBlock::Audio(MediaRef::Path { .. }))));
+ assert!(user
+ .content
+ .iter()
+ .any(|part| matches!(part, ContentBlock::Video(MediaRef::Path { .. }))));
+ assert!(user
+ .content
+ .iter()
+ .any(|part| matches!(part, ContentBlock::Document(MediaRef::Path { .. }))));
assert!(!serde_json::to_string(&row).unwrap().contains("base64"));
}
use tinyinference_llm::model::ModelRequest;
@@ -307,12 +304,10 @@ fn reasoning_content_uses_typed_thinking_block_and_round_trips_metadata() {
ContentBlock::Thinking { text, signature: None } if text == "private thoughts"
)
}));
- assert!(
- !assistant
- .content
- .iter()
- .any(|block| matches!(block, ContentBlock::ProviderExtension(_)))
- );
+ assert!(!assistant
+ .content
+ .iter()
+ .any(|block| matches!(block, ContentBlock::ProviderExtension(_))));
let back = message_to_chat_message(&msg).expect("assistant converts");
assert_eq!(back.content, "visible answer");
diff --git a/crates/openhuman-core/src/agent/session_host/orphaned_head_resume_tests.rs b/crates/openhuman-core/src/agent/session_host/orphaned_head_resume_tests.rs
index 22f77f5783..fc9636e67a 100644
--- a/crates/openhuman-core/src/agent/session_host/orphaned_head_resume_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/orphaned_head_resume_tests.rs
@@ -180,9 +180,7 @@ async fn resumed_orphaned_tool_head_is_repaired_before_the_request() {
!matches!(first_non_system, Message::Tool(_)),
"the request must not open on an orphaned tool result, got {first_non_system:?}"
);
- assert!(
- !sent
- .iter()
- .any(|m| matches!(m, Message::Tool(t) if t.tool_call_id.starts_with("call_orphan")))
- );
+ assert!(!sent
+ .iter()
+ .any(|m| matches!(m, Message::Tool(t) if t.tool_call_id.starts_with("call_orphan"))));
}
diff --git a/crates/openhuman-core/src/agent/tinyagents/stop_hooks.rs b/crates/openhuman-core/src/agent/tinyagents/stop_hooks.rs
index f2d050d4ef..b18b678cb3 100644
--- a/crates/openhuman-core/src/agent/tinyagents/stop_hooks.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/stop_hooks.rs
@@ -2,8 +2,8 @@
use crate::agent::cost::TurnCost;
use std::sync::Arc;
-use tinyagents_harness::middleware::StopHook;
use tinyagents_harness::middleware::library::{StopHookMetrics, StopHookMiddleware};
+use tinyagents_harness::middleware::StopHook;
use tinyagents_harness::steering::SteeringHandle;
use tinyinference_llm::model::ModelResponse;
diff --git a/crates/openhuman-core/src/agent/tinyagents/stop_hooks_tests.rs b/crates/openhuman-core/src/agent/tinyagents/stop_hooks_tests.rs
index 80b4381848..0c24967d0e 100644
--- a/crates/openhuman-core/src/agent/tinyagents/stop_hooks_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/stop_hooks_tests.rs
@@ -4,14 +4,12 @@ use super::*;
fn a_poisoned_halt_summary_does_not_abort_stop_reporting() {
let slot: super::super::HaltSummarySlot = Arc::new(std::sync::Mutex::new(None));
let poisoned = Arc::clone(&slot);
- assert!(
- std::thread::spawn(move || {
- let _guard = poisoned.lock().unwrap();
- panic!("synthetic prior writer failure");
- })
- .join()
- .is_err()
- );
+ assert!(std::thread::spawn(move || {
+ let _guard = poisoned.lock().unwrap();
+ panic!("synthetic prior writer failure");
+ })
+ .join()
+ .is_err());
record_halt_summary(
&slot,
&tinyagents_harness::middleware::library::StopReport {
diff --git a/crates/openhuman-embed/src/agent/approval_handler.rs b/crates/openhuman-embed/src/agent/approval_handler.rs
index a3d4c3ac10..68e4174f38 100644
--- a/crates/openhuman-embed/src/agent/approval_handler.rs
+++ b/crates/openhuman-embed/src/agent/approval_handler.rs
@@ -1,6 +1,6 @@
//! Callback-based approvals, using the same agent-scoped gate as polling.
use crate::{ApprovalDecision, Approvals, CancellationToken, PendingApproval};
-use openhuman_core::core::bus::{BUS, EventHandler, SubscriptionHandle};
+use openhuman_core::core::bus::{EventHandler, SubscriptionHandle, BUS};
use openhuman_core::core::events::DomainEvent;
use std::sync::Arc;
diff --git a/crates/openhuman-embed/src/agent/build_tests.rs b/crates/openhuman-embed/src/agent/build_tests.rs
index 543106656e..b8c000feef 100644
--- a/crates/openhuman-embed/src/agent/build_tests.rs
+++ b/crates/openhuman-embed/src/agent/build_tests.rs
@@ -67,12 +67,10 @@ fn sub_agents_become_workers_in_a_catalogue_of_the_agents_own() {
own.get("orchestrator").is_some(),
"built-ins stay reachable"
);
- assert!(
- definition
- .subagents
- .iter()
- .any(|entry| matches!(entry, SubagentEntry::AgentId(id) if id == "lead-helper"))
- );
+ assert!(definition
+ .subagents
+ .iter()
+ .any(|entry| matches!(entry, SubagentEntry::AgentId(id) if id == "lead-helper")));
assert!(catalogue.get("lead-helper").is_none());
}
diff --git a/crates/openhuman-embed/src/agent/definition_tests.rs b/crates/openhuman-embed/src/agent/definition_tests.rs
index cb706713ab..b4c4355cea 100644
--- a/crates/openhuman-embed/src/agent/definition_tests.rs
+++ b/crates/openhuman-embed/src/agent/definition_tests.rs
@@ -85,13 +85,11 @@ fn tool_rules_reach_the_core_definition() {
.into_core("narrow")
.unwrap();
assert_eq!(def.tool_rules, Some(rules));
- assert!(
- AgentDefinitionSpec::new()
- .into_core("open")
- .unwrap()
- .tool_rules
- .is_none()
- );
+ assert!(AgentDefinitionSpec::new()
+ .into_core("open")
+ .unwrap()
+ .tool_rules
+ .is_none());
}
#[test]
@@ -122,12 +120,10 @@ fn template_overrides_are_independent_and_keep_restrictions() {
assert_eq!(first.temperature, 0.3);
assert_eq!(second.temperature, 0.8);
assert_eq!(second.max_iterations, 7);
- assert!(
- AgentDefinitionSpec::new()
- .tools(ToolScopeSpec::Wildcard)
- .inherit(template)
- .is_err()
- );
+ assert!(AgentDefinitionSpec::new()
+ .tools(ToolScopeSpec::Wildcard)
+ .inherit(template)
+ .is_err());
}
#[test]
fn base_can_be_named_or_custom_and_unknown_names_are_typed() {
diff --git a/crates/openhuman-embed/src/agent/lifecycle.rs b/crates/openhuman-embed/src/agent/lifecycle.rs
index 6efd5eed3f..28d1d3a5bb 100644
--- a/crates/openhuman-embed/src/agent/lifecycle.rs
+++ b/crates/openhuman-embed/src/agent/lifecycle.rs
@@ -5,7 +5,7 @@ use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};
use std::time::Duration;
-use tokio::sync::{Notify, watch};
+use tokio::sync::{watch, Notify};
use crate::CoreError;
diff --git a/crates/openhuman-embed/src/agent/mod.rs b/crates/openhuman-embed/src/agent/mod.rs
index 5d786ad1f7..13ea47e015 100644
--- a/crates/openhuman-embed/src/agent/mod.rs
+++ b/crates/openhuman-embed/src/agent/mod.rs
@@ -37,9 +37,9 @@ use openhuman_core::agent::harness::definition::AgentDefinition;
use openhuman_core::config::Config;
use openhuman_core::core::runtime::{CoreContext, CoreRuntime};
-use crate::CoreError;
use crate::harness::{Access, Provider};
use crate::turn::{Turn, TurnOutcome, TurnTarget};
+use crate::CoreError;
/// Error from instantiating or driving an [`Agent`].
#[derive(Debug, thiserror::Error)]
diff --git a/crates/openhuman-embed/src/agent/spec.rs b/crates/openhuman-embed/src/agent/spec.rs
index e7f96657d4..286cdf0783 100644
--- a/crates/openhuman-embed/src/agent/spec.rs
+++ b/crates/openhuman-embed/src/agent/spec.rs
@@ -417,11 +417,11 @@ impl AgentSpec {
pub fn tools(
mut self,
f: impl for<'a> Fn(
- openhuman_core::agent::TurnContext<'a>,
- ) -> openhuman_core::agent::HostTurnTools
- + Send
- + Sync
- + 'static,
+ openhuman_core::agent::TurnContext<'a>,
+ ) -> openhuman_core::agent::HostTurnTools
+ + Send
+ + Sync
+ + 'static,
) -> Self {
self.host_tools = Some(std::sync::Arc::new(f));
self
diff --git a/crates/openhuman-embed/src/agent/spec_tests.rs b/crates/openhuman-embed/src/agent/spec_tests.rs
index 5f42183ca8..cc5005f658 100644
--- a/crates/openhuman-embed/src/agent/spec_tests.rs
+++ b/crates/openhuman-embed/src/agent/spec_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use crate::AgentError;
use crate::agent::build::{check_domains_narrow, check_tool_groups_narrow};
+use crate::AgentError;
use openhuman_core::tools::toolpacks::GroupMode;
#[test]
diff --git a/crates/openhuman-embed/src/artifacts.rs b/crates/openhuman-embed/src/artifacts.rs
index 07b4088f21..8bc9708aa8 100644
--- a/crates/openhuman-embed/src/artifacts.rs
+++ b/crates/openhuman-embed/src/artifacts.rs
@@ -4,9 +4,9 @@
//! The constructors below the line exist for host tests that need a real
//! artifact on disk; production hosts only resolve.
-pub use openhuman_core::agent::artifacts::{FileRoots, resolve_ready_file};
+pub use openhuman_core::agent::artifacts::{resolve_ready_file, FileRoots};
#[doc(hidden)]
pub use openhuman_core::agent::artifacts::{
- ArtifactKind, ArtifactMeta, ArtifactStatus, create_artifact, finalize_artifact,
+ create_artifact, finalize_artifact, ArtifactKind, ArtifactMeta, ArtifactStatus,
};
diff --git a/crates/openhuman-embed/src/call.rs b/crates/openhuman-embed/src/call.rs
index 3114cbebcc..aa70bfbeef 100644
--- a/crates/openhuman-embed/src/call.rs
+++ b/crates/openhuman-embed/src/call.rs
@@ -36,8 +36,8 @@
//! log line. [`unwrap_outcome_envelope`] absorbs that here so no facade method
//! and no host has to think about it.
-use serde::Serialize;
use serde::de::DeserializeOwned;
+use serde::Serialize;
use super::error::CoreError;
use openhuman_core::core::runtime::CoreRuntime;
diff --git a/crates/openhuman-embed/src/cancellation.rs b/crates/openhuman-embed/src/cancellation.rs
index b1f9e99cc4..be5eb0a3fd 100644
--- a/crates/openhuman-embed/src/cancellation.rs
+++ b/crates/openhuman-embed/src/cancellation.rs
@@ -47,6 +47,6 @@ impl Cancellation {
pub(crate) struct Guard(Cancellation);
impl Drop for Guard {
fn drop(&mut self) {
- self.0.0.active.send_modify(|count| *count -= 1);
+ self.0 .0.active.send_modify(|count| *count -= 1);
}
}
diff --git a/crates/openhuman-embed/src/chat_surface.rs b/crates/openhuman-embed/src/chat_surface.rs
index dc52bdff56..1fd074ac22 100644
--- a/crates/openhuman-embed/src/chat_surface.rs
+++ b/crates/openhuman-embed/src/chat_surface.rs
@@ -6,6 +6,6 @@
//! then reads it with [`subscribe_web_channel_events`].
pub use openhuman_core::web_chat::{
- WebChannelEvent, publish_web_channel_event, register_approval_surface_subscriber,
- register_artifact_surface_subscriber, subscribe_web_channel_events,
+ publish_web_channel_event, register_approval_surface_subscriber,
+ register_artifact_surface_subscriber, subscribe_web_channel_events, WebChannelEvent,
};
diff --git a/crates/openhuman-embed/src/complete.rs b/crates/openhuman-embed/src/complete.rs
index 2386d7ca18..1e4db46008 100644
--- a/crates/openhuman-embed/src/complete.rs
+++ b/crates/openhuman-embed/src/complete.rs
@@ -53,7 +53,7 @@ use tinyinference_llm::message::{ContentBlock, ImageRef, Message, UserMessage};
use tinyinference_llm::model::{ModelRequest, ModelResponse};
use crate::error::CoreError;
-use crate::turn::{Route, is_safe_endpoint_for_bearer, sanitize_url_for_display};
+use crate::turn::{is_safe_endpoint_for_bearer, sanitize_url_for_display, Route};
/// Method label carried by every [`CoreError`] this module returns.
pub const COMPLETE: &str = "openhuman.complete";
@@ -539,7 +539,7 @@ impl Completer {
mut request: CompletionRequest,
) -> Result<CompletionResponse, CoreError> {
use crate::structured::{
- StructuredFailureReason, StructuredOutputFailure, Validator, accumulate,
+ accumulate, StructuredFailureReason, StructuredOutputFailure, Validator,
};
let initial_failure = |reason| CoreError::StructuredOutput {
method: COMPLETE,
diff --git a/crates/openhuman-embed/src/config.rs b/crates/openhuman-embed/src/config.rs
index 3be48d5e9b..6990e17108 100644
--- a/crates/openhuman-embed/src/config.rs
+++ b/crates/openhuman-embed/src/config.rs
@@ -70,12 +70,12 @@ pub use tinytools::{
DefaultEffect, Patterns, RuleEffect, Surface, ToolMatcher, ToolRule, ToolRules,
};
-/// The core's config type, as [`crate::RuntimeConfig`].
-pub use openhuman_core::config::Config as RuntimeConfig;
/// Typed runtime builder policy groups from the core configuration contract.
pub use openhuman_core::config::schema::{
AutonomyConfig, CronConfig, PrivacyConfig, PrivacyMode, SecretsConfig,
};
+/// The core's config type, as [`crate::RuntimeConfig`].
+pub use openhuman_core::config::Config as RuntimeConfig;
/// Load `config.toml` (creating defaults when absent) with the environment
/// overlay and per-user scoping — what a core with no supplied config boots
diff --git a/crates/openhuman-embed/src/embeddings.rs b/crates/openhuman-embed/src/embeddings.rs
index 65ed53e053..9dac1faa72 100644
--- a/crates/openhuman-embed/src/embeddings.rs
+++ b/crates/openhuman-embed/src/embeddings.rs
@@ -16,11 +16,11 @@
//! [`Runtime`](crate::Runtime).
pub use tinyinference_embeddings::{
- COHERE_API_BASE, COHERE_DEFAULT_DIMENSIONS, COHERE_DEFAULT_MODEL, CohereEmbeddingModel,
+ format_embedding_signature, set_rate_limit, CohereEmbeddingModel, EmbeddingModel,
+ MockEmbeddingModel, NoopEmbeddingModel, OllamaEmbeddingModel, OpenAiEmbeddingModel,
+ VoyageEmbeddingModel, COHERE_API_BASE, COHERE_DEFAULT_DIMENSIONS, COHERE_DEFAULT_MODEL,
DEFAULT_OLLAMA_DIMENSIONS, DEFAULT_OLLAMA_MODEL, DEFAULT_OLLAMA_URL,
- DEFAULT_REQUESTS_PER_MINUTE, EmbeddingModel, MockEmbeddingModel, NoopEmbeddingModel,
- OllamaEmbeddingModel, OpenAiEmbeddingModel, VOYAGE_API_BASE, VOYAGE_DEFAULT_DIMENSIONS,
- VOYAGE_DEFAULT_MODEL, VoyageEmbeddingModel, format_embedding_signature, set_rate_limit,
+ DEFAULT_REQUESTS_PER_MINUTE, VOYAGE_API_BASE, VOYAGE_DEFAULT_DIMENSIONS, VOYAGE_DEFAULT_MODEL,
};
/// Errors the embedding models return.
pub use tinyinference_embeddings::{Error as EmbeddingError, Result as EmbeddingResult};
diff --git a/crates/openhuman-embed/src/error.rs b/crates/openhuman-embed/src/error.rs
index 524c7305eb..387d1944c5 100644
--- a/crates/openhuman-embed/src/error.rs
+++ b/crates/openhuman-embed/src/error.rs
@@ -20,8 +20,8 @@
//! facade classifies it. A host that cannot make that distinction renders a
//! scary red error where it should simply hide a tab.
-use openhuman_core::core::StructuredRpcError;
use openhuman_core::core::dispatch::UNKNOWN_METHOD_PREFIX;
+use openhuman_core::core::StructuredRpcError;
/// Error returned by every typed facade call.
#[derive(Debug, thiserror::Error)]
diff --git a/crates/openhuman-embed/src/events.rs b/crates/openhuman-embed/src/events.rs
index 89f1d516ed..5a2dd8162e 100644
--- a/crates/openhuman-embed/src/events.rs
+++ b/crates/openhuman-embed/src/events.rs
@@ -1,7 +1,7 @@
//! Content-free runtime observations with bounded, explicit backpressure.
use futures_core::Stream;
-use openhuman_core::core::bus::{BUS, EventHandler, SubscriptionHandle};
+use openhuman_core::core::bus::{EventHandler, SubscriptionHandle, BUS};
use openhuman_core::core::events::DomainEvent;
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, BTreeSet};
@@ -9,7 +9,7 @@ use std::pin::Pin;
use std::sync::{Arc, Mutex, Weak};
use std::task::{Context, Poll};
use tokio::sync::broadcast;
-use tokio_stream::wrappers::{BroadcastStream, errors::BroadcastStreamRecvError};
+use tokio_stream::wrappers::{errors::BroadcastStreamRecvError, BroadcastStream};
/// Metadata about one runtime transition; never includes user/tool payloads.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
diff --git a/crates/openhuman-embed/src/harness/builder.rs b/crates/openhuman-embed/src/harness/builder.rs
index ce3f73e216..5da75a5a80 100644
--- a/crates/openhuman-embed/src/harness/builder.rs
+++ b/crates/openhuman-embed/src/harness/builder.rs
@@ -9,14 +9,14 @@
use std::path::PathBuf;
-use super::Harness;
use super::access::Access;
use super::error::HarnessError;
use super::provider::Provider;
use super::workspace::Workspace;
-use crate::Session;
+use super::Harness;
use crate::agent::AgentSpec;
use crate::runtime::RuntimeBuilder;
+use crate::Session;
use openhuman_core::config::Config;
use openhuman_core::core::runtime::{DomainSet, ServiceSet};
use openhuman_core::core::types::HostKind;
@@ -130,11 +130,11 @@ impl HarnessBuilder {
pub fn tools(
mut self,
f: impl for<'a> Fn(
- openhuman_core::agent::TurnContext<'a>,
- ) -> openhuman_core::agent::HostTurnTools
- + Send
- + Sync
- + 'static,
+ openhuman_core::agent::TurnContext<'a>,
+ ) -> openhuman_core::agent::HostTurnTools
+ + Send
+ + Sync
+ + 'static,
) -> Self {
self.host_tools = Some(std::sync::Arc::new(f));
self
diff --git a/crates/openhuman-embed/src/harness/mod.rs b/crates/openhuman-embed/src/harness/mod.rs
index c0c4f5b5c1..4a89a6b1e6 100644
--- a/crates/openhuman-embed/src/harness/mod.rs
+++ b/crates/openhuman-embed/src/harness/mod.rs
@@ -101,10 +101,10 @@ pub use workspace::Workspace;
use std::path::Path;
-use crate::Core;
use crate::agent::Agent;
use crate::runtime::Runtime;
use crate::turn::{Turn, TurnOutcome};
+use crate::Core;
/// An embedded OpenHuman agent harness: one runtime, one agent.
///
diff --git a/crates/openhuman-embed/src/host_internals.rs b/crates/openhuman-embed/src/host_internals.rs
index dcec2d57de..c92bbb5ab9 100644
--- a/crates/openhuman-embed/src/host_internals.rs
+++ b/crates/openhuman-embed/src/host_internals.rs
@@ -20,16 +20,16 @@ pub use openhuman_core::run_core_from_args;
/// Shared by tinyhumans (hosted controllers) and rpc (`http_host`, `/health`).
pub mod core {
pub use openhuman_core::core::{
- ControllerSchema, FieldSchema, Outcome, StructuredRpcError, TypeSchema, unwrap_rpc,
+ unwrap_rpc, ControllerSchema, FieldSchema, Outcome, StructuredRpcError, TypeSchema,
};
pub mod all {
// tinyhumans: hosted controller extension; rpc: http_host + `/health`.
pub use openhuman_core::core::all::{
- ControllerExtension, ControllerFuture, DomainGroup, RegisteredController,
all_controller_schemas, all_http_method_schemas, cli_handler_for_namespace,
namespace_description, register_controller_extension, rpc_method_from_parts,
- schema_for_rpc_method,
+ schema_for_rpc_method, ControllerExtension, ControllerFuture, DomainGroup,
+ RegisteredController,
};
}
@@ -37,30 +37,30 @@ pub mod core {
/// RPC handler and classifier (rpc).
pub mod observability {
pub use openhuman_core::core::observability::{
- API_KEY_REJECTED_PREFIX, BACKEND_UNAVAILABLE_PREFIX, ExpectedErrorKind,
- REPORT_ERROR_TRACING_TARGET, contains_transient_transport_phrase, expected_error_kind,
- is_api_key_rejected_message, is_session_expired_message,
- is_suppressed_usage_probe_backoff, is_transient_http_status_code,
- is_transient_message_failure, report_error_or_expected, report_warning_message,
+ contains_transient_transport_phrase, expected_error_kind, is_api_key_rejected_message,
+ is_session_expired_message, is_suppressed_usage_probe_backoff,
+ is_transient_http_status_code, is_transient_message_failure, report_error_or_expected,
+ report_warning_message, ExpectedErrorKind, API_KEY_REJECTED_PREFIX,
+ BACKEND_UNAVAILABLE_PREFIX, REPORT_ERROR_TRACING_TARGET,
};
}
// rpc server only, below.
pub mod auth {
pub use openhuman_core::core::auth::{
- CORE_TOKEN_ENV_VAR, bearer_matches, get_rpc_token, init_rpc_token,
- init_rpc_token_with_value, verify_bearer_token,
+ bearer_matches, get_rpc_token, init_rpc_token, init_rpc_token_with_value,
+ verify_bearer_token, CORE_TOKEN_ENV_VAR,
};
}
pub mod bus {
- pub use openhuman_core::core::bus::{BUS, init};
+ pub use openhuman_core::core::bus::{init, BUS};
}
pub mod cli {
pub use openhuman_core::core::cli::load_dotenv_for_cli;
}
pub mod dispatch {
pub use openhuman_core::core::dispatch::{
- UNKNOWN_METHOD_PREFIX, is_known_probe_method, unknown_method_name,
+ is_known_probe_method, unknown_method_name, UNKNOWN_METHOD_PREFIX,
};
}
pub mod event_bind_tokens {
@@ -80,14 +80,14 @@ pub mod core {
}
pub mod runtime {
pub use openhuman_core::core::runtime::{
- CoreContext, CoreRuntime, Mode, SaasConfig, current_tenant, is_saas,
+ current_tenant, is_saas, CoreContext, CoreRuntime, Mode, SaasConfig,
};
pub mod saas {
pub use openhuman_core::core::runtime::saas::build;
}
}
pub mod server_launcher {
- pub use openhuman_core::core::server_launcher::{ServeRequest, install_server_launcher};
+ pub use openhuman_core::core::server_launcher::{install_server_launcher, ServeRequest};
}
pub mod session_expiry {
pub use openhuman_core::core::session_expiry::is_session_expired_error;
@@ -103,13 +103,13 @@ pub mod core {
/// tinyhumans (backend transport, hosted client, team ops) and rpc (`/health`).
pub mod backend {
pub use openhuman_core::backend::{
- BackendApiError, BackendClient, base_url, flatten_authed_error,
+ base_url, flatten_authed_error, BackendApiError, BackendClient,
};
pub mod transport {
pub use openhuman_core::backend::transport::{
- BackendTransport, BackendTransportError, TransportProfile, clear_backend_transport,
- resolve_backend_transport,
+ clear_backend_transport, resolve_backend_transport, BackendTransport,
+ BackendTransportError, TransportProfile,
};
}
}
@@ -117,14 +117,14 @@ pub mod backend {
/// tinyhumans (every hosted controller loads its config) and rpc (server).
pub mod config {
pub use openhuman_core::config::{
- Config, active_workspace_dir, active_workspace_dir_cached, active_workspace_snapshot,
- load_config_with_timeout, workspace_handle,
+ active_workspace_dir, active_workspace_dir_cached, active_workspace_snapshot,
+ load_config_with_timeout, workspace_handle, Config,
};
pub mod app_env {
// tinyhumans: backend URL selection.
pub use openhuman_core::config::app_env::{
- APP_ENV_VAR, VITE_APP_ENV_VAR, app_env_from_env, is_staging_app_env,
+ app_env_from_env, is_staging_app_env, APP_ENV_VAR, VITE_APP_ENV_VAR,
};
}
pub mod ops {
@@ -191,9 +191,9 @@ pub mod inference {
}
}
pub mod http {
- pub use openhuman_core::inference::http::EXTERNAL_OPENAI_COMPAT_PROVIDER;
#[cfg(feature = "http-server")]
pub use openhuman_core::inference::http::router;
+ pub use openhuman_core::inference::http::EXTERNAL_OPENAI_COMPAT_PROVIDER;
}
}
@@ -210,16 +210,16 @@ pub mod security {
/// Host-supplied secret storage and encryption-key sources.
pub mod secret_storage {
pub use openhuman_core::security::secret_storage::{
- EncryptedFileBackend, MasterKeySource, SecretBackend, SecretStorageError,
clear_master_key_source, clear_secret_backend, init_workspace,
install_master_key_source, install_secret_backend, installed_master_key_source,
installed_secret_backend, is_available, store::workspace_dir_for_file_backend,
+ EncryptedFileBackend, MasterKeySource, SecretBackend, SecretStorageError,
};
}
pub mod credentials {
pub use openhuman_core::security::credentials::{
- APP_SESSION_PROVIDER, AuthService, DEFAULT_AUTH_PROFILE_NAME,
- channel_credential_provider,
+ channel_credential_provider, AuthService, APP_SESSION_PROVIDER,
+ DEFAULT_AUTH_PROFILE_NAME,
};
pub mod ops {
pub use openhuman_core::security::credentials::ops::{
@@ -228,8 +228,8 @@ pub mod security {
}
pub mod session_support {
pub use openhuman_core::security::credentials::session_support::{
- BackendCredential, LOCAL_SESSION_BACKEND_UNAVAILABLE, build_session_state,
- current_session_is_local, resolve_backend_credential,
+ build_session_state, current_session_is_local, resolve_backend_credential,
+ BackendCredential, LOCAL_SESSION_BACKEND_UNAVAILABLE,
};
}
}
@@ -281,7 +281,7 @@ pub mod platform {
pub mod connectivity {
pub mod rpc {
pub use openhuman_core::platform::connectivity::rpc::{
- OccupiedByCore, pick_listen_port_for_host_with,
+ pick_listen_port_for_host_with, OccupiedByCore,
};
}
}
@@ -292,16 +292,16 @@ pub mod platform {
pub mod storage {
pub use openhuman_core::storage::{
- STORAGE_URL_VAR, StorageBackend, block_on, block_on_anyhow, clear, configured_url,
- driver_is_shared, install, installed, open, url_from,
+ block_on, block_on_anyhow, clear, configured_url, driver_is_shared, install, installed,
+ open, url_from, StorageBackend, STORAGE_URL_VAR,
};
}
pub mod profiles {
pub mod gateway {
pub use openhuman_core::profiles::gateway::{
- GatewayRefusal, GatewayScope, HeldBy, PROFILE_HELD, PROFILE_OWNER_HEADER, USER_HEADER,
- USER_SIG_HEADER, resolve_scope, sign, verify,
+ resolve_scope, sign, verify, GatewayRefusal, GatewayScope, HeldBy, PROFILE_HELD,
+ PROFILE_OWNER_HEADER, USER_HEADER, USER_SIG_HEADER,
};
}
pub mod host {
@@ -343,9 +343,9 @@ pub mod web3 {
pub mod web_chat {
pub use openhuman_core::web_chat::{
- ChatRequestMetadata, GuardrailPayload, StartChatError, WebChannelEvent,
approval_request_event, cancel_chat_scoped, plan_review_request_event,
publish_web_channel_event, start_chat, subscribe_web_channel_events, unix_epoch_ms,
+ ChatRequestMetadata, GuardrailPayload, StartChatError, WebChannelEvent,
};
}
diff --git a/crates/openhuman-embed/src/lib.rs b/crates/openhuman-embed/src/lib.rs
index 2289c1c69b..076a030fe7 100644
--- a/crates/openhuman-embed/src/lib.rs
+++ b/crates/openhuman-embed/src/lib.rs
@@ -67,8 +67,8 @@
pub use openhuman_core::agent::harness::definition::AgentDefinition;
pub use openhuman_core::agent::turn_origin::{AgentTurnOrigin, TrustedAutomationSource};
pub use openhuman_core::backend::{
- BackendRequest, BackendTransport, BackendTransportError, BaseUrlPurpose, TransportProfile,
- install_backend_transport, installed_backend_transport,
+ install_backend_transport, installed_backend_transport, BackendRequest, BackendTransport,
+ BackendTransportError, BaseUrlPurpose, TransportProfile,
};
pub use openhuman_core::config::ComposioHostCredential;
pub use openhuman_core::config::Config as RuntimeConfig;
@@ -90,7 +90,7 @@ pub use tinytools::ToolPolicy;
pub mod agent_progress {
pub use openhuman_core::agent::progress::AgentProgress;
pub use openhuman_core::agent::progress_sink::{
- AGENT_PROGRESS_SINK, ProgressSink, current_progress_sink, with_progress_sink,
+ current_progress_sink, with_progress_sink, ProgressSink, AGENT_PROGRESS_SINK,
};
}
@@ -100,7 +100,7 @@ pub mod agent_progress {
#[cfg(feature = "skills")]
pub mod skill_registry {
pub use openhuman_core::skills::catalog::{
- HERMES_REGISTRY_ID, ReqwestTransport, skill_registry,
+ skill_registry, ReqwestTransport, HERMES_REGISTRY_ID,
};
}
@@ -144,11 +144,11 @@ mod turn_meter;
#[path = "host_internals.rs"]
pub mod __host;
-pub use openhuman_core::core::ControllerSchema;
/// Look up the schema of a registered RPC method (`openhuman.<ns>_<fn>`).
pub use openhuman_core::core::all::schema_for_rpc_method;
/// Whether this build carries the HTTP server surface the router mounts.
pub use openhuman_core::core::http_server_status::HTTP_SERVER_COMPILED_IN;
+pub use openhuman_core::core::ControllerSchema;
/// Why a listen-port pick failed (another live core holds the port, ...).
pub use openhuman_core::platform::connectivity::rpc::PickListenPortError;
/// Whether this build carries the voice domain.
@@ -180,14 +180,14 @@ pub use profiles::{
ProfileRuntime, ProfileRuntimeBuilder, ProfileSummary, Provisioned, RelayAccepted,
RelayMessage, SaasConfig,
};
+pub use runtime::builder::DEFAULT_MAX_AGENTS;
/// Read-only view of a [`RuntimeBuilder`], for the layered crates' tests.
#[doc(hidden)]
pub use runtime::BuilderSummary;
-pub use runtime::builder::DEFAULT_MAX_AGENTS;
pub use runtime::{
- AgentDefaults, ApiKey, ConfigSource, ConfigurationInfo, DefaultsInfo, LearningSettings,
- ModelDefaults, RemoveAgent, Runtime, RuntimeBuilder, RuntimeDefaults, RuntimeError,
- RuntimeInfo, RuntimeModule, SkillsPolicy, StorageInfo, WeightClass, run_from_args,
+ run_from_args, AgentDefaults, ApiKey, ConfigSource, ConfigurationInfo, DefaultsInfo,
+ LearningSettings, ModelDefaults, RemoveAgent, Runtime, RuntimeBuilder, RuntimeDefaults,
+ RuntimeError, RuntimeInfo, RuntimeModule, SkillsPolicy, StorageInfo, WeightClass,
};
/// The types the [`RuntimeBuilder`] seam options take: controller
@@ -240,7 +240,7 @@ pub use complete::{
CompletionTrace, CompletionUsage,
};
pub use session_store::{InMemorySessionStores, SessionStoreProvider};
-pub use turn::{Route, Turn, TurnOutcome, TurnRequest, absolute};
+pub use turn::{absolute, Route, Turn, TurnOutcome, TurnRequest};
pub use turn_cancellation::TurnCancellation;
use std::sync::Arc;
diff --git a/crates/openhuman-embed/src/process_sentry.rs b/crates/openhuman-embed/src/process_sentry.rs
index ccc26f7d2b..886c39e9e3 100644
--- a/crates/openhuman-embed/src/process_sentry.rs
+++ b/crates/openhuman-embed/src/process_sentry.rs
@@ -12,8 +12,8 @@ use std::borrow::Cow;
use std::sync::Arc;
use openhuman_core::core::observability as obs;
-pub use sentry::ClientOptions;
pub use sentry::protocol::Event;
+pub use sentry::ClientOptions;
/// Re-exported so a host initialises the same `sentry` the options were
/// built for.
diff --git a/crates/openhuman-embed/src/profiles.rs b/crates/openhuman-embed/src/profiles.rs
index 131dc7382d..0332e1704b 100644
--- a/crates/openhuman-embed/src/profiles.rs
+++ b/crates/openhuman-embed/src/profiles.rs
@@ -55,8 +55,8 @@ use std::sync::Arc;
use openhuman_core::agent::session_store::SessionStoreProvider;
use openhuman_core::core::runtime::CoreRuntime;
-use openhuman_core::profiles::ProfileHost;
use openhuman_core::profiles::credentials::UserCredentialKind;
+use openhuman_core::profiles::ProfileHost;
use crate::error::CoreError;
@@ -64,8 +64,8 @@ mod handle;
pub use handle::{ChatReply, ProfileEvents, ProfileHandle, RelayAccepted};
pub use openhuman_core::channels::providers::relay::RelayInboundParams as RelayMessage;
-pub use openhuman_core::core::runtime::SaasConfig;
pub use openhuman_core::core::runtime::saas::SaasSandboxConfig;
+pub use openhuman_core::core::runtime::SaasConfig;
pub use openhuman_core::profiles::{OpenError, ProfileId, ProfileIdMode, ProfileSummary};
pub use openhuman_core::storage::lease::LeaseRecord;
pub use openhuman_core::threads::{ConversationMessageRecord, ConversationThreadSummary};
diff --git a/crates/openhuman-embed/src/runtime/build.rs b/crates/openhuman-embed/src/runtime/build.rs
index 710dff6e44..384d525df7 100644
--- a/crates/openhuman-embed/src/runtime/build.rs
+++ b/crates/openhuman-embed/src/runtime/build.rs
@@ -8,12 +8,12 @@ use openhuman_core::config::Config;
use openhuman_core::core::runtime::CoreBuilder;
use openhuman_core::core::types::HostKind;
-use super::builder::{ConfigSource, requests_background_services};
+use super::builder::{requests_background_services, ConfigSource};
use super::presets::{default_domains, default_services};
-use super::{ApiKey, RUNTIME_LIVE, Runtime, RuntimeBuilder, RuntimeError};
-use crate::Core;
+use super::{ApiKey, Runtime, RuntimeBuilder, RuntimeError, RUNTIME_LIVE};
use crate::harness::workspace::ResolvedWorkspace;
use crate::harness::{Provider, Workspace};
+use crate::Core;
struct SessionStoreCleanup {
installed: Option<Arc<dyn SessionStoreProvider>>,
diff --git a/crates/openhuman-embed/src/runtime/builder.rs b/crates/openhuman-embed/src/runtime/builder.rs
index 2621abb7f5..b68ce6fed3 100644
--- a/crates/openhuman-embed/src/runtime/builder.rs
+++ b/crates/openhuman-embed/src/runtime/builder.rs
@@ -21,10 +21,10 @@ use openhuman_core::core::runtime::{DomainSet, ServiceSet, TokenSource};
use openhuman_core::core::types::HostKind;
use openhuman_core::tools::toolpacks::ToolGroups;
-use super::ApiKey;
use super::seams::HostSeams;
-use crate::Session;
+use super::ApiKey;
use crate::harness::{Access, Provider, Workspace};
+use crate::Session;
// Re-exported for the sibling test module and older call sites that reached
// the default triples through this module.
@@ -40,7 +40,7 @@ pub(crate) use super::build::{effective_host_kind, routed_provider_effective};
#[cfg(test)]
pub(crate) use super::presets::{default_domains, default_services};
#[cfg(test)]
-pub(crate) use super::{RUNTIME_LIVE, RuntimeError};
+pub(crate) use super::{RuntimeError, RUNTIME_LIVE};
/// Who produces the [`Config`] the core boots with.
///
diff --git a/crates/openhuman-embed/src/runtime/info.rs b/crates/openhuman-embed/src/runtime/info.rs
index 352aaefa9e..66ed2b9d88 100644
--- a/crates/openhuman-embed/src/runtime/info.rs
+++ b/crates/openhuman-embed/src/runtime/info.rs
@@ -1,8 +1,8 @@
//! Versioned, credential-safe runtime capability metadata.
use super::{LearningSettings, ModelDefaults, Runtime, RuntimeBuilder};
use openhuman_core::config::{
- Config,
schema::{AutonomyConfig, CronConfig, PrivacyConfig, SecretsConfig},
+ Config,
};
use std::collections::BTreeMap;
diff --git a/crates/openhuman-embed/src/runtime/info_tests.rs b/crates/openhuman-embed/src/runtime/info_tests.rs
index 4e84b0032a..9a9673d709 100644
--- a/crates/openhuman-embed/src/runtime/info_tests.rs
+++ b/crates/openhuman-embed/src/runtime/info_tests.rs
@@ -157,15 +157,13 @@ fn unavailable_module_error_names_its_cargo_feature() {
fn discovered_config_still_rejects_typed_boot_edits() {
let builder = RuntimeBuilder::desktop().cron(Default::default());
assert!(builder.validate().is_err());
- assert!(
- RuntimeBuilder::desktop()
- .model_defaults(ModelDefaults {
- max_tokens: Some(300),
- ..Default::default()
- })
- .validate()
- .is_ok()
- );
+ assert!(RuntimeBuilder::desktop()
+ .model_defaults(ModelDefaults {
+ max_tokens: Some(300),
+ ..Default::default()
+ })
+ .validate()
+ .is_ok());
}
#[test]
diff --git a/crates/openhuman-embed/src/runtime/mod.rs b/crates/openhuman-embed/src/runtime/mod.rs
index 062335dab2..a42496c062 100644
--- a/crates/openhuman-embed/src/runtime/mod.rs
+++ b/crates/openhuman-embed/src/runtime/mod.rs
@@ -103,8 +103,8 @@ use openhuman_core::core::runtime::{CoreRuntime, DomainSet, ServiceSet};
use openhuman_core::tools::toolpacks::ToolGroups;
use crate::agent::{Agent, AgentError, AgentSpec};
-use crate::harness::HarnessCore;
use crate::harness::workspace::ResolvedWorkspace;
+use crate::harness::HarnessCore;
use crate::{Core, CoreError};
/// Guards the process-scoped core state described in the module docs.
diff --git a/crates/openhuman-embed/src/runtime/presets.rs b/crates/openhuman-embed/src/runtime/presets.rs
index 6e38b66bff..fbe897dd96 100644
--- a/crates/openhuman-embed/src/runtime/presets.rs
+++ b/crates/openhuman-embed/src/runtime/presets.rs
@@ -24,8 +24,8 @@ use openhuman_core::core::runtime::{DomainSet, ServiceSet, TokenSource};
use openhuman_core::core::types::HostKind;
use openhuman_core::tools::toolpacks::ToolGroups;
-use super::RuntimeBuilder;
use super::builder::ConfigSource;
+use super::RuntimeBuilder;
use crate::harness::Workspace;
impl RuntimeBuilder {
diff --git a/crates/openhuman-embed/src/runtime/seams.rs b/crates/openhuman-embed/src/runtime/seams.rs
index 1eee9072b6..be563bfffb 100644
--- a/crates/openhuman-embed/src/runtime/seams.rs
+++ b/crates/openhuman-embed/src/runtime/seams.rs
@@ -23,14 +23,14 @@
use std::sync::Arc;
use openhuman_core::agent::hooks::{
- PostTurnHook, ToolHook, embedder_post_turn_hooks, embedder_tool_hooks,
- replace_embedder_post_turn_hook, replace_embedder_tool_hook,
+ embedder_post_turn_hooks, embedder_tool_hooks, replace_embedder_post_turn_hook,
+ replace_embedder_tool_hook, PostTurnHook, ToolHook,
};
use openhuman_core::agent::tinyagents::discovery::{
clear_tool_ranker, install_tool_ranker, installed_tool_ranker,
};
-use openhuman_core::core::all::{ControllerExtension, register_controller_extension};
-use openhuman_core::core::server_launcher::{ServerLauncher, install_server_launcher};
+use openhuman_core::core::all::{register_controller_extension, ControllerExtension};
+use openhuman_core::core::server_launcher::{install_server_launcher, ServerLauncher};
use openhuman_core::security::SecurityPolicy;
use openhuman_core::storage::StorageBackend;
use tinytools::ToolRanker;
diff --git a/crates/openhuman-embed/src/runtime/seams_tests.rs b/crates/openhuman-embed/src/runtime/seams_tests.rs
index 7558f3b742..571f75166a 100644
--- a/crates/openhuman-embed/src/runtime/seams_tests.rs
+++ b/crates/openhuman-embed/src/runtime/seams_tests.rs
@@ -68,17 +68,13 @@ fn live_replacement_and_removal_update_builder_hooks_and_restore_predecessors()
"seams-live-tool",
Some(Arc::new(NamedToolHook("different-tool-name"))),
);
- assert!(
- embedder_tool_hooks()
- .iter()
- .any(|hook| hook.name() == "seams-live-tool")
- );
+ assert!(embedder_tool_hooks()
+ .iter()
+ .any(|hook| hook.name() == "seams-live-tool"));
seams.tool_hook("seams-live-tool", None);
- assert!(
- !embedder_tool_hooks()
- .iter()
- .any(|hook| hook.name() == "seams-live-tool")
- );
+ assert!(!embedder_tool_hooks()
+ .iter()
+ .any(|hook| hook.name() == "seams-live-tool"));
drop(seams);
assert!(Arc::ptr_eq(
&embedder_post_turn_hooks()
diff --git a/crates/openhuman-embed/src/runtime/summary.rs b/crates/openhuman-embed/src/runtime/summary.rs
index 26ebea0fb5..c4934eaf10 100644
--- a/crates/openhuman-embed/src/runtime/summary.rs
+++ b/crates/openhuman-embed/src/runtime/summary.rs
@@ -11,8 +11,8 @@ use openhuman_core::core::all::DomainGroup;
use openhuman_core::core::runtime::{DomainSet, ServiceSet, TokenSource};
use openhuman_core::core::types::HostKind;
-use super::RuntimeBuilder;
use super::builder::ConfigSource;
+use super::RuntimeBuilder;
use crate::harness::Workspace;
/// What a [`RuntimeBuilder`] is set to; see the module docs.
diff --git a/crates/openhuman-embed/src/secret_storage.rs b/crates/openhuman-embed/src/secret_storage.rs
index 2e2891bb09..53164fc486 100644
--- a/crates/openhuman-embed/src/secret_storage.rs
+++ b/crates/openhuman-embed/src/secret_storage.rs
@@ -8,6 +8,6 @@
//! during core boot. Native OS providers belong to `openhuman-rpc::keyring`.
pub use openhuman_core::security::secret_storage::{
- EncryptedFileBackend, MemoryBackend, SecretBackend, SecretStorageError, install_secret_backend,
- installed_secret_backend,
+ install_secret_backend, installed_secret_backend, EncryptedFileBackend, MemoryBackend,
+ SecretBackend, SecretStorageError,
};
diff --git a/crates/openhuman-embed/src/turn.rs b/crates/openhuman-embed/src/turn.rs
index 309efe89cc..e3fedd4f9d 100644
--- a/crates/openhuman-embed/src/turn.rs
+++ b/crates/openhuman-embed/src/turn.rs
@@ -47,8 +47,8 @@ use openhuman_core::inference::INFERENCE_AGENT_CHAT as AGENT_CHAT;
#[path = "turn_types.rs"]
mod types;
-pub use types::{Route, TurnOutcome, TurnRequest};
pub(crate) use types::{is_safe_endpoint_for_bearer, sanitize_url_for_display};
+pub use types::{Route, TurnOutcome, TurnRequest};
#[path = "turn_control.rs"]
mod control;
@@ -146,11 +146,11 @@ impl Turn {
pub fn tools(
mut self,
factory: impl for<'a> Fn(
- openhuman_core::agent::TurnContext<'a>,
- ) -> openhuman_core::agent::HostTurnTools
- + Send
- + Sync
- + 'static,
+ openhuman_core::agent::TurnContext<'a>,
+ ) -> openhuman_core::agent::HostTurnTools
+ + Send
+ + Sync
+ + 'static,
) -> Self {
self.tools = Some(Arc::new(factory));
self
@@ -506,7 +506,7 @@ async fn dispatch(
let turn: futures_box::BoxFuture<'_, Result<AgentReply, CoreError>> =
Box::pin(async move {
use openhuman_core::inference::host_runtime::ops::{
- AgentChatTarget, agent_chat_for,
+ agent_chat_for, AgentChatTarget,
};
let mut config = inner.config.clone();
let route = openhuman_core::config::schema::EphemeralRoute::from_params(