Skip to content

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

chore: sort imports and reorder module declarations across the codebase

Steven Enamakel8203f582363d
diff --git a/crates/openhuman-core/src/agent/harness/harness_tests.rs b/crates/openhuman-core/src/agent/harness/harness_tests.rs
index a7acf6f61a..5f54691ee0 100644
--- a/crates/openhuman-core/src/agent/harness/harness_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/harness_tests.rs
@@ -7,7 +7,7 @@ use super::parse::{
use crate::tools;
use std::sync::Arc;
-#[path = "harness_tool_call_parsing_tests.rs"]
-mod harness_tool_call_parsing_tests;
#[path = "harness_tool_call_parsing_edge_case_tests.rs"]
mod harness_tool_call_parsing_edge_case_tests;
+#[path = "harness_tool_call_parsing_tests.rs"]
+mod harness_tool_call_parsing_tests;
diff --git a/crates/openhuman-core/src/agent/harness/session/builder/builder_tests.rs b/crates/openhuman-core/src/agent/harness/session/builder/builder_tests.rs
index 29de9a7a09..31ad48b64c 100644
--- a/crates/openhuman-core/src/agent/harness/session/builder/builder_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/builder/builder_tests.rs
@@ -61,12 +61,12 @@ fn custom_profile(id: &str, dedicated_memory: bool) -> crate::agent::profiles::A
profile
}
-#[path = "builder_tests_session_agent_profile_tests.rs"]
-mod session_agent_profile_tests;
-#[path = "builder_tests_profile_soul_prompt_tests.rs"]
-mod profile_soul_prompt_tests;
#[path = "builder_tests_memory_write_instruction_tests.rs"]
mod memory_write_instruction_tests;
+#[path = "builder_tests_profile_soul_prompt_tests.rs"]
+mod profile_soul_prompt_tests;
+#[path = "builder_tests_session_agent_profile_tests.rs"]
+mod session_agent_profile_tests;
#[path = "builder_tests_tool_spec_views_tests.rs"]
mod tool_spec_views_tests;
diff --git a/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs b/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs
index 41508c6d46..13335e82fc 100644
--- a/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs
+++ b/crates/openhuman-core/src/agent/harness/session/runtime/accessors.rs
@@ -2,9 +2,8 @@
//! snapshots, session identity, and the per-session tool-visibility filter
//! (which rebuilds the tool policy snapshot on every change).
-
-use crate::agent::messages::ConversationMessage;
use super::super::types::{Agent, AgentBuilder};
+use crate::agent::messages::ConversationMessage;
use crate::memory::Memory;
use crate::tools::agent_policy::ToolPolicyEngine;
use crate::tools::{Tool, ToolSpec};
diff --git a/crates/openhuman-core/src/agent/harness/session/runtime_tests.rs b/crates/openhuman-core/src/agent/harness/session/runtime_tests.rs
index 024bec05c2..6f0cac1077 100644
--- a/crates/openhuman-core/src/agent/harness/session/runtime_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/runtime_tests.rs
@@ -1,8 +1,8 @@
use super::super::types::Agent;
-use crate::agent::messages::ConversationMessage;
use crate::agent::dispatcher::XmlToolDispatcher;
use crate::agent::error::AgentError;
use crate::agent::messages::ChatMessage;
+use crate::agent::messages::ConversationMessage;
use crate::core::events::DomainEvent;
use crate::inference::provider::{ChatResponse, UsageInfo};
use crate::memory::Memory;
diff --git a/crates/openhuman-core/src/agent/harness/session/session_tests.rs b/crates/openhuman-core/src/agent/harness/session/session_tests.rs
index 0993449d18..68f7540d86 100644
--- a/crates/openhuman-core/src/agent/harness/session/session_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/session_tests.rs
@@ -557,7 +557,7 @@ fn agent_with_fake_locator(
mod session_builder_and_listener_tests;
#[path = "session_dispatch_and_resume_tests.rs"]
mod session_dispatch_and_resume_tests;
-#[path = "session_thread_resume_tests.rs"]
-mod session_thread_resume_tests;
#[path = "session_prefix_stability_tests.rs"]
mod session_prefix_stability_tests;
+#[path = "session_thread_resume_tests.rs"]
+mod session_thread_resume_tests;
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript.rs b/crates/openhuman-core/src/agent/harness/session/transcript.rs
index 38391b87d8..3d78e4a888 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript.rs
@@ -124,12 +124,11 @@ pub use paths::{
};
pub use reader::{read_transcript, read_transcript_display};
pub use thread_lookup::{
- find_root_transcript_for_thread,
- find_root_transcripts_for_thread, read_thread_usage_summary,
+ find_root_transcript_for_thread, find_root_transcripts_for_thread, read_thread_usage_summary,
};
pub use types::{
- CompactionMarker, DisplayMessage, DisplayRecord, MessageUsage,
- SessionTranscript, TranscriptMeta, TurnUsage,
+ CompactionMarker, DisplayMessage, DisplayRecord, MessageUsage, SessionTranscript,
+ TranscriptMeta, TurnUsage,
};
pub use writer::{append_interrupted_partial, append_transcript_turn, write_transcript};
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript/jsonl.rs b/crates/openhuman-core/src/agent/harness/session/transcript/jsonl.rs
index 7e18e549b6..d213f543ae 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript/jsonl.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript/jsonl.rs
@@ -2,12 +2,11 @@
//! conversions between them and the public [`ChatMessage`] /
//! [`TranscriptMeta`] / [`DisplayMessage`] types.
-
-use crate::agent::harness::session::transcript::metadata::turn_usage_from_metadata;
use super::metadata::{attach_turn_usage_metadata, take_tool_failure};
use super::types::{
DisplayMessage, MessageUsage, TranscriptMeta, TurnUsage, TRANSCRIPT_SCHEMA_VERSION,
};
+use crate::agent::harness::session::transcript::metadata::turn_usage_from_metadata;
use crate::agent::messages::ChatMessage;
use crate::inference::provider::ToolCall;
use anyhow::{Context, Result};
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript_tests.rs b/crates/openhuman-core/src/agent/harness/session/transcript_tests.rs
index c2b1fef6f0..efe8be7a00 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript_tests.rs
@@ -92,9 +92,9 @@ fn roles(messages: &[ChatMessage]) -> Vec<&str> {
messages.iter().map(|m| m.role.as_str()).collect()
}
+#[path = "transcript_forward_compat_tests.rs"]
+mod transcript_forward_compat_tests;
#[path = "transcript_roundtrip_and_paths_tests.rs"]
mod transcript_roundtrip_and_paths_tests;
#[path = "transcript_thread_and_append_tests.rs"]
mod transcript_thread_and_append_tests;
-#[path = "transcript_forward_compat_tests.rs"]
-mod transcript_forward_compat_tests;
diff --git a/crates/openhuman-core/src/agent/harness/session/transcript_thread_and_append_tests.rs b/crates/openhuman-core/src/agent/harness/session/transcript_thread_and_append_tests.rs
index 15ef34b9f8..2266501126 100644
--- a/crates/openhuman-core/src/agent/harness/session/transcript_thread_and_append_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/transcript_thread_and_append_tests.rs
@@ -1,7 +1,7 @@
use super::*;
-use std::fs;
use crate::agent::messages::ChatMessage;
+use std::fs;
// ── find_root_transcript_for_thread: scope isolation ────────────────────────
/// An empty or blank `thread_id` must not match any transcript — the
diff --git a/crates/openhuman-core/src/agent/harness/session/turn_tests.rs b/crates/openhuman-core/src/agent/harness/session/turn_tests.rs
index ec247f6259..c18f06b3a8 100644
--- a/crates/openhuman-core/src/agent/harness/session/turn_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/session/turn_tests.rs
@@ -534,13 +534,13 @@ fn tool_calls_envelope(id: &str) -> String {
.to_string()
}
-#[path = "turn_history_and_context_tests.rs"]
-mod turn_history_and_context_tests;
-#[path = "turn_required_output_tests.rs"]
-mod turn_required_output_tests;
+#[path = "turn_auto_recall_tests.rs"]
+mod turn_auto_recall_tests;
#[path = "turn_checkpoint_and_wrapup_tests.rs"]
mod turn_checkpoint_and_wrapup_tests;
+#[path = "turn_history_and_context_tests.rs"]
+mod turn_history_and_context_tests;
#[path = "turn_learned_context_and_announcements_tests.rs"]
mod turn_learned_context_and_announcements_tests;
-#[path = "turn_auto_recall_tests.rs"]
-mod turn_auto_recall_tests;
+#[path = "turn_required_output_tests.rs"]
+mod turn_required_output_tests;
diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph/dispatch.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph/dispatch.rs
index 4056ab2e5d..7390e3a720 100644
--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph/dispatch.rs
+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops/graph/dispatch.rs
@@ -2,7 +2,6 @@
//! tinyagents seam, building its context middleware, and folding a cap-hit
//! checkpoint summary back into the result.
-
use crate::agent::harness::subagent_runner::ops::checkpoint;
use std::collections::HashSet;
use std::sync::Arc;
diff --git a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests.rs b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests.rs
index d4c4fa6e7c..51de751409 100644
--- a/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/subagent_runner/ops_tests.rs
@@ -339,9 +339,9 @@ fn gate(parent: Option<&AgentDefinition>, child: &AgentDefinition) -> Result<(),
super::runner::tier_gate_decision(parent, child, "parent-agent", "task-1")
}
-#[path = "ops_tests_slug_filter_typed_mode_tests.rs"]
-mod slug_filter_typed_mode_tests;
#[path = "ops_tests_model_resolution_tests.rs"]
mod model_resolution_tests;
+#[path = "ops_tests_slug_filter_typed_mode_tests.rs"]
+mod slug_filter_typed_mode_tests;
#[path = "ops_tests_tier_gate_tests.rs"]
mod tier_gate_tests;
diff --git a/crates/openhuman-core/src/agent/learning/linkedin_enrichment/profile_markdown.rs b/crates/openhuman-core/src/agent/learning/linkedin_enrichment/profile_markdown.rs
index 14da89a9a5..c371d7a104 100644
--- a/crates/openhuman-core/src/agent/learning/linkedin_enrichment/profile_markdown.rs
+++ b/crates/openhuman-core/src/agent/learning/linkedin_enrichment/profile_markdown.rs
@@ -3,7 +3,6 @@
use crate::config::Config;
-
// ── PROFILE.md generation ────────────────────────────────────────────
/// Summarise the scraped LinkedIn data with an LLM, then write the
diff --git a/crates/openhuman-core/src/agent/learning/schemas/profile_handlers.rs b/crates/openhuman-core/src/agent/learning/schemas/profile_handlers.rs
index 0da5f434b1..f5c05377e0 100644
--- a/crates/openhuman-core/src/agent/learning/schemas/profile_handlers.rs
+++ b/crates/openhuman-core/src/agent/learning/schemas/profile_handlers.rs
@@ -7,7 +7,6 @@ use crate::config::rpc as config_rpc;
use crate::core::all::ControllerFuture;
use crate::rpc::RpcOutcome;
-
pub(super) fn handle_linkedin_enrichment(params: Map<String, Value>) -> ControllerFuture {
Box::pin(async move {
let preset_profile_url = params
diff --git a/crates/openhuman-core/src/agent/multimodal_tests.rs b/crates/openhuman-core/src/agent/multimodal_tests.rs
index ed7b008e56..bec4d28419 100644
--- a/crates/openhuman-core/src/agent/multimodal_tests.rs
+++ b/crates/openhuman-core/src/agent/multimodal_tests.rs
@@ -24,7 +24,7 @@ startxref\n0\n%%EOF\n";
const TINY_PNG_DATA_URI: &str = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";
-#[path = "multimodal_marker_extraction_tests.rs"]
-mod multimodal_marker_extraction_tests;
#[path = "multimodal_attachment_handling_tests.rs"]
mod multimodal_attachment_handling_tests;
+#[path = "multimodal_marker_extraction_tests.rs"]
+mod multimodal_marker_extraction_tests;
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
index fafc512ef6..9d505fc4d9 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents.rs
@@ -64,18 +64,14 @@ mod tests;
#[cfg(test)]
pub(crate) use cancel::prune;
pub(crate) use cancel::{
- cancel_all, cancel_by_session_in_workspace, cancel_by_task,
- cancel_for_thread,
+ cancel_all, cancel_by_session_in_workspace, cancel_by_task, cancel_for_thread,
};
pub(crate) use registry::{register, status_channel, SubagentResumeRef, SubagentStatus};
-pub(crate) use resolve::{
- resume_ref_for_task_in_workspace,
- task_id_for_session_in_workspace,
-};
+pub(crate) use resolve::{resume_ref_for_task_in_workspace, task_id_for_session_in_workspace};
pub(crate) use roster::active_subagents_context_block;
-pub use steering::{steer, SteerError};
pub(crate) use steering::steer_control;
-pub(crate) use task_ledger::{reconcile_orphaned_tasks_on_boot, task_record_for_task_in_workspace};
+pub use steering::{steer, SteerError};
#[cfg(test)]
pub(crate) use task_ledger::task_records;
+pub(crate) use task_ledger::{reconcile_orphaned_tasks_on_boot, task_record_for_task_in_workspace};
pub(crate) use wait::{wait_in_workspace, WaitError, WaitOutcome};
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_steering_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_steering_tests.rs
index fe4d3504aa..8af87820de 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_steering_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_steering_tests.rs
@@ -217,4 +217,3 @@ async fn steer_after_terminal_is_rejected() {
);
prune("task-term");
}
-
diff --git a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
index 00c62677b7..13cb45b22e 100644
--- a/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/running_subagents_tests.rs
@@ -5,19 +5,19 @@ use crate::agent::orchestration::running_subagents::registry::DETACHED_LEDGER_TI
use crate::agent::orchestration::running_subagents::resolve::resume_ref_for_task;
use crate::agent::orchestration::running_subagents::resolve::task_id_for_session;
use crate::agent::orchestration::running_subagents::roster::snapshot_for_parent;
+use crate::agent::orchestration::running_subagents::steering::steer_directive;
use crate::agent::orchestration::running_subagents::steering::SteerDirectiveError;
use crate::agent::orchestration::running_subagents::steering::SteeringDirective;
-use crate::agent::orchestration::running_subagents::steering::steer_directive;
use crate::agent::orchestration::running_subagents::wait::wait;
use crate::agent::tinyagents::orchestration::shared_steering_registry;
use crate::agent::tinyagents::orchestration::{
openhuman_steering_handle, OrchestrationTaskStatus, SteeringHandle, SteeringPolicy,
SteeringRunClass,
};
-use std::sync::Arc;
-use std::time::Duration;
use std::path::PathBuf;
+use std::sync::Arc;
use std::sync::MutexGuard;
+use std::time::Duration;
use tinyagents_harness::ids::TaskId;
use tinyagents_harness::steering::{SteeringCommand, SteeringCommandKind};
use tokio::sync::watch;
diff --git a/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine_tests.rs b/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine_tests.rs
index ec8fb321c4..25728a5b2c 100644
--- a/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/workflow_runs/engine_tests.rs
@@ -28,9 +28,9 @@ use crate::agent::context::prompt::ToolCallFormat;
use crate::agent::harness::definition::AgentDefinitionRegistry;
use crate::agent::harness::fork_context::{with_parent_context, ParentExecutionContext};
use crate::config::{AgentConfig, Config};
-use tinyagents_session::run_ledger::WorkflowRunStatus;
use crate::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts};
use crate::tools::Tool;
+use tinyagents_session::run_ledger::WorkflowRunStatus;
use tinyagents_session::run_ledger::{get_workflow_run, upsert_workflow_run, WorkflowRunUpsert};
use tinyinference::model::{ChatModel, ModelProfile, ModelRequest, ModelResponse};
diff --git a/crates/openhuman-core/src/agent/progress_tracing.rs b/crates/openhuman-core/src/agent/progress_tracing.rs
index 8fbe179d2b..eef6b513c3 100644
--- a/crates/openhuman-core/src/agent/progress_tracing.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing.rs
@@ -57,15 +57,15 @@ pub(crate) mod journal_projection;
/// Langfuse ingestion exporter (remote push to the co-hosted staging server).
pub(crate) mod langfuse;
-/// Data model: [`RunType`], [`TraceContext`], [`SpanKind`], [`SpanStatus`],
-/// [`TraceSpan`].
-mod types;
/// The [`SpanCollector`] state machine that folds progress events into spans.
mod collector;
-/// Content truncation caps, JSON-value builders, and NDJSON serialization.
-mod serialize;
/// Handing finished spans to the local exporter and the Langfuse push.
mod export;
+/// Content truncation caps, JSON-value builders, and NDJSON serialization.
+mod serialize;
+/// Data model: [`RunType`], [`TraceContext`], [`SpanKind`], [`SpanStatus`],
+/// [`TraceSpan`].
+mod types;
pub use collector::SpanCollector;
pub use types::{trace_session_id, RunType, SpanKind, SpanStatus, TraceContext, TraceSpan};
diff --git a/crates/openhuman-core/src/agent/progress_tracing/collector/model_call.rs b/crates/openhuman-core/src/agent/progress_tracing/collector/model_call.rs
index 43c1903613..2400193ebd 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/collector/model_call.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/collector/model_call.rs
@@ -3,7 +3,9 @@
use std::collections::BTreeMap;
-use crate::agent::progress_tracing::serialize::{capture_model_content, json_f64, json_str, json_u32, json_u64};
+use crate::agent::progress_tracing::serialize::{
+ capture_model_content, json_f64, json_str, json_u32, json_u64,
+};
use crate::agent::progress_tracing::types::{SpanKind, SpanStatus};
use super::state::SpanCollector;
diff --git a/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs b/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs
index 69590da032..e7842aeeb1 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/collector/span_lifecycle.rs
@@ -3,9 +3,7 @@
use std::collections::BTreeMap;
-use crate::agent::progress_tracing::serialize::{
- truncate_capture_text, MAX_TOOL_CONTENT_CHARS,
-};
+use crate::agent::progress_tracing::serialize::{truncate_capture_text, MAX_TOOL_CONTENT_CHARS};
use crate::agent::progress_tracing::types::SpanKind;
use super::state::SpanCollector;
@@ -13,7 +11,10 @@ use super::state::SpanCollector;
impl SpanCollector {
/// Lazily open the root turn span so a stream that begins mid-flight
/// (or never sends `TurnStarted`) still produces a correlated tree.
- pub(in crate::agent::progress_tracing) fn ensure_turn_span(&mut self, start_unix_ms: u64) -> String {
+ pub(in crate::agent::progress_tracing) fn ensure_turn_span(
+ &mut self,
+ start_unix_ms: u64,
+ ) -> String {
if let Some(id) = &self.turn_span_id {
return id.clone();
}
@@ -80,7 +81,10 @@ impl SpanCollector {
/// The parent any iteration / tool / subagent span should hang off:
/// the current iteration if one is open, else the turn root.
- pub(in crate::agent::progress_tracing) fn active_parent_id(&mut self, now_unix_ms: u64) -> String {
+ pub(in crate::agent::progress_tracing) fn active_parent_id(
+ &mut self,
+ now_unix_ms: u64,
+ ) -> String {
if let Some(id) = &self.current_iteration_span_id {
return id.clone();
}
@@ -116,7 +120,11 @@ impl SpanCollector {
/// Record a tool call's result as the span's `output`, truncated to
/// [`MAX_TOOL_CONTENT_CHARS`]. Same capture gate as
/// [`Self::capture_tool_arguments`]. Empty output is skipped.
- pub(in crate::agent::progress_tracing) fn capture_tool_output(&mut self, index: usize, output: &str) {
+ pub(in crate::agent::progress_tracing) fn capture_tool_output(
+ &mut self,
+ index: usize,
+ output: &str,
+ ) {
if !self.ctx.capture_content || output.is_empty() {
return;
}
@@ -133,7 +141,12 @@ impl SpanCollector {
pub(in crate::agent::progress_tracing) fn close_current_iteration(&mut self, end_unix_ms: u64) {
if let Some(index) = self.current_iteration_index.take() {
- self.close_span(index, end_unix_ms, crate::agent::progress_tracing::types::SpanStatus::Ok, BTreeMap::new());
+ self.close_span(
+ index,
+ end_unix_ms,
+ crate::agent::progress_tracing::types::SpanStatus::Ok,
+ BTreeMap::new(),
+ );
}
self.current_iteration_span_id = None;
}
diff --git a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs
index a8b8fe9ee3..3a1eb54eaa 100644
--- a/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs
+++ b/crates/openhuman-core/src/agent/progress_tracing/progress_tracing_tests.rs
@@ -139,9 +139,9 @@ fn model_call_with_content(subagent_task_id: Option<&str>) -> AgentProgress {
}
}
-#[path = "progress_tracing_span_tree_tests.rs"]
-mod span_tree_tests;
#[path = "progress_tracing_attribution_tests.rs"]
mod attribution_tests;
#[path = "progress_tracing_content_gate_tests.rs"]
mod content_gate_tests;
+#[path = "progress_tracing_span_tree_tests.rs"]
+mod span_tree_tests;
diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests.rs
index c06daa3386..bf45ca4c8e 100644
--- a/crates/openhuman-core/src/agent/prompts/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod_tests.rs
@@ -167,11 +167,11 @@ fn agents_md_ctx(global: Option<String>, local: Option<String>) -> PromptContext
}
}
+#[path = "mod_tests_agents_md_registration_tests.rs"]
+mod agents_md_registration_tests;
#[path = "mod_tests_builder_sections_tests.rs"]
mod builder_sections_tests;
#[path = "mod_tests_subagent_render_tests.rs"]
mod subagent_render_tests;
#[path = "mod_tests_user_files_reflections_tests.rs"]
mod user_files_reflections_tests;
-#[path = "mod_tests_agents_md_registration_tests.rs"]
-mod agents_md_registration_tests;
diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests.rs
index 8f2de02fb9..6ba32090fa 100644
--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests.rs
@@ -14,7 +14,7 @@ fn find(id: &str) -> AgentDefinition {
#[path = "loader_tests_builtin_registration_tests.rs"]
mod builtin_registration_tests;
-#[path = "loader_tests_specialist_agents_tests.rs"]
-mod specialist_agents_tests;
#[path = "loader_tests_orchestrator_tier_tests.rs"]
mod orchestrator_tier_tests;
+#[path = "loader_tests_specialist_agents_tests.rs"]
+mod specialist_agents_tests;
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware.rs b/crates/openhuman-core/src/agent/tinyagents/middleware.rs
index 66b2dab5f4..88764b48c8 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware.rs
@@ -60,10 +60,7 @@ pub(crate) use repeated_failure::RepeatedToolFailureMiddleware;
pub(crate) use tool_exposure::OpenHumanToolExposureShadowMiddleware;
pub(crate) use tool_outcome_capture::ToolOutcomeCaptureMiddleware;
pub(crate) use tool_policy::ToolPolicyMiddleware;
-pub(crate) use turn_context::{
- HandoffConfig, TranscriptSnapshotSink,
- TurnContextMiddleware,
-};
+pub(crate) use turn_context::{HandoffConfig, TranscriptSnapshotSink, TurnContextMiddleware};
#[cfg(test)]
#[path = "middleware_tests.rs"]
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs
index c67b83b604..72c78f1e71 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tests.rs
@@ -5,18 +5,16 @@ use super::repeated_failure::{is_body_level_failure, user_actionable_escalation}
use super::tool_output::{
is_compaction_exempt, is_truncation_exempt, COMPACTION_EXEMPT_TOOLS, SAMPLING_TOOLS,
};
-use crate::agent::tinyagents::middleware::tool_output::ToolOutputMiddleware;
use super::turn_context::DEFAULT_TOOL_RESULT_BUDGET_BYTES;
use super::*;
+use crate::agent::tinyagents::middleware::tool_output::ToolOutputMiddleware;
use serde_json::json;
use std::collections::HashMap;
use std::sync::Arc;
use async_trait::async_trait;
-use tinyagents_harness::middleware::{
- AgentRun, BudgetTracker, Middleware, ToolMiddleware,
-};
+use tinyagents_harness::middleware::{AgentRun, BudgetTracker, Middleware, ToolMiddleware};
use tinyagents_harness::steering::{SteeringCommand, SteeringHandle};
use tinyagents_harness::tool::{ToolPolicy as TaToolPolicy, ToolResult as TaToolResult};
use tinyinference::message::{ContentBlock, Message as TaMessage};
diff --git a/crates/openhuman-core/src/agent/tinyagents/mod.rs b/crates/openhuman-core/src/agent/tinyagents/mod.rs
index b904e03bde..c97184e6ac 100644
--- a/crates/openhuman-core/src/agent/tinyagents/mod.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/mod.rs
@@ -81,7 +81,9 @@ pub(crate) use run_cancellation_context::current_run_cancellation;
pub(crate) use topology::all_graph_topologies;
pub use turn_models::TurnModelSource;
pub(crate) use turn_models::TurnModels;
-pub(crate) use turn_outcome::{HaltSummarySlot, TinyagentsTurnOutcome, ToolCallOutcome, ToolOutcomeSink};
+pub(crate) use turn_outcome::{
+ HaltSummarySlot, TinyagentsTurnOutcome, ToolCallOutcome, ToolOutcomeSink,
+};
pub(crate) use turn_policy::{agent_turn_wall_clock_ms, ToolPolicyEnforcement};
pub(crate) use turn_runner::run_turn_via_tinyagents_shared;
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
index 40acad4291..81df2aba1f 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
@@ -4,7 +4,6 @@
//! sub-agent routes use; [`run_turn_via_tinyagents`] is a thin test-only
//! variant with no middleware stack.
-
use crate::agent::tinyagents::model::ProfileOverrideModel;
use crate::agent::tinyagents::model::TurnChatModel;
use crate::agent::tinyagents::turn_policy::run_policy_for;
diff --git a/crates/openhuman-core/src/channels/bus.rs b/crates/openhuman-core/src/channels/bus.rs
index 0d174f6998..c1739a96cb 100644
--- a/crates/openhuman-core/src/channels/bus.rs
+++ b/crates/openhuman-core/src/channels/bus.rs
@@ -19,10 +19,10 @@ pub use subscriber::ChannelInboundSubscriber;
// items reached only through their owning submodule) so the `#[path]`
// test modules below — which share this module's scope via `super::*` —
// can see them exactly as they could when this was one unsplit file.
-pub(crate) use thread_id::derive_inbound_thread_id;
use draft::extract_message_id;
use streaming_state::StreamingState;
use thinking::latest_thinking_snippet;
+pub(crate) use thread_id::derive_inbound_thread_id;
#[cfg(test)]
#[path = "bus_inbound_thread_id_tests_tests.rs"]
diff --git a/crates/openhuman-core/src/channels/bus/draft.rs b/crates/openhuman-core/src/channels/bus/draft.rs
index 15d39b95d5..d33bfd48fb 100644
--- a/crates/openhuman-core/src/channels/bus/draft.rs
+++ b/crates/openhuman-core/src/channels/bus/draft.rs
@@ -1,8 +1,8 @@
//! Posting and progressively editing the evolving "draft" reply bubble.
use super::progressive_ui::{
- channel_edits_unsupported, classify_edit_failure, mark_channel_edits_unsupported,
- EditFailure, MAX_EDIT_FAILURES,
+ channel_edits_unsupported, classify_edit_failure, mark_channel_edits_unsupported, EditFailure,
+ MAX_EDIT_FAILURES,
};
use super::streaming_state::StreamingState;
use serde_json::json;
@@ -94,8 +94,10 @@ pub(super) async fn flush_streaming_edit(channel: &str, state: &mut StreamingSta
}
}
} else {
- let body =
- super::delivery::channel_message_body_with_idempotency(channel, json!({ "text": draft }));
+ let body = super::delivery::channel_message_body_with_idempotency(
+ channel,
+ json!({ "text": draft }),
+ );
match client.send_channel_message(channel, &jwt, body).await {
Ok(resp) => {
// A message was posted to the user — record that fact
diff --git a/crates/openhuman-core/src/channels/bus/thinking.rs b/crates/openhuman-core/src/channels/bus/thinking.rs
index 6ba49a87d9..04d84e1b2c 100644
--- a/crates/openhuman-core/src/channels/bus/thinking.rs
+++ b/crates/openhuman-core/src/channels/bus/thinking.rs
@@ -1,8 +1,8 @@
//! Posting and progressively editing the ephemeral "💭 Thinking:" bubble.
use super::progressive_ui::{
- channel_edits_unsupported, classify_edit_failure, mark_channel_edits_unsupported,
- EditFailure, MAX_FILLER_CHARS, MAX_THINKING_DISPLAY_CHARS,
+ channel_edits_unsupported, classify_edit_failure, mark_channel_edits_unsupported, EditFailure,
+ MAX_FILLER_CHARS, MAX_THINKING_DISPLAY_CHARS,
};
use super::streaming_state::StreamingState;
use serde_json::json;
@@ -76,8 +76,10 @@ pub(super) async fn flush_thinking_message(channel: &str, state: &mut StreamingS
}
} else {
// Send initial thinking message.
- let body =
- super::delivery::channel_message_body_with_idempotency(channel, json!({ "text": text }));
+ let body = super::delivery::channel_message_body_with_idempotency(
+ channel,
+ json!({ "text": text }),
+ );
match client.send_channel_message(channel, &jwt, body).await {
Ok(resp) => {
state.thinking_sent = true;
diff --git a/crates/openhuman-core/src/channels/bus_tests.rs b/crates/openhuman-core/src/channels/bus_tests.rs
index 8e5bc6af27..e0cc9e5f51 100644
--- a/crates/openhuman-core/src/channels/bus_tests.rs
+++ b/crates/openhuman-core/src/channels/bus_tests.rs
@@ -1,13 +1,13 @@
use super::*;
-use tinybus::EventHandler;
use crate::api::rest::BackendApiError;
use crate::core::events::DomainEvent;
+use tinybus::EventHandler;
-use crate::channels::bus::progressive_ui::EditFailure;
use crate::channels::bus::progressive_ui::channel_edits_unsupported;
use crate::channels::bus::progressive_ui::classify_edit_failure;
use crate::channels::bus::progressive_ui::edit_capability_key;
use crate::channels::bus::progressive_ui::mark_channel_edits_unsupported;
+use crate::channels::bus::progressive_ui::EditFailure;
#[test]
fn subscriber_metadata_is_stable() {
let subscriber = ChannelInboundSubscriber::new();
diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect.rs b/crates/openhuman-core/src/channels/controllers/ops/connect.rs
index c1f37127e3..dafec26239 100644
--- a/crates/openhuman-core/src/channels/controllers/ops/connect.rs
+++ b/crates/openhuman-core/src/channels/controllers/ops/connect.rs
@@ -13,20 +13,22 @@ mod test_channel;
pub(crate) use catalog::{describe_channel, list_channels};
pub use connect_channel::connect_channel;
pub use disconnect::disconnect_channel;
-pub use status::{channel_status, connected_channel_slugs, get_default_channel, set_default_channel};
-pub use test_channel::test_channel;
-pub(crate) use shared::merge_listener_health;
#[cfg(test)]
pub(crate) use email::persist_email_config;
+pub(crate) use shared::merge_listener_health;
+pub use status::{
+ channel_status, connected_channel_slugs, get_default_channel, set_default_channel,
+};
+pub use test_channel::test_channel;
// `email_config_tests` below shares this module's scope via `use super::*;` —
// the same way it did when this was one unsplit file — so bring in the
// symbols it (and any sibling test module) reaches that way.
#[cfg(test)]
-use email::{build_email_config, parse_email_senders, parse_port_field};
-#[cfg(test)]
use crate::channels::email_channel::EmailConfig;
#[cfg(test)]
+use email::{build_email_config, parse_email_senders, parse_port_field};
+#[cfg(test)]
use serde_json::Value;
#[cfg(test)]
diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/catalog.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/catalog.rs
index ba2c4a54f5..61d4b0d693 100644
--- a/crates/openhuman-core/src/channels/controllers/ops/connect/catalog.rs
+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/catalog.rs
@@ -12,9 +12,7 @@ pub async fn list_channels() -> Result<RpcOutcome<Vec<ChannelDefinition>>, Strin
}
/// Describe a single channel by id.
-pub async fn describe_channel(
- channel_id: &str,
-) -> Result<RpcOutcome<ChannelDefinition>, String> {
+pub async fn describe_channel(channel_id: &str) -> Result<RpcOutcome<ChannelDefinition>, String> {
let def = find_channel_definition(channel_id)
.ok_or_else(|| format!("unknown channel: {channel_id}"))?;
Ok(RpcOutcome::new(def, vec![]))
diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rs
index a984702644..ef306cc36c 100644
--- a/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rs
+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/connect_channel.rs
@@ -3,19 +3,19 @@
use serde_json::Value;
-use crate::channels::providers::yuanbao::YuanbaoConfig;
use crate::channels::email_channel::EmailConfig;
+use crate::channels::providers::yuanbao::YuanbaoConfig;
use crate::config::{Config, DiscordConfig, IMessageConfig, TelegramConfig};
use crate::rpc::RpcOutcome;
use crate::security::credentials;
use super::super::super::definitions::{find_channel_definition, ChannelAuthMode};
use super::super::types::ChannelConnectionResult;
-use super::email::{build_email_config, persist_email_config, verify_email_credentials};
-use super::shared::{credential_provider, parse_allowed_users, parse_optional_bool};
use super::super::yuanbao::{
build_effective_yuanbao_config, require_yuanbao_field, verify_yuanbao_credentials,
};
+use super::email::{build_email_config, persist_email_config, verify_email_credentials};
+use super::shared::{credential_provider, parse_allowed_users, parse_optional_bool};
/// Initiate a channel connection.
///
@@ -176,12 +176,7 @@ pub async fn connect_channel(
existing.mention_only,
)
} else {
- (
- crate::config::StreamMode::default(),
- 1000,
- true,
- false,
- )
+ (crate::config::StreamMode::default(), 1000, true, false)
};
persisted.channels_config.telegram = Some(TelegramConfig {
@@ -318,4 +313,3 @@ pub async fn connect_channel(
format!("stored credentials for {}", provider_key),
))
}
-
diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/email.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/email.rs
index eb06896192..b6a58e38bd 100644
--- a/crates/openhuman-core/src/channels/controllers/ops/connect/email.rs
+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/email.rs
@@ -3,8 +3,8 @@
use serde_json::Value;
use crate::channels::email_channel::{EmailChannel, EmailConfig};
-use tinychannels_bus::traits::Channel as _;
use crate::config::Config;
+use tinychannels_bus::traits::Channel as _;
use super::shared::parse_optional_bool;
diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/memory.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/memory.rs
index 51a1ae6586..1b642e41c8 100644
--- a/crates/openhuman-core/src/channels/controllers/ops/connect/memory.rs
+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/memory.rs
@@ -16,7 +16,10 @@ use tinymemory_api::provider::ForgetSelector;
///
/// No `spawn_blocking`: the driver owns whether its own reads and writes
/// block, and the module's do not run on this thread at all.
-pub(super) async fn clear_channel_memory(config: &Config, channel_id: &str) -> anyhow::Result<usize> {
+pub(super) async fn clear_channel_memory(
+ config: &Config,
+ channel_id: &str,
+) -> anyhow::Result<usize> {
let kind = SourceKind::Chat.as_str().to_string();
let exact = forget_matching(
config,
diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/processor/approval.rs b/crates/openhuman-core/src/channels/runtime/dispatch/processor/approval.rs
index 899dc0ea7f..f51fca37d5 100644
--- a/crates/openhuman-core/src/channels/runtime/dispatch/processor/approval.rs
+++ b/crates/openhuman-core/src/channels/runtime/dispatch/processor/approval.rs
@@ -41,8 +41,7 @@ pub(super) async fn try_route_approval_reply(msg: &traits::ChannelMessage) -> bo
let Some(request_id) = gate.pending_for_thread(&thread_id) else {
return false;
};
- let Some(decision) = crate::security::approval::parse_approval_reply(&msg.content)
- else {
+ let Some(decision) = crate::security::approval::parse_approval_reply(&msg.content) else {
return false;
};
match gate.decide(&request_id, decision) {
diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
index d34b5a67fe..5261bf20eb 100644
--- a/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
+++ b/crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs
@@ -2,8 +2,6 @@
//! assembly, dispatching the agentic turn over the native bus, and
//! delivering the draft/final reply.
-use crate::core::bus::BUS;
-use crate::core::events::DomainEvent;
use crate::agent::bus::{AgentTurnRequest, AgentTurnResponse, AGENT_RUN_TURN_METHOD};
use crate::agent::messages::ChatMessage;
use crate::agent::progress::AgentProgress;
@@ -16,6 +14,8 @@ use crate::channels::routes::{
};
use crate::channels::traits;
use crate::channels::{ChannelSendExt, SendMessage};
+use crate::core::bus::BUS;
+use crate::core::events::DomainEvent;
use crate::inference::provider;
use crate::util::truncate_with_ellipsis;
use std::sync::Arc;
@@ -367,13 +367,11 @@ pub(crate) async fn process_channel_runtime_message(
// config)` — `route.provider` is the effective provider string. Tests (no
// `config`) stay on an injected model source.
turn_model_source: match &ctx.config {
- Some(cfg) => {
- crate::agent::tinyagents::TurnModelSource::new_crate_native_from_string(
- "chat",
- route.provider.clone(),
- cfg.clone(),
- )
- }
+ Some(cfg) => crate::agent::tinyagents::TurnModelSource::new_crate_native_from_string(
+ "chat",
+ route.provider.clone(),
+ cfg.clone(),
+ ),
None => active_turn_model_source
.expect("test channel context must inject a turn model source"),
},
@@ -399,8 +397,7 @@ pub(crate) async fn process_channel_runtime_message(
// owns the local filesystem) goes through a different turn
// builder and keeps the operator default. Mirrors the triage-arm
// hardening in `agent::triage::evaluator`.
- multimodal_files:
- crate::config::MultimodalFileConfig::for_untrusted_channel_input(),
+ multimodal_files: crate::config::MultimodalFileConfig::for_untrusted_channel_input(),
max_tool_iterations: ctx.max_tool_iterations,
on_delta: None, // on_progress handles text deltas now
target_agent_id: scoping.target_agent_id,
diff --git a/crates/openhuman-core/src/channels/runtime/startup.rs b/crates/openhuman-core/src/channels/runtime/startup.rs
index 5cc31c3e05..1e96ea5c46 100644
--- a/crates/openhuman-core/src/channels/runtime/startup.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup.rs
@@ -13,13 +13,13 @@ pub use start_channels::start_channels;
// modules below — which share this module's scope via `super::*` — can see
// them exactly as they could when this was one unsplit file.
#[cfg(test)]
+use crate::config::Config;
+#[cfg(test)]
use chat_workload::{resolve_chat_workload, ChatWorkloadResolution};
#[cfg(any(test, debug_assertions))]
use credentials::resolve_yuanbao_app_secret;
#[cfg(test)]
use relay::RelayInboundMessageHandler;
-#[cfg(test)]
-use crate::config::Config;
#[cfg(any(test, debug_assertions))]
#[path = "startup_test_support_tests.rs"]
diff --git a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
index a23cfa93f5..a393106a88 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/start_channels.rs
@@ -7,17 +7,17 @@ use super::chat_workload::{resolve_chat_workload, ChatWorkloadResolution};
use super::credentials::{hydrate_channel_credentials, RuntimeProxyClients};
use super::prompt::format_access_context;
use super::relay::start_relay_runtime;
-use crate::core::bus::BUS;
-use crate::core::events::DomainEvent;
-use crate::channels::system_prompt::{ChannelPromptInputs, ChannelSystemPrompt};
use crate::agent::harness::build_tool_instructions_filtered;
use crate::agent::host_runtime;
use crate::channels::context::{
effective_channel_message_timeout_secs, ChannelRuntimeContext,
DEFAULT_CHANNEL_INITIAL_BACKOFF_SECS, DEFAULT_CHANNEL_MAX_BACKOFF_SECS,
};
+use crate::channels::system_prompt::{ChannelPromptInputs, ChannelSystemPrompt};
use crate::channels::traits;
use crate::config::Config;
+use crate::core::bus::BUS;
+use crate::core::events::DomainEvent;
use crate::inference::provider;
use crate::security::SecurityPolicy;
use crate::tools;
@@ -99,9 +99,9 @@ pub async fn start_channels(mut config: Config) -> Result<()> {
// Initialise the sub-agent definition registry from this workspace.
// Idempotent — `bootstrap_core_runtime` may also call it.
- if let Err(err) = crate::agent::harness::AgentDefinitionRegistry::init_global(
- &config.workspace_dir,
- ) {
+ if let Err(err) =
+ crate::agent::harness::AgentDefinitionRegistry::init_global(&config.workspace_dir)
+ {
tracing::warn!(
"AgentDefinitionRegistry::init_global failed: {err} — \
spawn_subagent will be unavailable until restart"
@@ -318,8 +318,7 @@ pub async fn start_channels(mut config: Config) -> Result<()> {
// Assemble the ChannelHost capability surface (shutdown, STT/TTS, reaction
// gate, approvals, conversation store, event sink). Ported rich providers
// reach host capabilities through this instead of calling core internals.
- let channel_host =
- crate::channels::host::build_channel_host(Arc::new(config.clone()));
+ let channel_host = crate::channels::host::build_channel_host(Arc::new(config.clone()));
// Provider construction lives in `tinychannels::factory` so that this host
// and the `tinychannels-module` cdylib build the same providers from the
diff --git a/crates/openhuman-core/src/config/ops_tests.rs b/crates/openhuman-core/src/config/ops_tests.rs
index 794ed44a1f..d0ac24f025 100644
--- a/crates/openhuman-core/src/config/ops_tests.rs
+++ b/crates/openhuman-core/src/config/ops_tests.rs
@@ -15,11 +15,11 @@ fn tmp_config(tmp: &tempfile::TempDir) -> Config {
cfg
}
+#[path = "ops_agent_paths_tests.rs"]
+mod agent_paths_tests;
#[path = "ops_loader_and_search_tests.rs"]
mod loader_and_search_tests;
#[path = "ops_model_and_local_ai_tests.rs"]
mod model_and_local_ai_tests;
#[path = "ops_voice_and_autonomy_tests.rs"]
mod voice_and_autonomy_tests;
-#[path = "ops_agent_paths_tests.rs"]
-mod agent_paths_tests;
diff --git a/crates/openhuman-core/src/config/schema/load/env_overlay/search.rs b/crates/openhuman-core/src/config/schema/load/env_overlay/search.rs
index 9e6b3bc7de..cc490f9f1f 100644
--- a/crates/openhuman-core/src/config/schema/load/env_overlay/search.rs
+++ b/crates/openhuman-core/src/config/schema/load/env_overlay/search.rs
@@ -1,6 +1,5 @@
//! Env overrides for web search: SearXNG, Seltz, Tavily, and the search engine selection.
-
use crate::config::schema::load::env::parse_env_bool;
use crate::config::schema::load::env::EnvLookup;
use crate::config::schema::Config;
diff --git a/crates/openhuman-core/src/config/schema/load_tests.rs b/crates/openhuman-core/src/config/schema/load_tests.rs
index 79ae258fed..53e221f027 100644
--- a/crates/openhuman-core/src/config/schema/load_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load_tests.rs
@@ -102,11 +102,11 @@ async fn write_binary(path: &std::path::Path, bytes: &[u8]) {
#[path = "load_active_user_and_dirs_tests.rs"]
mod active_user_and_dirs_tests;
-#[path = "load_env_overlay_tests.rs"]
-mod env_overlay_tests;
+#[path = "load_backup_tests.rs"]
+mod backup_tests;
#[path = "load_corruption_recovery_tests.rs"]
mod corruption_recovery_tests;
+#[path = "load_env_overlay_tests.rs"]
+mod env_overlay_tests;
#[path = "load_migration_tests.rs"]
mod migration_tests;
-#[path = "load_backup_tests.rs"]
-mod backup_tests;
diff --git a/crates/openhuman-core/src/core/observability_tests.rs b/crates/openhuman-core/src/core/observability_tests.rs
index 104e61008b..d87c4e6bfb 100644
--- a/crates/openhuman-core/src/core/observability_tests.rs
+++ b/crates/openhuman-core/src/core/observability_tests.rs
@@ -68,19 +68,19 @@ fn event_with_exception_value(value: &str) -> sentry::protocol::Event<'static> {
event
}
+#[path = "observability_crash_filter_auth_tests.rs"]
+mod crash_filter_auth;
+#[path = "observability_crash_filter_integrations_tests.rs"]
+mod crash_filter_integrations;
+#[path = "observability_crash_filter_messages_tests.rs"]
+mod crash_filter_messages;
#[path = "observability_error_classification_core_tests.rs"]
mod error_classification_core;
-#[path = "observability_error_classification_provider_tests.rs"]
-mod error_classification_provider;
#[path = "observability_error_classification_network_tests.rs"]
mod error_classification_network;
-#[path = "observability_error_classification_user_state_tests.rs"]
-mod error_classification_user_state;
+#[path = "observability_error_classification_provider_tests.rs"]
+mod error_classification_provider;
#[path = "observability_error_classification_session_tests.rs"]
mod error_classification_session;
-#[path = "observability_crash_filter_integrations_tests.rs"]
-mod crash_filter_integrations;
-#[path = "observability_crash_filter_messages_tests.rs"]
-mod crash_filter_messages;
-#[path = "observability_crash_filter_auth_tests.rs"]
-mod crash_filter_auth;
+#[path = "observability_error_classification_user_state_tests.rs"]
+mod error_classification_user_state;
diff --git a/crates/openhuman-core/src/cron/scheduler.rs b/crates/openhuman-core/src/cron/scheduler.rs
index 505615ff69..88c0f3eda2 100644
--- a/crates/openhuman-core/src/cron/scheduler.rs
+++ b/crates/openhuman-core/src/cron/scheduler.rs
@@ -219,8 +219,7 @@ async fn execute_and_persist_job(
success,
output: crate::util::truncate_with_ellipsis(&output, 512),
});
- let failure_message =
- (!success).then(|| crate::util::truncate_with_ellipsis(&output, 256));
+ let failure_message = (!success).then(|| crate::util::truncate_with_ellipsis(&output, 256));
(job.id.clone(), success, failure_message)
}
diff --git a/crates/openhuman-core/src/cron/scheduler/agent_run.rs b/crates/openhuman-core/src/cron/scheduler/agent_run.rs
index c757331714..36b223cde5 100644
--- a/crates/openhuman-core/src/cron/scheduler/agent_run.rs
+++ b/crates/openhuman-core/src/cron/scheduler/agent_run.rs
@@ -14,7 +14,10 @@ use crate::cron::{CronJob, SessionTarget};
/// by the `composio_execute` handler via `current_task_recency_window`.
pub(super) const MORNING_BRIEFING_TASK_RECENCY_SECS: u64 = 24 * 60 * 60;
-pub(super) async fn run_agent_job(config: &Config, job: &CronJob) -> (bool, String, Option<String>) {
+pub(super) async fn run_agent_job(
+ config: &Config,
+ job: &CronJob,
+) -> (bool, String, Option<String>) {
let name = job.name.clone().unwrap_or_else(|| "cron-job".to_string());
let prompt = job.prompt.clone().unwrap_or_default();
let prefixed_prompt = format!("[cron:{} {name}] {prompt}", job.id);
@@ -32,8 +35,7 @@ pub(super) async fn run_agent_job(config: &Config, job: &CronJob) -> (bool, Stri
// runs with the definition's constraints instead of the generic
// Agent::from_config defaults.
if let Some(ref agent_id) = job.agent_id {
- if let Some(registry) =
- crate::agent::harness::definition::AgentDefinitionRegistry::global()
+ if let Some(registry) = crate::agent::harness::definition::AgentDefinitionRegistry::global()
{
if let Some(def) = registry.get(agent_id) {
tracing::debug!(
@@ -136,12 +138,10 @@ pub(super) async fn run_agent_job(config: &Config, job: &CronJob) -> (bool, Stri
// automation and lets external_effect tools run without
// an in-app prompt — the user explicitly created this
// cron job and authorized its prompt at the same time.
- let origin =
- crate::agent::turn_origin::AgentTurnOrigin::TrustedAutomation {
- job_id: job.id.clone(),
- source:
- crate::agent::turn_origin::TrustedAutomationSource::Cron,
- };
+ let origin = crate::agent::turn_origin::AgentTurnOrigin::TrustedAutomation {
+ job_id: job.id.clone(),
+ source: crate::agent::turn_origin::TrustedAutomationSource::Cron,
+ };
let turn = crate::memory::source_scope::with_source_scope(
profile.and_then(|profile| profile.memory_sources),
crate::agent::turn_origin::with_origin(
@@ -289,7 +289,10 @@ pub(super) fn apply_cron_profile_runtime_defaults(
effective
}
-pub(super) fn build_agent_for_cron_job(config: &Config, job: &CronJob) -> anyhow::Result<BuiltCronAgent> {
+pub(super) fn build_agent_for_cron_job(
+ config: &Config,
+ job: &CronJob,
+) -> anyhow::Result<BuiltCronAgent> {
// 2b — profile attribution. When the job names a profile that still exists,
// build the run under it via the SAME profile-aware session path the task
// dispatcher uses (`from_config_for_agent_with_profile`), so the run inherits
diff --git a/crates/openhuman-core/src/cron/scheduler/delivery.rs b/crates/openhuman-core/src/cron/scheduler/delivery.rs
index 1cac048030..ec6928fd55 100644
--- a/crates/openhuman-core/src/cron/scheduler/delivery.rs
+++ b/crates/openhuman-core/src/cron/scheduler/delivery.rs
@@ -206,9 +206,7 @@ pub(super) async fn deliver_if_configured(
/// Insert a notification into the alerts tab for a completed cron job.
pub(super) fn push_cron_alert(config: &Config, job: &CronJob, output: &str) {
use crate::desktop::notifications::store as notif_store;
- use crate::desktop::notifications::types::{
- IntegrationNotification, NotificationStatus,
- };
+ use crate::desktop::notifications::types::{IntegrationNotification, NotificationStatus};
let name = job.name.as_deref().unwrap_or("Cron job");
let body = cron_alert_body(job, output);
diff --git a/crates/openhuman-core/src/cron/scheduler/failure_classification.rs b/crates/openhuman-core/src/cron/scheduler/failure_classification.rs
index 127dee1624..18f8d9780a 100644
--- a/crates/openhuman-core/src/cron/scheduler/failure_classification.rs
+++ b/crates/openhuman-core/src/cron/scheduler/failure_classification.rs
@@ -270,7 +270,10 @@ pub(super) fn is_local_provider_no_model_loaded_message(signal: &str) -> bool {
/// `&'static str` only, so it can never carry a raw error field (the no-leak
/// contract that governs [`agent_error_to_user_message`]). Precedence mirrors
/// the halt classifiers' evaluation order: credits → budget → missing key.
-pub(super) fn permanent_halt_message(credits_exhausted: bool, budget_exhausted: bool) -> &'static str {
+pub(super) fn permanent_halt_message(
+ credits_exhausted: bool,
+ budget_exhausted: bool,
+) -> &'static str {
if credits_exhausted {
CRON_HALT_INSUFFICIENT_CREDITS_MESSAGE
} else if budget_exhausted {
diff --git a/crates/openhuman-core/src/cron/scheduler_frequency_tests.rs b/crates/openhuman-core/src/cron/scheduler_frequency_tests.rs
index 6a8d97a5d2..3a58529388 100644
--- a/crates/openhuman-core/src/cron/scheduler_frequency_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_frequency_tests.rs
@@ -1,9 +1,9 @@
use super::*;
use crate::cron::JobType;
-use crate::cron::MIN_AGENT_JOB_INTERVAL;
use crate::cron::Schedule;
use crate::cron::TooFrequent;
+use crate::cron::MIN_AGENT_JOB_INTERVAL;
#[tokio::test]
async fn deliver_if_configured_empty_success_skips_chat_and_alert() {
let tmp = TempDir::new().unwrap();
diff --git a/crates/openhuman-core/src/cron/scheduler_tests.rs b/crates/openhuman-core/src/cron/scheduler_tests.rs
index e3ac2e3ab5..382051e64c 100644
--- a/crates/openhuman-core/src/cron/scheduler_tests.rs
+++ b/crates/openhuman-core/src/cron/scheduler_tests.rs
@@ -1,11 +1,11 @@
use super::*;
use crate::agent::error::AgentError;
use crate::config::Config;
+use crate::cron::JobType;
+use crate::cron::SessionTarget;
use crate::cron::{self, ActiveHours, DeliveryConfig};
use crate::security::SecurityPolicy;
use chrono::{Duration as ChronoDuration, Timelike, Utc};
-use crate::cron::JobType;
-use crate::cron::SessionTarget;
#[cfg(not(windows))]
use std::os::unix::fs::PermissionsExt;
use std::sync::Arc;
@@ -101,11 +101,11 @@ fn next_user_error(
}
}
-#[path = "scheduler_profile_and_shell_tests.rs"]
-mod profile_and_shell_tests;
-#[path = "scheduler_halt_and_persist_tests.rs"]
-mod halt_and_persist_tests;
#[path = "scheduler_classifier_and_delivery_tests.rs"]
mod classifier_and_delivery_tests;
#[path = "scheduler_frequency_tests.rs"]
mod frequency_tests;
+#[path = "scheduler_halt_and_persist_tests.rs"]
+mod halt_and_persist_tests;
+#[path = "scheduler_profile_and_shell_tests.rs"]
+mod profile_and_shell_tests;
diff --git a/crates/openhuman-core/src/cron/store.rs b/crates/openhuman-core/src/cron/store.rs
index f8521ba67c..e979216e18 100644
--- a/crates/openhuman-core/src/cron/store.rs
+++ b/crates/openhuman-core/src/cron/store.rs
@@ -24,8 +24,8 @@ pub use runs::{delete_queued_runs, list_runs, record_last_run, record_run, resch
// the connection helper and the `rusqlite::params!` macro directly via
// `use super::*;`, exactly as when this was one spliced file.
#[allow(unused_imports)]
+use runs::{MAX_CRON_OUTPUT_BYTES, TRUNCATED_OUTPUT_MARKER};
+#[allow(unused_imports)]
use rusqlite::params;
#[allow(unused_imports)]
use schema::with_connection;
-#[allow(unused_imports)]
-use runs::{MAX_CRON_OUTPUT_BYTES, TRUNCATED_OUTPUT_MARKER};
diff --git a/crates/openhuman-core/src/cron/store/schema.rs b/crates/openhuman-core/src/cron/store/schema.rs
index a3fbde9bbb..9a7d447ddd 100644
--- a/crates/openhuman-core/src/cron/store/schema.rs
+++ b/crates/openhuman-core/src/cron/store/schema.rs
@@ -108,7 +108,10 @@ fn add_column_if_missing(conn: &Connection, name: &str, sql_type: &str) -> Resul
}
}
-pub(super) fn with_connection<T>(config: &Config, f: impl FnOnce(&Connection) -> Result<T>) -> Result<T> {
+pub(super) fn with_connection<T>(
+ config: &Config,
+ f: impl FnOnce(&Connection) -> Result<T>,
+) -> Result<T> {
let db_path = config.workspace_dir.join("cron").join("jobs.db");
if let Some(parent) = db_path.parent() {
std::fs::create_dir_all(parent)
diff --git a/crates/openhuman-core/src/cron/store_agent_floor_tests.rs b/crates/openhuman-core/src/cron/store_agent_floor_tests.rs
index 061e4ae80e..67c5ada0dd 100644
--- a/crates/openhuman-core/src/cron/store_agent_floor_tests.rs
+++ b/crates/openhuman-core/src/cron/store_agent_floor_tests.rs
@@ -1,10 +1,10 @@
use super::*;
-use anyhow::Result;
use crate::cron::CronJob;
use crate::cron::CronJobPatch;
use crate::cron::Schedule;
use crate::cron::SessionTarget;
+use anyhow::Result;
// ── agent-job minimum interval (#6158) ──────────────────────────
fn utc_cron(expr: &str) -> Schedule {
diff --git a/crates/openhuman-core/src/desktop/accessibility/helper.rs b/crates/openhuman-core/src/desktop/accessibility/helper.rs
index f0a6b07819..ecbf7339a8 100644
--- a/crates/openhuman-core/src/desktop/accessibility/helper.rs
+++ b/crates/openhuman-core/src/desktop/accessibility/helper.rs
@@ -33,7 +33,7 @@ mod swift_source;
#[cfg(target_os = "macos")]
#[allow(unused_imports)]
pub(crate) use process::helper_send_receive;
+pub use process::precompile_helper_background;
#[cfg(target_os = "macos")]
#[allow(unused_imports)]
pub(in crate::desktop::accessibility) use process::{helper_quit, helper_send_fire_and_forget};
-pub use process::precompile_helper_background;
diff --git a/crates/openhuman-core/src/desktop/accessibility/helper/process.rs b/crates/openhuman-core/src/desktop/accessibility/helper/process.rs
index 820c18544f..0c9cc087e0 100644
--- a/crates/openhuman-core/src/desktop/accessibility/helper/process.rs
+++ b/crates/openhuman-core/src/desktop/accessibility/helper/process.rs
@@ -19,10 +19,10 @@ use std::{
process::{Child, ChildStdin, Command, Stdio},
};
-#[cfg(target_os = "macos")]
-use serde_json::Value;
#[cfg(target_os = "macos")]
use super::swift_source::unified_swift_source;
+#[cfg(target_os = "macos")]
+use serde_json::Value;
/// Process handle + stdin writer. Held only briefly for writes.
#[cfg(target_os = "macos")]
@@ -160,7 +160,9 @@ pub(crate) fn helper_send_receive(
/// Used for `show`, `hide`, and `quit` commands.
/// Only acquires UNIFIED_HELPER (for the stdin write) — never blocks on I/O.
#[cfg(target_os = "macos")]
-pub(in crate::desktop::accessibility) fn helper_send_fire_and_forget(request: &serde_json::Value) -> Result<(), String> {
+pub(in crate::desktop::accessibility) fn helper_send_fire_and_forget(
+ request: &serde_json::Value,
+) -> Result<(), String> {
ensure_helper_running()?;
let mut guard = UNIFIED_HELPER
.lock()
diff --git a/crates/openhuman-core/src/desktop/accessibility/helper/swift_source.rs b/crates/openhuman-core/src/desktop/accessibility/helper/swift_source.rs
index 6e94a75276..c856a92fed 100644
--- a/crates/openhuman-core/src/desktop/accessibility/helper/swift_source.rs
+++ b/crates/openhuman-core/src/desktop/accessibility/helper/swift_source.rs
@@ -15,7 +15,5 @@ use super::swift_paste::SWIFT_PASTE;
#[cfg(target_os = "macos")]
pub(super) fn unified_swift_source() -> String {
- format!(
- "{SWIFT_HEADER_AND_FOCUS}{SWIFT_PASTE}{SWIFT_AX_ACTIONS}{SWIFT_OVERLAY_AND_MAIN}"
- )
+ format!("{SWIFT_HEADER_AND_FOCUS}{SWIFT_PASTE}{SWIFT_AX_ACTIONS}{SWIFT_OVERLAY_AND_MAIN}")
}
diff --git a/crates/openhuman-core/src/desktop/app_state/ops.rs b/crates/openhuman-core/src/desktop/app_state/ops.rs
index db16f49510..fa72540fe6 100644
--- a/crates/openhuman-core/src/desktop/app_state/ops.rs
+++ b/crates/openhuman-core/src/desktop/app_state/ops.rs
@@ -83,7 +83,9 @@ pub use auth_timeout::{
};
pub use current_user::peek_cached_current_user_identity;
pub use current_user_generation::{forget_current_user_caches, CURRENT_USER_SESSION_MUTATION_LOCK};
-pub(crate) use state_file::load_stored_app_state;
pub use snapshot::{snapshot, update_local_state};
+pub(crate) use state_file::load_stored_app_state;
pub use state_file::save_app_state;
-pub use types::{AppStateSnapshot, RuntimeSnapshot, StoredAppState, StoredAppStatePatch, StoredOnboardingTasks};
+pub use types::{
+ AppStateSnapshot, RuntimeSnapshot, StoredAppState, StoredAppStatePatch, StoredOnboardingTasks,
+};
diff --git a/crates/openhuman-core/src/desktop/app_state/ops/current_user.rs b/crates/openhuman-core/src/desktop/app_state/ops/current_user.rs
index c1f9d00dbb..c0df8c8639 100644
--- a/crates/openhuman-core/src/desktop/app_state/ops/current_user.rs
+++ b/crates/openhuman-core/src/desktop/app_state/ops/current_user.rs
@@ -6,13 +6,13 @@
//! owns sign-out invalidation of these caches; [`staleness`](super::staleness)
//! reports how old the data being served is.
+use super::auth_timeout::{auth_fetch_timeout, current_user_backoff_base};
use super::current_user_fetch::{fetch_current_user, sanitize_snapshot_user};
use super::current_user_generation::{
clear_current_user_failure_unless_stale, current_user_generation,
note_current_user_success_unless_stale, record_current_user_failure_locked,
record_current_user_failure_unless_stale,
};
-use super::auth_timeout::{auth_fetch_timeout, current_user_backoff_base};
use super::LOG_PREFIX;
use crate::api::config::effective_backend_api_url;
use crate::config::Config;
@@ -164,7 +164,11 @@ pub(super) fn suppressed_current_user_failure(
///
/// A [`CurrentUserFetchError::Rejected`] is ignored — see
/// [`CurrentUserFetchError::is_availability_failure`].
-pub(super) fn record_current_user_failure(api_base: &str, token: &str, error: CurrentUserFetchError) {
+pub(super) fn record_current_user_failure(
+ api_base: &str,
+ token: &str,
+ error: CurrentUserFetchError,
+) {
if !error.is_availability_failure() {
return;
}
@@ -529,8 +533,7 @@ pub(super) async fn refresh_current_user_now(
/// cache TTL is **ignored** here intentionally — for prompt rendering
/// a slightly stale identity is fine; the freshness check only
/// matters for the snapshot RPC that fronts the React shell.
-pub fn peek_cached_current_user_identity() -> Option<crate::agent::prompts::UserIdentity>
-{
+pub fn peek_cached_current_user_identity() -> Option<crate::agent::prompts::UserIdentity> {
let cache = CURRENT_USER_CACHE.lock();
let entry = cache.as_ref()?;
let user = entry.user.as_object()?;
diff --git a/crates/openhuman-core/src/desktop/app_state/ops/current_user_fetch.rs b/crates/openhuman-core/src/desktop/app_state/ops/current_user_fetch.rs
index af06f1c63e..bd6bd3ed22 100644
--- a/crates/openhuman-core/src/desktop/app_state/ops/current_user_fetch.rs
+++ b/crates/openhuman-core/src/desktop/app_state/ops/current_user_fetch.rs
@@ -13,7 +13,8 @@ use reqwest::{header::AUTHORIZATION, Client, Method, Url};
use serde_json::Value;
use std::time::Duration;
-pub(super) const AUTH_ME_REVALIDATION_TRANSIENT_STATUSES: &[u16] = &[408, 429, 500, 502, 503, 504, 520];
+pub(super) const AUTH_ME_REVALIDATION_TRANSIENT_STATUSES: &[u16] =
+ &[408, 429, 500, 502, 503, 504, 520];
/// One process-wide client for `GET /auth/me`, so its pooled TCP+TLS
/// connection survives between snapshot polls instead of being handshaken
diff --git a/crates/openhuman-core/src/desktop/app_state/ops/current_user_generation.rs b/crates/openhuman-core/src/desktop/app_state/ops/current_user_generation.rs
index 4774f53d3d..d19056fe1e 100644
--- a/crates/openhuman-core/src/desktop/app_state/ops/current_user_generation.rs
+++ b/crates/openhuman-core/src/desktop/app_state/ops/current_user_generation.rs
@@ -123,7 +123,11 @@ pub(super) fn record_current_user_failure_unless_stale(
/// Stamp a refreshed user's freshness only if `generation` is still current,
/// **checked while holding the success lock** — the same check-then-act the
/// failure recorder avoids, for the same reason.
-pub(super) fn note_current_user_success_unless_stale(generation: u64, api_base: &str, token: &str) -> bool {
+pub(super) fn note_current_user_success_unless_stale(
+ generation: u64,
+ api_base: &str,
+ token: &str,
+) -> bool {
let mut success = LAST_CURRENT_USER_SUCCESS.lock();
if current_user_generation() != generation {
return false;
diff --git a/crates/openhuman-core/src/desktop/app_state/ops/pending_session.rs b/crates/openhuman-core/src/desktop/app_state/ops/pending_session.rs
index 6f4078ef2a..1149b1adb7 100644
--- a/crates/openhuman-core/src/desktop/app_state/ops/pending_session.rs
+++ b/crates/openhuman-core/src/desktop/app_state/ops/pending_session.rs
@@ -6,12 +6,10 @@
use super::current_user_generation::{
current_user_generation, forget_current_user_caches, CURRENT_USER_SESSION_MUTATION_LOCK,
};
+use super::LOG_PREFIX;
use crate::api::rest::user_id_from_profile_payload;
use crate::config::Config;
-use crate::security::credentials::{
- AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,
-};
-use super::LOG_PREFIX;
+use crate::security::credentials::{AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME};
use log::{debug, warn};
use serde_json::Value;
use std::collections::{BTreeMap, HashMap};
diff --git a/crates/openhuman-core/src/desktop/app_state/ops/runtime_snapshot.rs b/crates/openhuman-core/src/desktop/app_state/ops/runtime_snapshot.rs
index 1fd7916d15..b69bfe3c5a 100644
--- a/crates/openhuman-core/src/desktop/app_state/ops/runtime_snapshot.rs
+++ b/crates/openhuman-core/src/desktop/app_state/ops/runtime_snapshot.rs
@@ -60,7 +60,10 @@ pub(super) fn service_status_mock_active() -> bool {
std::env::var_os("OPENHUMAN_SERVICE_MOCK").is_some()
}
-pub(super) fn fresh_cached_runtime_snapshot(config: &Config, req_id: u64) -> Option<RuntimeSnapshot> {
+pub(super) fn fresh_cached_runtime_snapshot(
+ config: &Config,
+ req_id: u64,
+) -> Option<RuntimeSnapshot> {
if service_status_mock_active() {
return None;
}
diff --git a/crates/openhuman-core/src/desktop/app_state/ops/snapshot.rs b/crates/openhuman-core/src/desktop/app_state/ops/snapshot.rs
index 395027f2e7..9d92e04cdc 100644
--- a/crates/openhuman-core/src/desktop/app_state/ops/snapshot.rs
+++ b/crates/openhuman-core/src/desktop/app_state/ops/snapshot.rs
@@ -2,16 +2,21 @@
//! polled entry point that assembles auth, current-user, runtime and local
//! on-disk state into one response for the frontend.
-use super::current_user::{current_user_api_base, fetch_current_user_cached, note_current_user_timeout, CurrentUserFetchError};
+use super::auth_timeout::auth_fetch_timeout;
+use super::current_user::{
+ current_user_api_base, fetch_current_user_cached, note_current_user_timeout,
+ CurrentUserFetchError,
+};
use super::current_user_fetch::sanitize_snapshot_user;
use super::current_user_generation::{current_user_generation, CURRENT_USER_SESSION_MUTATION_LOCK};
-use super::auth_timeout::auth_fetch_timeout;
use super::pending_session::{
clear_deferred_session_after_backend_rejection, clear_pending_backend_validation_flag,
- pending_session_user_id_for_cleanup, persist_revalidated_session_user,
- same_config_state_dir, snapshot_user_pending_backend_validation,
+ pending_session_user_id_for_cleanup, persist_revalidated_session_user, same_config_state_dir,
+ snapshot_user_pending_backend_validation,
+};
+use super::runtime_snapshot::{
+ build_runtime_snapshot, degraded_runtime_snapshot, RUNTIME_SNAPSHOT_TIMEOUT,
};
-use super::runtime_snapshot::{build_runtime_snapshot, degraded_runtime_snapshot, RUNTIME_SNAPSHOT_TIMEOUT};
use super::staleness::current_user_staleness;
use super::state_file::{
load_stored_app_state, load_stored_app_state_unlocked, save_stored_app_state_unlocked,
@@ -53,7 +58,6 @@ pub(super) fn snapshot_current_user_result(user: Option<Value>) -> SnapshotCurre
(SnapshotCurrentUser::user(user), None)
}
-
pub async fn snapshot() -> Result<RpcOutcome<AppStateSnapshot>, String> {
let req_id = SNAPSHOT_REQ_COUNTER.fetch_add(1, Ordering::Relaxed);
let t_total = Instant::now();
@@ -356,9 +360,7 @@ pub async fn snapshot() -> Result<RpcOutcome<AppStateSnapshot>, String> {
let t_local_state = Instant::now();
let local_state = load_stored_app_state(&snapshot_config)?;
- crate::security::keyring_consent::policy::initialize(
- local_state.keyring_consent.clone(),
- );
+ crate::security::keyring_consent::policy::initialize(local_state.keyring_consent.clone());
let local_state_ms = t_local_state.elapsed().as_millis();
let total_ms = t_total.elapsed().as_millis();
@@ -401,7 +403,6 @@ pub async fn snapshot() -> Result<RpcOutcome<AppStateSnapshot>, String> {
))
}
-
pub async fn update_local_state(
patch: StoredAppStatePatch,
) -> Result<RpcOutcome<StoredAppState>, String> {
diff --git a/crates/openhuman-core/src/desktop/app_state/ops/types.rs b/crates/openhuman-core/src/desktop/app_state/ops/types.rs
index de4f127939..34ecab21ed 100644
--- a/crates/openhuman-core/src/desktop/app_state/ops/types.rs
+++ b/crates/openhuman-core/src/desktop/app_state/ops/types.rs
@@ -95,6 +95,5 @@ pub struct StoredAppStatePatch {
#[serde(default)]
pub onboarding_tasks: Option<Option<StoredOnboardingTasks>>,
#[serde(default)]
- pub keyring_consent:
- Option<Option<crate::security::keyring_consent::ConsentPreference>>,
+ pub keyring_consent: Option<Option<crate::security::keyring_consent::ConsentPreference>>,
}
diff --git a/crates/openhuman-core/src/flows/builder_tools.rs b/crates/openhuman-core/src/flows/builder_tools.rs
index 98e29edbee..2f98c2d7ce 100644
--- a/crates/openhuman-core/src/flows/builder_tools.rs
+++ b/crates/openhuman-core/src/flows/builder_tools.rs
@@ -77,8 +77,8 @@ mod persistence;
mod run_control;
mod tool_contract;
-pub use catalog_search::SearchToolCatalogTool;
pub(crate) use catalog_search::search_live_catalog;
+pub use catalog_search::SearchToolCatalogTool;
pub use connection_reads::{ListConnectableToolkitsTool, ListFlowConnectionsTool};
pub use draft_edit::EditWorkflowTool;
pub use draft_revise::ReviseWorkflowTool;
diff --git a/crates/openhuman-core/src/flows/builder_tools/catalog_search.rs b/crates/openhuman-core/src/flows/builder_tools/catalog_search.rs
index 123038ee13..e429bfc59c 100644
--- a/crates/openhuman-core/src/flows/builder_tools/catalog_search.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/catalog_search.rs
@@ -164,10 +164,7 @@ pub(crate) async fn search_catalog(
// Drop toolkits whose fetch failed (no backend session / network error) —
// they contribute zero results rather than erroring the whole search.
- let fetched: Vec<(
- String,
- Vec<crate::flows::tinyflows::caps::ToolContract>,
- )> = fetched
+ let fetched: Vec<(String, Vec<crate::flows::tinyflows::caps::ToolContract>)> = fetched
.into_iter()
.filter_map(|(tk, catalog)| catalog.map(|c| (tk, c)))
.collect();
@@ -388,4 +385,3 @@ impl Tool for SearchToolCatalogTool {
)?))
}
}
-
diff --git a/crates/openhuman-core/src/flows/builder_tools/connection_reads.rs b/crates/openhuman-core/src/flows/builder_tools/connection_reads.rs
index cfbc13f526..3757cb721b 100644
--- a/crates/openhuman-core/src/flows/builder_tools/connection_reads.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/connection_reads.rs
@@ -9,7 +9,6 @@ use crate::config::Config;
use crate::flows::ops;
use crate::tools::traits::{PermissionLevel, Tool, ToolResult};
-
/// `list_connectable_toolkits`: read-only list of the Composio toolkits the
/// builder can wire, each tagged connected/unconnected — so the agent can steer
/// toolkit choice toward what's already connected (audit Phase 5, item 19).
@@ -154,4 +153,3 @@ pub(super) fn flow_connection_to_json(c: &crate::flows::types::FlowConnection) -
"platform_user_id": c.platform_user_id,
})
}
-
diff --git a/crates/openhuman-core/src/flows/builder_tools/draft_edit.rs b/crates/openhuman-core/src/flows/builder_tools/draft_edit.rs
index 4fa994da08..612fbb2aac 100644
--- a/crates/openhuman-core/src/flows/builder_tools/draft_edit.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/draft_edit.rs
@@ -493,4 +493,3 @@ impl Tool for EditWorkflowTool {
}
}
}
-
diff --git a/crates/openhuman-core/src/flows/builder_tools/draft_revise.rs b/crates/openhuman-core/src/flows/builder_tools/draft_revise.rs
index e7df2b7897..78f938b88d 100644
--- a/crates/openhuman-core/src/flows/builder_tools/draft_revise.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/draft_revise.rs
@@ -152,4 +152,3 @@ impl Tool for ReviseWorkflowTool {
}
}
}
-
diff --git a/crates/openhuman-core/src/flows/builder_tools/draft_validate.rs b/crates/openhuman-core/src/flows/builder_tools/draft_validate.rs
index 48e6ece924..64f124a7ac 100644
--- a/crates/openhuman-core/src/flows/builder_tools/draft_validate.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/draft_validate.rs
@@ -193,4 +193,3 @@ pub(super) fn validate_workflow_report_is_ok(
) -> bool {
structurally_valid && gate_errors.is_empty() && !gate_check_failed
}
-
diff --git a/crates/openhuman-core/src/flows/builder_tools/dry_run.rs b/crates/openhuman-core/src/flows/builder_tools/dry_run.rs
index f333b85fb1..fe0357f2b4 100644
--- a/crates/openhuman-core/src/flows/builder_tools/dry_run.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/dry_run.rs
@@ -12,11 +12,9 @@ use crate::flows::ops::validate_and_migrate_graph;
use crate::tools::traits::{PermissionLevel, Tool, ToolResult};
use super::dry_run_diagnostics::{
- find_upstream_condition, tool_call_arg_null_entries, tool_call_error_message,
- CapturingObserver,
+ find_upstream_condition, tool_call_arg_null_entries, tool_call_error_message, CapturingObserver,
};
-
/// Wall-clock bound on a single `dry_run_workflow` mock execution. A malformed
/// or pathological draft graph must never hang the agent tool-loop; the mock
/// capabilities are non-blocking echoes, so this is a generous safety net.
@@ -272,16 +270,13 @@ impl Tool for DryRunWorkflowTool {
// `SchemaAwareMockLlm`'s doc). Swap the vendored `MockLlm` echo for the
// schema-aware mock so their `output_parser.schema` is honored too,
// instead of the echo shape failing the sub-port's validation.
- caps.llm =
- std::sync::Arc::new(crate::flows::tinyflows::caps::SchemaAwareMockLlm);
+ caps.llm = std::sync::Arc::new(crate::flows::tinyflows::caps::SchemaAwareMockLlm);
// Wiring preflight over the echo mocks (see the struct doc): required
// Composio args must be present and non-null even in the sandbox.
- caps.tools = std::sync::Arc::new(
- crate::flows::tinyflows::caps::PreflightToolInvoker {
- config: self.config.clone(),
- inner: caps.tools.clone(),
- },
- );
+ caps.tools = std::sync::Arc::new(crate::flows::tinyflows::caps::PreflightToolInvoker {
+ config: self.config.clone(),
+ inner: caps.tools.clone(),
+ });
// Which node ids are `tool_call` nodes — the null-resolution check
// below is scoped to just these (see the struct doc: a null in an
diff --git a/crates/openhuman-core/src/flows/builder_tools/dry_run_diagnostics.rs b/crates/openhuman-core/src/flows/builder_tools/dry_run_diagnostics.rs
index b0c7884c82..c14a6ab237 100644
--- a/crates/openhuman-core/src/flows/builder_tools/dry_run_diagnostics.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/dry_run_diagnostics.rs
@@ -4,7 +4,6 @@
use serde_json::{json, Value};
use tinyflows::model::WorkflowGraph;
-
/// Builds one `null_resolutions` diagnostic entry for a `tool_call` node's
/// null-resolved `args.*` config expression.
///
@@ -104,7 +103,6 @@ pub(super) fn tool_call_arg_null_entries(
.collect()
}
-
/// Walks a graph backward from `node_id`'s predecessors (any number of hops)
/// to find the nearest ancestor that is a `condition` node — used to name the
/// branch responsible for a routing-divergence warning (see
diff --git a/crates/openhuman-core/src/flows/builder_tools/flow_reads.rs b/crates/openhuman-core/src/flows/builder_tools/flow_reads.rs
index 889a1df8db..582d252953 100644
--- a/crates/openhuman-core/src/flows/builder_tools/flow_reads.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/flow_reads.rs
@@ -353,4 +353,3 @@ impl Tool for GetFlowRunTool {
}
}
}
-
diff --git a/crates/openhuman-core/src/flows/builder_tools/kind_reads.rs b/crates/openhuman-core/src/flows/builder_tools/kind_reads.rs
index d680ba07a8..51c7c6fd4b 100644
--- a/crates/openhuman-core/src/flows/builder_tools/kind_reads.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/kind_reads.rs
@@ -250,4 +250,3 @@ impl Tool for GetNodeKindContractTool {
}
}
}
-
diff --git a/crates/openhuman-core/src/flows/builder_tools/persistence.rs b/crates/openhuman-core/src/flows/builder_tools/persistence.rs
index 5cc521e1c2..0a6ad71faf 100644
--- a/crates/openhuman-core/src/flows/builder_tools/persistence.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/persistence.rs
@@ -147,7 +147,10 @@ impl Tool for CreateWorkflowTool {
/// the flow's real post-attempt state, not the intended one — is
/// unit-testable without forcing a genuine concurrent store failure between
/// `flows_create` and `flows_set_enabled`.
-pub(super) fn create_workflow_report(born_enabled: bool, disable_succeeded: bool) -> (bool, &'static str) {
+pub(super) fn create_workflow_report(
+ born_enabled: bool,
+ disable_succeeded: bool,
+) -> (bool, &'static str) {
let enabled = born_enabled && !disable_succeeded;
let note = if enabled {
"Flow created, but it could NOT be force-disabled (see the tool result for the \
diff --git a/crates/openhuman-core/src/flows/builder_tools/run_control.rs b/crates/openhuman-core/src/flows/builder_tools/run_control.rs
index 7e97b70077..9ba956e16f 100644
--- a/crates/openhuman-core/src/flows/builder_tools/run_control.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/run_control.rs
@@ -13,7 +13,6 @@ use crate::tools::traits::{PermissionLevel, Tool, ToolResult};
// Phase 4 — the self-debug loop + gated create (F4, F7)
// ─────────────────────────────────────────────────────────────────────────────
-
/// `resume_flow_run`: progress a run parked on a human approval by
/// approving/rejecting its pending node(s). Execute + approval-gated — it
/// advances a REAL run that can fire real outbound effects.
diff --git a/crates/openhuman-core/src/flows/builder_tools/tool_contract.rs b/crates/openhuman-core/src/flows/builder_tools/tool_contract.rs
index a09c7d2f99..bedf4d543f 100644
--- a/crates/openhuman-core/src/flows/builder_tools/tool_contract.rs
+++ b/crates/openhuman-core/src/flows/builder_tools/tool_contract.rs
@@ -102,11 +102,8 @@ impl Tool for GetToolContractTool {
"[flows] get_tool_contract: fetching the live contract (read-only)"
);
- let Some(catalog) = crate::flows::tinyflows::caps::fetch_live_toolkit_catalog(
- &self.config,
- &toolkit,
- )
- .await
+ let Some(catalog) =
+ crate::flows::tinyflows::caps::fetch_live_toolkit_catalog(&self.config, &toolkit).await
else {
return Ok(ToolResult::error(format!(
"Could not fetch the live Composio catalog for toolkit '{toolkit}' (no backend \
@@ -124,9 +121,8 @@ impl Tool for GetToolContractTool {
// every GitHub action verified live as of this fix), where
// `contract.primary_array_path` would otherwise be
// permanently `None`.
- let contract = crate::flows::tinyflows::caps::apply_probe_override(
- contract.clone(),
- );
+ let contract =
+ crate::flows::tinyflows::caps::apply_probe_override(contract.clone());
// WS3 — EARLY runtime-gate warning (transcript failure #2): a
// real-but-uncurated action of a toolkit that ships a curated
diff --git a/crates/openhuman-core/src/flows/builder_tools_tests.rs b/crates/openhuman-core/src/flows/builder_tools_tests.rs
index 36214d422e..49ba202fe0 100644
--- a/crates/openhuman-core/src/flows/builder_tools_tests.rs
+++ b/crates/openhuman-core/src/flows/builder_tools_tests.rs
@@ -218,13 +218,13 @@ fn cancel_test_approval_gated_graph() -> Value {
})
}
-#[path = "builder_tools_reads_and_catalog_tests.rs"]
-mod reads_and_catalog_tests;
+#[path = "builder_tools_draft_id_tests.rs"]
+mod draft_id_tests;
#[path = "builder_tools_dry_run_tests.rs"]
mod dry_run_tests;
+#[path = "builder_tools_reads_and_catalog_tests.rs"]
+mod reads_and_catalog_tests;
#[path = "builder_tools_save_and_edit_tests.rs"]
mod save_and_edit_tests;
#[path = "builder_tools_validate_and_create_tests.rs"]
mod validate_and_create_tests;
-#[path = "builder_tools_draft_id_tests.rs"]
-mod draft_id_tests;
diff --git a/crates/openhuman-core/src/flows/catalogue_tests.rs b/crates/openhuman-core/src/flows/catalogue_tests.rs
index 7ef2abf2c1..678e7c9ff2 100644
--- a/crates/openhuman-core/src/flows/catalogue_tests.rs
+++ b/crates/openhuman-core/src/flows/catalogue_tests.rs
@@ -224,14 +224,9 @@ fn a_saved_flow_reaches_the_catalogue_with_its_real_id() {
],
..Default::default()
};
- let saved = super::super::store::create_flow(
- &config,
- "Weekly Report".to_string(),
- graph,
- false,
- true,
- )
- .expect("flow saves");
+ let saved =
+ super::super::store::create_flow(&config, "Weekly Report".to_string(), graph, false, true)
+ .expect("flow saves");
let entries = flow_entries(&config);
assert_eq!(entries.len(), 1, "the saved flow must appear: {entries:?}");
diff --git a/crates/openhuman-core/src/flows/ops.rs b/crates/openhuman-core/src/flows/ops.rs
index 5821e7cd8b..988e246138 100644
--- a/crates/openhuman-core/src/flows/ops.rs
+++ b/crates/openhuman-core/src/flows/ops.rs
@@ -65,11 +65,11 @@ use crate::flows::types::{
FlowConnection, FlowRunStep, FlowRunTrigger, FlowSuggestion, SuggestionStatus,
};
use crate::flows::{flow_namespace, Flow, FlowRun};
+use crate::rpc::RpcOutcome;
use crate::security::approval::{
ApprovalChatContext, FlowRunContext, APPROVAL_CHAT_CONTEXT, APPROVAL_COPILOT_STREAM_CONTEXT,
APPROVAL_FLOW_RUN_CONTEXT,
};
-use crate::rpc::RpcOutcome;
use tinyflows_catalog::build_registry;
// `MemoryProvider` brings `driver_id()` / `as_documents()` into scope for the
// `MemoryGuard` this file's delete path clears through. Nothing here names the
@@ -140,7 +140,6 @@ const GRAPH_CHANGED_SINCE_PARK_ERROR: &str = "the workflow changed after this ru
// `Write` (code) is `Allow` under full, so trusted automations run sandboxed
// code unattended; read-only blocks both outright.
-
mod approval_manifest;
mod builder;
mod builder_gates;
diff --git a/crates/openhuman-core/src/flows/ops/approval_manifest.rs b/crates/openhuman-core/src/flows/ops/approval_manifest.rs
index 8305850094..435df2ca13 100644
--- a/crates/openhuman-core/src/flows/ops/approval_manifest.rs
+++ b/crates/openhuman-core/src/flows/ops/approval_manifest.rs
@@ -110,15 +110,9 @@ pub async fn compute_approval_manifest(config: &Config, graph: &WorkflowGraph) -
"label": "Tool chosen at run time",
}));
}
- Some(s)
- if s.starts_with(
- crate::flows::tinyflows::caps::NATIVE_TOOL_PREFIX,
- ) =>
- {
+ Some(s) if s.starts_with(crate::flows::tinyflows::caps::NATIVE_TOOL_PREFIX) => {
let tool_name = s
- .trim_start_matches(
- crate::flows::tinyflows::caps::NATIVE_TOOL_PREFIX,
- )
+ .trim_start_matches(crate::flows::tinyflows::caps::NATIVE_TOOL_PREFIX)
.trim()
.to_string();
if tool_name.is_empty() {
diff --git a/crates/openhuman-core/src/flows/ops/builder.rs b/crates/openhuman-core/src/flows/ops/builder.rs
index f9ccfe24d2..3b96c852d9 100644
--- a/crates/openhuman-core/src/flows/ops/builder.rs
+++ b/crates/openhuman-core/src/flows/ops/builder.rs
@@ -80,8 +80,7 @@ pub(crate) async fn flows_build_with_extra_hidden_tools(
// absent, so the WebChat origin below would NOT park and the unhidden
// live-run tools would execute unapproved. Fall back to the full hide-list
// whenever the gate is not installed, regardless of `stream`. (codex #5090)
- let approval_gate_active =
- crate::security::approval::ApprovalGate::try_global().is_some();
+ let approval_gate_active = crate::security::approval::ApprovalGate::try_global().is_some();
if stream.is_some() && approval_gate_active {
restrict_builder_toolset_for_copilot(&mut agent);
} else {
diff --git a/crates/openhuman-core/src/flows/ops/builder_gates.rs b/crates/openhuman-core/src/flows/ops/builder_gates.rs
index 80e0cc4c11..9f6c6770ec 100644
--- a/crates/openhuman-core/src/flows/ops/builder_gates.rs
+++ b/crates/openhuman-core/src/flows/ops/builder_gates.rs
@@ -431,8 +431,7 @@ pub(crate) async fn validate_agent_refs(config: &Config, graph: &WorkflowGraph)
}
AgentRoute::RegistryFallback => {
if custom_registry.is_none() {
- custom_registry =
- Some(crate::agent::registry::list_agents(true).await);
+ custom_registry = Some(crate::agent::registry::list_agents(true).await);
}
match custom_registry.as_ref().expect("just populated") {
Ok(entries) => match entries.iter().find(|entry| entry.id == agent_ref) {
diff --git a/crates/openhuman-core/src/flows/ops/catalog.rs b/crates/openhuman-core/src/flows/ops/catalog.rs
index 768dc58ddb..8d062c2f24 100644
--- a/crates/openhuman-core/src/flows/ops/catalog.rs
+++ b/crates/openhuman-core/src/flows/ops/catalog.rs
@@ -15,8 +15,7 @@ pub async fn flows_search_tool_catalog(
) -> Result<RpcOutcome<Value>, String> {
tracing::debug!(target: "flows", %query, toolkit = toolkit.unwrap_or("<all>"), "[flows] flows_search_tool_catalog: searching live catalog");
let tools =
- crate::flows::builder_tools::search_live_catalog(config, query, toolkit, limit)
- .await;
+ crate::flows::builder_tools::search_live_catalog(config, query, toolkit, limit).await;
Ok(RpcOutcome::single_log(
json!({ "tools": tools }),
"tool catalog searched",
@@ -71,8 +70,7 @@ pub async fn flows_get_tool_contract(
};
tracing::debug!(target: "flows", slug = %trimmed, %toolkit, "[flows] flows_get_tool_contract: fetching contract");
let Some(catalog) =
- crate::flows::tinyflows::caps::fetch_live_toolkit_catalog(config, &toolkit)
- .await
+ crate::flows::tinyflows::caps::fetch_live_toolkit_catalog(config, &toolkit).await
else {
return Err(format!(
"Could not fetch the live Composio catalog for toolkit '{toolkit}'."
@@ -83,8 +81,7 @@ pub async fn flows_get_tool_contract(
.find(|c| c.slug.eq_ignore_ascii_case(trimmed))
{
Some(contract) => {
- let contract =
- crate::flows::tinyflows::caps::apply_probe_override(contract.clone());
+ let contract = crate::flows::tinyflows::caps::apply_probe_override(contract.clone());
let value = serde_json::to_value(&contract).map_err(|e| e.to_string())?;
Ok(RpcOutcome::single_log(
json!({ "contract": value }),
diff --git a/crates/openhuman-core/src/flows/ops/connection_ref_gate.rs b/crates/openhuman-core/src/flows/ops/connection_ref_gate.rs
index 802e2fa3c5..cd35150ffc 100644
--- a/crates/openhuman-core/src/flows/ops/connection_ref_gate.rs
+++ b/crates/openhuman-core/src/flows/ops/connection_ref_gate.rs
@@ -61,8 +61,7 @@ pub(crate) async fn validate_connection_refs(
graph: &WorkflowGraph,
) -> Vec<String> {
let connections: Option<Vec<FlowConnection>> =
- match crate::integrations::composio::ops::composio_list_connections(config).await
- {
+ match crate::integrations::composio::ops::composio_list_connections(config).await {
Ok(outcome) => Some(build_flow_connections(
outcome.value.connections,
Vec::new(),
diff --git a/crates/openhuman-core/src/flows/ops/connections.rs b/crates/openhuman-core/src/flows/ops/connections.rs
index bce031a626..c2250a1863 100644
--- a/crates/openhuman-core/src/flows/ops/connections.rs
+++ b/crates/openhuman-core/src/flows/ops/connections.rs
@@ -24,8 +24,7 @@ pub async fn flows_list_connections(
// error); a backend outage returns Err — tolerate it so the picker still
// surfaces HTTP credentials.
let composio_conns =
- match crate::integrations::composio::ops::composio_list_connections(config).await
- {
+ match crate::integrations::composio::ops::composio_list_connections(config).await {
Ok(outcome) => {
tracing::debug!(
count = outcome.value.connections.len(),
@@ -50,9 +49,7 @@ pub async fn flows_list_connections(
// out secret material here; injection happens server-side in
// `tinyflows::caps::OpenHumanHttp`).
let http_creds =
- match crate::security::credentials::HttpCredentialsStore::from_config(config)
- .list()
- {
+ match crate::security::credentials::HttpCredentialsStore::from_config(config).list() {
Ok(list) => {
tracing::debug!(
count = list.len(),
@@ -78,17 +75,15 @@ pub async fn flows_list_connections(
// connection sync. Loaded once here so `build_flow_connections` can stay
// a pure, unit-testable matcher.
let identities =
- crate::integrations::composio::identity_store::load_connected_identities(
- config,
- )
- .await
- .unwrap_or_else(|error| {
- tracing::warn!(
- %error,
- "[flows] flows_list_connections: load_connected_identities failed"
- );
- Vec::new()
- });
+ crate::integrations::composio::identity_store::load_connected_identities(config)
+ .await
+ .unwrap_or_else(|error| {
+ tracing::warn!(
+ %error,
+ "[flows] flows_list_connections: load_connected_identities failed"
+ );
+ Vec::new()
+ });
tracing::debug!(
count = identities.len(),
"[flows] flows_list_connections: identity-cache load"
@@ -213,9 +208,7 @@ fn composio_connection_display(
/// Human-readable picker label for a named HTTP credential, e.g.
/// `"stripe (bearer)"`. Only the (non-secret) name + scheme — never the value.
-fn http_credential_display(
- cred: &crate::security::credentials::HttpCredentialSummary,
-) -> String {
+fn http_credential_display(cred: &crate::security::credentials::HttpCredentialSummary) -> String {
format!("{} ({})", cred.name, cred.scheme)
}
diff --git a/crates/openhuman-core/src/flows/ops/discovery.rs b/crates/openhuman-core/src/flows/ops/discovery.rs
index b78bae1eeb..68c2422642 100644
--- a/crates/openhuman-core/src/flows/ops/discovery.rs
+++ b/crates/openhuman-core/src/flows/ops/discovery.rs
@@ -77,11 +77,8 @@ pub async fn flows_discover(
);
let timed = match &stream {
Some(target) => {
- crate::agent::tinyagents::thread_context::with_thread_id(
- target.thread_id.clone(),
- run,
- )
- .await
+ crate::agent::tinyagents::thread_context::with_thread_id(target.thread_id.clone(), run)
+ .await
}
None => run.await,
};
diff --git a/crates/openhuman-core/src/flows/ops/execution.rs b/crates/openhuman-core/src/flows/ops/execution.rs
index 1a197689da..202fe6e9e6 100644
--- a/crates/openhuman-core/src/flows/ops/execution.rs
+++ b/crates/openhuman-core/src/flows/ops/execution.rs
@@ -194,10 +194,8 @@ pub(super) async fn run_flow_body(
};
// Scope the state store per-flow so two flows never collide on a state key.
- let caps = crate::flows::tinyflows::build_capabilities(
- config_arc.clone(),
- format!("flow:{flow_id}"),
- );
+ let caps =
+ crate::flows::tinyflows::build_capabilities(config_arc.clone(), format!("flow:{flow_id}"));
let checkpointer = match crate::flows::tinyflows::open_flow_checkpointer(config) {
Ok(checkpointer) => checkpointer,
Err(e) => {
diff --git a/crates/openhuman-core/src/flows/ops/inference_readiness.rs b/crates/openhuman-core/src/flows/ops/inference_readiness.rs
index 639a3c7193..630305e99c 100644
--- a/crates/openhuman-core/src/flows/ops/inference_readiness.rs
+++ b/crates/openhuman-core/src/flows/ops/inference_readiness.rs
@@ -110,7 +110,10 @@ fn invalidate_inference_probe_cache_if_signed_out() {
}
}
-pub(super) async fn cached_probe_inference_readiness(role: &str, config: &Config) -> Result<(), String> {
+pub(super) async fn cached_probe_inference_readiness(
+ role: &str,
+ config: &Config,
+) -> Result<(), String> {
invalidate_inference_probe_cache_if_signed_out();
let key: InferenceProbeCacheKey = (role.to_string(), config.config_path.clone());
@@ -132,8 +135,7 @@ pub(super) async fn cached_probe_inference_readiness(role: &str, config: &Config
}
}
- let result =
- crate::inference::provider::probe_inference_readiness(role, config).await;
+ let result = crate::inference::provider::probe_inference_readiness(role, config).await;
INFERENCE_PROBE_CACHE
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
@@ -187,9 +189,8 @@ pub(super) fn agent_node_role(config: &Config, node: &tinyflows::model::Node) ->
.map(str::trim)
.filter(|s| !s.is_empty() && !s.starts_with('='));
if let Some(agent_ref) = static_agent_ref {
- if let Some(entry_model) =
- crate::agent::registry::find_custom_in_config(config, agent_ref)
- .and_then(|entry| entry.model)
+ if let Some(entry_model) = crate::agent::registry::find_custom_in_config(config, agent_ref)
+ .and_then(|entry| entry.model)
{
let entry_model = entry_model.trim();
if !entry_model.is_empty() {
@@ -271,9 +272,8 @@ pub(super) async fn evaluate_inference_readiness(
config,
)
});
- let needs_session =
- crate::inference::provider::factory::current_host_requires_session()
- || needs_backend_session;
+ let needs_session = crate::inference::provider::factory::current_host_requires_session()
+ || needs_backend_session;
// Layer 1: signed-out is the cheapest, most decisive check. Session-wide
// — checked once for the whole graph, not per node/role.
diff --git a/crates/openhuman-core/src/flows/ops/resume.rs b/crates/openhuman-core/src/flows/ops/resume.rs
index e458470dea..1d8fd8846e 100644
--- a/crates/openhuman-core/src/flows/ops/resume.rs
+++ b/crates/openhuman-core/src/flows/ops/resume.rs
@@ -1,6 +1,5 @@
use super::*;
-
/// Resumes a `flows_run` that paused at a human-in-the-loop approval gate,
/// continuing it from the durable checkpoint (`thread_id`) with
/// `approvals` newly granted. The UI approval card (B3) calls this once the
@@ -209,12 +208,10 @@ pub async fn flows_resume(
}
let compiled = tinyflows::compiler::compile(&flow.graph).map_err(|e| e.to_string())?;
let config_arc = Arc::new(config.clone());
- let caps = crate::flows::tinyflows::build_capabilities(
- config_arc.clone(),
- format!("flow:{flow_id}"),
- );
- let checkpointer = crate::flows::tinyflows::open_flow_checkpointer(config)
- .map_err(|e| e.to_string())?;
+ let caps =
+ crate::flows::tinyflows::build_capabilities(config_arc.clone(), format!("flow:{flow_id}"));
+ let checkpointer =
+ crate::flows::tinyflows::open_flow_checkpointer(config).map_err(|e| e.to_string())?;
// Run-lifecycle parity with `flows_run` (R-M1). A resume executes the flow's
// real approved side effects for up to `FLOW_RUN_TIMEOUT_SECS`, so it needs
diff --git a/crates/openhuman-core/src/flows/ops/run.rs b/crates/openhuman-core/src/flows/ops/run.rs
index ce26099d86..59af8d4cb1 100644
--- a/crates/openhuman-core/src/flows/ops/run.rs
+++ b/crates/openhuman-core/src/flows/ops/run.rs
@@ -120,24 +120,24 @@ pub async fn flows_run_detached(
let body_thread_id = thread_id.clone();
tokio::spawn(crate::core::runtime::context::CoreContext::propagate(
async move {
- if let Err(e) = run_flow_body(
- config_arc,
- flow,
- flow_id_owned,
- body_thread_id,
- input,
- resolved_inputs,
- trigger,
- no_actionable_nodes,
- cancel_token,
- run_guard,
- )
- .await
- {
- // The row is already reconciled by the body's terminal write /
- // finalizer — this only logs that the detached run ended in error.
- tracing::warn!(target: "flows", error = %e, "[flows] flows_run_detached: background run ended with error (row already reconciled)");
- }
+ if let Err(e) = run_flow_body(
+ config_arc,
+ flow,
+ flow_id_owned,
+ body_thread_id,
+ input,
+ resolved_inputs,
+ trigger,
+ no_actionable_nodes,
+ cancel_token,
+ run_guard,
+ )
+ .await
+ {
+ // The row is already reconciled by the body's terminal write /
+ // finalizer — this only logs that the detached run ended in error.
+ tracing::warn!(target: "flows", error = %e, "[flows] flows_run_detached: background run ended with error (row already reconciled)");
+ }
},
));
diff --git a/crates/openhuman-core/src/flows/ops/run_management.rs b/crates/openhuman-core/src/flows/ops/run_management.rs
index f43f8af1d2..d1866a317b 100644
--- a/crates/openhuman-core/src/flows/ops/run_management.rs
+++ b/crates/openhuman-core/src/flows/ops/run_management.rs
@@ -1,6 +1,5 @@
use super::*;
-
/// Cancels a flow run (issue G4), settling it to a terminal `"cancelled"`
/// status and dropping its durable checkpoint so the aborted thread can never
/// be resumed.
diff --git a/crates/openhuman-core/src/flows/ops/streaming.rs b/crates/openhuman-core/src/flows/ops/streaming.rs
index 5238832f2e..d8d93b01ec 100644
--- a/crates/openhuman-core/src/flows/ops/streaming.rs
+++ b/crates/openhuman-core/src/flows/ops/streaming.rs
@@ -115,17 +115,15 @@ pub(super) async fn finalize_flow_stream(
.await;
}
Err(err) => {
- crate::web_chat::publish_web_channel_event(
- crate::core::socketio::WebChannelEvent {
- event: "chat_error".to_string(),
- client_id: "system".to_string(),
- thread_id: target.thread_id.clone(),
- request_id: target.request_id.clone(),
- message: Some(err.clone()),
- error_type: Some("agent_error".to_string()),
- ..Default::default()
- },
- );
+ crate::web_chat::publish_web_channel_event(crate::core::socketio::WebChannelEvent {
+ event: "chat_error".to_string(),
+ client_id: "system".to_string(),
+ thread_id: target.thread_id.clone(),
+ request_id: target.request_id.clone(),
+ message: Some(err.clone()),
+ error_type: Some("agent_error".to_string()),
+ ..Default::default()
+ });
}
}
tracing::info!(
diff --git a/crates/openhuman-core/src/flows/ops/triggers.rs b/crates/openhuman-core/src/flows/ops/triggers.rs
index 496ced2a77..edb8d1f69d 100644
--- a/crates/openhuman-core/src/flows/ops/triggers.rs
+++ b/crates/openhuman-core/src/flows/ops/triggers.rs
@@ -149,7 +149,6 @@ pub(super) fn unbind_trigger(config: &Config, flow: &Flow) {
}
}
-
/// Registers (or refreshes) the `cron` job backing a `schedule`-trigger
/// flow. Idempotent — re-uses an existing binding via
/// `cron::find_flow_schedule_job` rather than creating a duplicate, so this
@@ -185,8 +184,7 @@ pub(super) fn bind_schedule_trigger(config: &Config, flow: &Flow) {
tracing::debug!(target: "flows", flow_id = %flow.id, cron_job_id = %existing.id, "[flows] refreshed existing schedule-trigger cron job");
}
}
- Ok(None) => match crate::cron::add_flow_schedule_job(config, &flow.id, schedule)
- {
+ Ok(None) => match crate::cron::add_flow_schedule_job(config, &flow.id, schedule) {
Ok(job) => {
tracing::info!(target: "flows", flow_id = %flow.id, cron_job_id = %job.id, "[flows] registered schedule-trigger cron job")
}
diff --git a/crates/openhuman-core/src/flows/ops/validation.rs b/crates/openhuman-core/src/flows/ops/validation.rs
index 501b9fb7b1..84018f44d0 100644
--- a/crates/openhuman-core/src/flows/ops/validation.rs
+++ b/crates/openhuman-core/src/flows/ops/validation.rs
@@ -128,7 +128,10 @@ pub(crate) fn to_flow_validation_error(
/// parent that is already known to fail at execution. Dynamic `=` expressions,
/// missing ids, and store failures retain their existing runtime diagnostics;
/// this gate only rejects a saved graph whose topology is demonstrably unsafe.
-pub(super) fn referenced_workflow_compatibility_errors(config: &Config, graph: &WorkflowGraph) -> Vec<String> {
+pub(super) fn referenced_workflow_compatibility_errors(
+ config: &Config,
+ graph: &WorkflowGraph,
+) -> Vec<String> {
// Descend as deep as the root graph declared it may nest, for the same
// reason as the inline walk above.
let max_depth = max_sub_workflow_depth(graph);
diff --git a/crates/openhuman-core/src/flows/ops/wiring_warnings.rs b/crates/openhuman-core/src/flows/ops/wiring_warnings.rs
index 5feb498013..a4042cd123 100644
--- a/crates/openhuman-core/src/flows/ops/wiring_warnings.rs
+++ b/crates/openhuman-core/src/flows/ops/wiring_warnings.rs
@@ -88,7 +88,10 @@ pub(crate) async fn graph_wiring_warnings(config: &Config, graph: &WorkflowGraph
/// `.item.json.<x>` fields with no `data.` prefix; flagging them as
/// "missing the `data.` segment" would rewire an already-correct binding to
/// a nonsense path (e.g. suggesting `.item.json.data.successful`).
-pub(super) async fn graph_output_field_warnings(config: &Config, graph: &WorkflowGraph) -> Vec<String> {
+pub(super) async fn graph_output_field_warnings(
+ config: &Config,
+ graph: &WorkflowGraph,
+) -> Vec<String> {
use crate::flows::tinyflows::caps::fetch_live_toolkit_catalog;
// Reading a graph's `=`-bindings is the engine's grammar, not this host's:
// both helpers were a private copy here until the gates moved upstream.
@@ -133,8 +136,7 @@ pub(super) async fn graph_output_field_warnings(config: &Config, graph: &Workflo
// exact slug overrides the schema-derived `output_fields` — most
// relevant for an action whose live listing publishes no output
// schema at all (e.g. every GitHub action, verified live).
- let contract =
- crate::flows::tinyflows::caps::apply_probe_override(contract.clone());
+ let contract = crate::flows::tinyflows::caps::apply_probe_override(contract.clone());
// Nothing real to check `field_path` against — schema unknown AND
// no probed output fields either.
if contract.output_schema.is_none() && contract.output_fields.is_empty() {
@@ -271,9 +273,7 @@ fn schema_says_path_is_non_array(output_schema: &Value, configured_path: &str) -
/// `primary_array_path` NOR an `output_schema` is known (truly nothing to
/// check against).
async fn graph_split_out_path_warnings(config: &Config, graph: &WorkflowGraph) -> Vec<String> {
- use crate::flows::tinyflows::caps::{
- apply_probe_override, fetch_live_toolkit_catalog,
- };
+ use crate::flows::tinyflows::caps::{apply_probe_override, fetch_live_toolkit_catalog};
use tinymemory_api::composio::toolkit_from_slug;
let mut warnings = Vec::new();
diff --git a/crates/openhuman-core/src/flows/ops_tests.rs b/crates/openhuman-core/src/flows/ops_tests.rs
index c1a3ef61b8..40b789f245 100644
--- a/crates/openhuman-core/src/flows/ops_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_tests.rs
@@ -693,29 +693,29 @@ const PRIOR_PROCESS_STARTED_AT: &str = "2020-01-01T00:00:00+00:00";
mod support_tests;
use support_tests::*;
+#[path = "ops_agent_binding_tests.rs"]
+mod agent_binding_tests;
+#[path = "ops_approval_manifest_and_catalog_tests.rs"]
+mod approval_manifest_and_catalog_tests;
+#[path = "ops_builder_trail_off_tests.rs"]
+mod builder_trail_off_tests;
+#[path = "ops_connection_ref_gate_tests.rs"]
+mod connection_ref_gate_tests;
#[path = "ops_engine_compatibility_tests.rs"]
mod engine_compatibility_tests;
-#[path = "ops_run_lifecycle_tests.rs"]
-mod run_lifecycle_tests;
-#[path = "ops_triggers_and_resume_tests.rs"]
-mod triggers_and_resume_tests;
+#[path = "ops_migration_and_side_effect_tests.rs"]
+mod migration_and_side_effect_tests;
#[path = "ops_resume_checkpoint_tests.rs"]
mod resume_checkpoint_tests;
+#[path = "ops_run_lifecycle_tests.rs"]
+mod run_lifecycle_tests;
#[path = "ops_run_rows_and_notifications_tests.rs"]
mod run_rows_and_notifications_tests;
-#[path = "ops_validate_warnings_and_connections_tests.rs"]
-mod validate_warnings_and_connections_tests;
-#[path = "ops_agent_binding_tests.rs"]
-mod agent_binding_tests;
-#[path = "ops_connection_ref_gate_tests.rs"]
-mod connection_ref_gate_tests;
-#[path = "ops_tool_contract_and_wiring_warnings_tests.rs"]
-mod tool_contract_and_wiring_warnings_tests;
#[path = "ops_run_status_and_prompt_binding_tests.rs"]
mod run_status_and_prompt_binding_tests;
-#[path = "ops_migration_and_side_effect_tests.rs"]
-mod migration_and_side_effect_tests;
-#[path = "ops_builder_trail_off_tests.rs"]
-mod builder_trail_off_tests;
-#[path = "ops_approval_manifest_and_catalog_tests.rs"]
-mod approval_manifest_and_catalog_tests;
+#[path = "ops_tool_contract_and_wiring_warnings_tests.rs"]
+mod tool_contract_and_wiring_warnings_tests;
+#[path = "ops_triggers_and_resume_tests.rs"]
+mod triggers_and_resume_tests;
+#[path = "ops_validate_warnings_and_connections_tests.rs"]
+mod validate_warnings_and_connections_tests;
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tests.rs b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tests.rs
index 48aa045506..d3e7fe801b 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/ops_tests.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/ops_tests.rs
@@ -84,9 +84,9 @@ fn trigger_only_graph() -> WorkflowGraph {
}
}
-#[path = "ops_tool_results_and_credentials_tests.rs"]
-mod tool_results_and_credentials_tests;
-#[path = "ops_tier_gate_and_timeouts_tests.rs"]
-mod tier_gate_and_timeouts_tests;
#[path = "ops_schema_and_structured_output_tests.rs"]
mod schema_and_structured_output_tests;
+#[path = "ops_tier_gate_and_timeouts_tests.rs"]
+mod tier_gate_and_timeouts_tests;
+#[path = "ops_tool_results_and_credentials_tests.rs"]
+mod tool_results_and_credentials_tests;
diff --git a/crates/openhuman-core/src/inference/local/ops.rs b/crates/openhuman-core/src/inference/local/ops.rs
index 1ae242f0ba..7e4c39f203 100644
--- a/crates/openhuman-core/src/inference/local/ops.rs
+++ b/crates/openhuman-core/src/inference/local/ops.rs
@@ -23,11 +23,11 @@ pub use runtime_ops::{
local_ai_transcribe_bytes, local_ai_tts, local_ai_vision_prompt,
};
+#[cfg(test)]
+use crate::config::Config;
#[cfg(test)]
use reactions::{extract_first_emoji, is_emoji_start};
#[cfg(test)]
use turn_guards::{
effective_agent_chat_origin, grant_turn_cwd, normalize_model_override, resolve_turn_cwd,
};
-#[cfg(test)]
-use crate::config::Config;
diff --git a/crates/openhuman-core/src/inference/local/service/ollama_admin_tests.rs b/crates/openhuman-core/src/inference/local/service/ollama_admin_tests.rs
index 64088bdf00..bb24db2eb1 100644
--- a/crates/openhuman-core/src/inference/local/service/ollama_admin_tests.rs
+++ b/crates/openhuman-core/src/inference/local/service/ollama_admin_tests.rs
@@ -23,9 +23,9 @@ fn lm_studio_config(base: &str) -> Config {
config
}
+#[path = "ollama_admin_discovery_fallback_tests.rs"]
+mod discovery_fallback_tests;
#[path = "ollama_admin_health_and_diagnostics_tests.rs"]
mod health_and_diagnostics_tests;
#[path = "ollama_admin_lm_studio_and_lifecycle_tests.rs"]
mod lm_studio_and_lifecycle_tests;
-#[path = "ollama_admin_discovery_fallback_tests.rs"]
-mod discovery_fallback_tests;
diff --git a/crates/openhuman-core/src/inference/provider/factory.rs b/crates/openhuman-core/src/inference/provider/factory.rs
index 12732051e1..dc29ee8f6e 100644
--- a/crates/openhuman-core/src/inference/provider/factory.rs
+++ b/crates/openhuman-core/src/inference/provider/factory.rs
@@ -67,17 +67,14 @@ pub(crate) use tiers::{
pub use tiers::{resolve_model_for_hint, role_for_model_tier};
pub(crate) use turn_model::{
create_turn_chat_model, create_turn_chat_model_from_string,
- create_turn_chat_model_from_string_with_native_tools_and_route, create_turn_chat_model_with_native_tools_and_route,
+ create_turn_chat_model_from_string_with_native_tools_and_route,
+ create_turn_chat_model_with_native_tools_and_route,
};
// Factory-internal helpers shared across the submodules (and their tests)
// through `use super::*`.
-use access_gates::{
- emit_inference_egress, enforce_local_only_inference,
-};
-use chat_model::{
- unresolved_chat_model_error, with_default_temperature,
-};
+use access_gates::{emit_inference_egress, enforce_local_only_inference};
+use chat_model::{unresolved_chat_model_error, with_default_temperature};
use cloud_slug::{
resolve_cloud_slug, try_create_cloud_slug_chat_model,
try_create_cloud_slug_chat_model_from_string,
@@ -87,17 +84,13 @@ use local_runtime::{
try_create_local_runtime_chat_model, try_create_local_runtime_chat_model_from_string,
OptionalChatModelResult,
};
-use managed_backend::{
- resolve_managed_backend, resolve_managed_backend_with_model_override,
-};
-use primary_cloud::{
- legacy_inference_slug, resolve_primary_cloud_provider_string,
-};
+use managed_backend::{resolve_managed_backend, resolve_managed_backend_with_model_override};
+use primary_cloud::{legacy_inference_slug, resolve_primary_cloud_provider_string};
use routing::split_model_and_temperature;
use subprocess_providers::{
- prepare_claude_agent_sdk_chat_model,
- try_create_claude_agent_sdk_chat_model, try_create_claude_agent_sdk_chat_model_from_string,
- try_create_claude_code_chat_model, try_create_claude_code_chat_model_from_string,
+ prepare_claude_agent_sdk_chat_model, try_create_claude_agent_sdk_chat_model,
+ try_create_claude_agent_sdk_chat_model_from_string, try_create_claude_code_chat_model,
+ try_create_claude_code_chat_model_from_string,
};
use tiers::is_abstract_tier_model;
diff --git a/crates/openhuman-core/src/inference/provider/factory/chat_model.rs b/crates/openhuman-core/src/inference/provider/factory/chat_model.rs
index 1108d2977b..2e9ca1c7c7 100644
--- a/crates/openhuman-core/src/inference/provider/factory/chat_model.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/chat_model.rs
@@ -1,9 +1,8 @@
//! One-shot `create_chat_model*` entry points, the readiness probe, the
//! default-temperature wrapper, and the unresolved-route error builder.
-
-use crate::inference::provider::factory::access_gates::verify_session_active;
use super::*;
+use crate::inference::provider::factory::access_gates::verify_session_active;
/// Build an `Arc<dyn ChatModel>` for the given workload role.
///
diff --git a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
index 37af775568..8be6088278 100644
--- a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
@@ -1,13 +1,12 @@
//! `<slug>:<model>` BYOK cloud providers: shared slug resolution (model fallback,
//! abstract-tier remapping, credentials, codex routing) and the crate-native builders.
-
+use super::*;
use crate::inference::provider::crate_anthropic;
use crate::inference::provider::crate_openai;
use crate::inference::provider::factory::access_gates::verify_backend_session_active;
use crate::inference::provider::factory::access_gates::verify_session_active;
use crate::inference::provider::fallback_diagnostics;
-use super::*;
/// Look up a `cloud_providers` entry by slug and build the provider.
/// The shared resolution for a `<slug>:<model>` cloud provider — the cloud
@@ -313,9 +312,7 @@ pub(super) fn try_create_cloud_slug_chat_model_from_string_with_native_tools(
// places `cache_control` breakpoints. Text mode (prompt-guided
// tools) is only implemented on the Chat Completions adapter, so
// that rare case keeps the compat path.
- if native_tool_calling
- && crate_anthropic::endpoint_is_anthropic_messages(&endpoint)
- {
+ if native_tool_calling && crate_anthropic::endpoint_is_anthropic_messages(&endpoint) {
crate::security::egress::emit_external_transfer(
crate::security::egress::EgressDescriptor::inference(
&slug,
@@ -393,31 +390,30 @@ pub(super) fn try_create_cloud_slug_chat_model_from_string_with_native_tools(
);
let unsupported = config.temperature_unsupported_models.clone();
- let chat =
- crate_openai::build_crate_openai_model(crate_openai::CrateOpenAiConfig {
- provider_name: slug.as_str(),
- endpoint: endpoint.as_str(),
- api_key: key.as_str(),
- auth_style: auth,
- model: effective_model.as_str(),
- temperature_unsupported_models: unsupported.as_slice(),
- temperature_override,
- // Cloud OpenAI-compatible providers accept a `system` role — no merge
- // (parity with the crate-native OpenAI model defaults).
- merge_system_into_user: false,
- extra_headers: extra_headers.as_slice(),
- native_tool_calling: Some(native_tool_calling),
- vision: None,
- default_provider_options: None,
- responses_api_primary,
- responses_omit_max_output_tokens,
- extra_query_params: extra_query_params.as_slice(),
- user_agent: user_agent.as_deref(),
- // OpenRouter forwards explicit `cache_control` markers to Anthropic
- // and Gemini, which cache nothing through a Chat Completions relay
- // without them; hosted OpenAI rejects unknown part fields, so the
- // flag is keyed on the relay, not on by default.
- explicit_cache_control: crate_openai::endpoint_is_openrouter(&endpoint),
- });
+ let chat = crate_openai::build_crate_openai_model(crate_openai::CrateOpenAiConfig {
+ provider_name: slug.as_str(),
+ endpoint: endpoint.as_str(),
+ api_key: key.as_str(),
+ auth_style: auth,
+ model: effective_model.as_str(),
+ temperature_unsupported_models: unsupported.as_slice(),
+ temperature_override,
+ // Cloud OpenAI-compatible providers accept a `system` role — no merge
+ // (parity with the crate-native OpenAI model defaults).
+ merge_system_into_user: false,
+ extra_headers: extra_headers.as_slice(),
+ native_tool_calling: Some(native_tool_calling),
+ vision: None,
+ default_provider_options: None,
+ responses_api_primary,
+ responses_omit_max_output_tokens,
+ extra_query_params: extra_query_params.as_slice(),
+ user_agent: user_agent.as_deref(),
+ // OpenRouter forwards explicit `cache_control` markers to Anthropic
+ // and Gemini, which cache nothing through a Chat Completions relay
+ // without them; hosted OpenAI rejects unknown part fields, so the
+ // flag is keyed on the relay, not on by default.
+ explicit_cache_control: crate_openai::endpoint_is_openrouter(&endpoint),
+ });
Some(Ok((chat, effective_model)))
}
diff --git a/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs b/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs
index 6cd053064c..c32ddda6a8 100644
--- a/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs
@@ -1,10 +1,9 @@
//! Local OpenAI-compatible runtimes (Ollama / LM Studio / MLX / OMLX /
//! local-openai) as crate-native `ChatModel`s.
-
+use super::*;
use crate::inference::provider::crate_openai;
use crate::inference::provider::factory::access_gates::verify_session_active;
-use super::*;
/// Local OpenAI-compatible runtimes (Ollama / LM Studio / MLX / OMLX /
/// local-openai) as a crate-native [`ChatModel`] (issue #4727).
diff --git a/crates/openhuman-core/src/inference/provider/factory/routing.rs b/crates/openhuman-core/src/inference/provider/factory/routing.rs
index 519a374023..935d6b3ef2 100644
--- a/crates/openhuman-core/src/inference/provider/factory/routing.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/routing.rs
@@ -1,9 +1,8 @@
//! Role → configured provider-string resolution (`provider_for_role`) plus the
//! managed-credits bypass check and the `<model>[@<temp>]` suffix parser.
-
-use crate::inference::provider::fallback_diagnostics;
use super::*;
+use crate::inference::provider::fallback_diagnostics;
/// The provider route a role has **explicitly** configured, before any
/// fallback.
diff --git a/crates/openhuman-core/src/inference/provider/factory/subprocess_providers.rs b/crates/openhuman-core/src/inference/provider/factory/subprocess_providers.rs
index 8d10fa677a..04adb86916 100644
--- a/crates/openhuman-core/src/inference/provider/factory/subprocess_providers.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/subprocess_providers.rs
@@ -1,8 +1,7 @@
//! Subprocess-backed providers: the Claude Agent SDK and the Claude Code CLI.
-
-use crate::inference::provider::factory::access_gates::verify_session_active;
use super::*;
+use crate::inference::provider::factory::access_gates::verify_session_active;
/// Build the Claude Agent SDK subprocess directly as a crate model. This is a
/// prompt-guided model: TinyAgents owns its text-tool protocol, while the
diff --git a/crates/openhuman-core/src/inference/provider/ops/http_error/context_window.rs b/crates/openhuman-core/src/inference/provider/ops/http_error/context_window.rs
index 97e7b8af24..7f1ca87994 100644
--- a/crates/openhuman-core/src/inference/provider/ops/http_error/context_window.rs
+++ b/crates/openhuman-core/src/inference/provider/ops/http_error/context_window.rs
@@ -1,7 +1,6 @@
//! Context-window overflow classification: the request exceeded the
//! configured model's context length.
-
/// Whether a provider error body indicates the request exceeded the model's
/// context window (the conversation/prompt is too long for the configured
/// model). This is a deterministic user-state / usage condition — the
diff --git a/crates/openhuman-core/src/inference/provider/ops/http_error/local_provider.rs b/crates/openhuman-core/src/inference/provider/ops/http_error/local_provider.rs
index be404978ec..a1feb39641 100644
--- a/crates/openhuman-core/src/inference/provider/ops/http_error/local_provider.rs
+++ b/crates/openhuman-core/src/inference/provider/ops/http_error/local_provider.rs
@@ -1,7 +1,6 @@
//! Local inference server (LM Studio / Ollama) user-state classification:
//! no model loaded, and Ollama Cloud's opaque hosted-inference 500.
-
/// Whether a provider non-2xx response is a local inference server that is
/// running but has **no model loaded** (e.g. LM Studio idle): a 400 carrying
/// `No models loaded. Please load a model …`.
diff --git a/crates/openhuman-core/src/inference/provider/ops/http_error/quota_and_credits.rs b/crates/openhuman-core/src/inference/provider/ops/http_error/quota_and_credits.rs
index 3ca95809fa..e9be8f7152 100644
--- a/crates/openhuman-core/src/inference/provider/ops/http_error/quota_and_credits.rs
+++ b/crates/openhuman-core/src/inference/provider/ops/http_error/quota_and_credits.rs
@@ -1,7 +1,6 @@
//! Budget, quota, and per-request rate-cap classification — the deterministic
//! "third-party account/plan is out of runway" family of provider errors.
-
/// Whether a provider non-2xx response is a deterministic budget-exhausted
/// user-state error that should be demoted from Sentry to an info log.
pub fn is_budget_exhausted_http_400(status: reqwest::StatusCode, body: &str) -> bool {
diff --git a/crates/openhuman-core/src/inference/provider/ops/models/local_runtime.rs b/crates/openhuman-core/src/inference/provider/ops/models/local_runtime.rs
index 7f14c5982c..a205aeb25c 100644
--- a/crates/openhuman-core/src/inference/provider/ops/models/local_runtime.rs
+++ b/crates/openhuman-core/src/inference/provider/ops/models/local_runtime.rs
@@ -1,6 +1,5 @@
//! Synthesized `cloud_providers` entries for well-known local-runtime slugs.
-
/// Synthesize a transient [`CloudProviderCreds`] entry for the well-known
/// local-runtime slugs (`ollama`, `lmstudio`) so [`super::list_configured_models`]
/// can probe their OpenAI-compatible `/v1/models` endpoint even when the
diff --git a/crates/openhuman-core/src/inference/provider/ops/models/managed_provider.rs b/crates/openhuman-core/src/inference/provider/ops/models/managed_provider.rs
index c795354d38..46276d8499 100644
--- a/crates/openhuman-core/src/inference/provider/ops/models/managed_provider.rs
+++ b/crates/openhuman-core/src/inference/provider/ops/models/managed_provider.rs
@@ -5,7 +5,6 @@
//! `cloud_providers`: it has its own URL, its own credential, and its own
//! meaning for a 401.
-
/// Synthesize the managed (`openhuman`) provider entry when `cloud_providers`
/// has no row for it.
///
diff --git a/crates/openhuman-core/src/integrations/client_tests.rs b/crates/openhuman-core/src/integrations/client_tests.rs
index e456115674..bf96fb8e82 100644
--- a/crates/openhuman-core/src/integrations/client_tests.rs
+++ b/crates/openhuman-core/src/integrations/client_tests.rs
@@ -7,8 +7,6 @@
//! envelope's `error` field (or falls back to truncated raw text) and
//! the bail message includes it.
-
-use std::sync::Arc;
use super::*;
use axum::{
http::StatusCode,
@@ -17,6 +15,7 @@ use axum::{
Json, Router,
};
use serde_json::json;
+use std::sync::Arc;
// ── Integration: HTTP error propagation through `post`/`get` ──────
diff --git a/crates/openhuman-core/src/integrations/composio/catalog.rs b/crates/openhuman-core/src/integrations/composio/catalog.rs
index 4fd8f5abd7..eb44754797 100644
--- a/crates/openhuman-core/src/integrations/composio/catalog.rs
+++ b/crates/openhuman-core/src/integrations/composio/catalog.rs
@@ -39,8 +39,8 @@ mod in_flight_tests;
#[path = "catalog_tests.rs"]
mod tests;
-pub use contract::ToolContract;
pub(crate) use contract::fetch_live_toolkit_catalog;
+pub use contract::ToolContract;
#[cfg(test)]
pub(crate) use contract::{seed_live_catalog_cache, seed_live_catalog_cache_expired};
pub(crate) use lookups::composio_required_args;
@@ -57,8 +57,6 @@ pub(crate) use probe::{seed_probe_cache, seed_probe_cache_expired};
#[cfg(test)]
use crate::config::Config;
#[cfg(test)]
-use serde_json::Value;
-#[cfg(test)]
use contract::{compute_composio_array_path, live_catalog_fetch_lock};
#[cfg(test)]
use lookups::composio_response_fields;
@@ -67,3 +65,5 @@ use probe::{
cache_probe_result, probed_output_sample, resolve_composio_action_scope,
COMPOSIO_ENVELOPE_META_KEYS_AT_ROOT,
};
+#[cfg(test)]
+use serde_json::Value;
diff --git a/crates/openhuman-core/src/integrations/composio/catalog/probe.rs b/crates/openhuman-core/src/integrations/composio/catalog/probe.rs
index c678053913..f0246558c2 100644
--- a/crates/openhuman-core/src/integrations/composio/catalog/probe.rs
+++ b/crates/openhuman-core/src/integrations/composio/catalog/probe.rs
@@ -6,9 +6,9 @@
use serde_json::Value;
-use super::contract::{CacheEntry, ToolContract};
#[cfg(test)]
use super::contract::COMPOSIO_CATALOG_CACHE_TTL;
+use super::contract::{CacheEntry, ToolContract};
use crate::config::Config;
use crate::integrations::composio::client::{
create_composio_client, direct_execute, ComposioClientKind,
diff --git a/crates/openhuman-core/src/integrations/composio/catalog_in_flight_tests_tests.rs b/crates/openhuman-core/src/integrations/composio/catalog_in_flight_tests_tests.rs
index ca646d172f..1b8584ae6a 100644
--- a/crates/openhuman-core/src/integrations/composio/catalog_in_flight_tests_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/catalog_in_flight_tests_tests.rs
@@ -1,4 +1,3 @@
-
use super::*;
#[test]
diff --git a/crates/openhuman-core/src/integrations/composio/catalog_tests.rs b/crates/openhuman-core/src/integrations/composio/catalog_tests.rs
index 6951536f65..2b96a5d688 100644
--- a/crates/openhuman-core/src/integrations/composio/catalog_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/catalog_tests.rs
@@ -7,7 +7,6 @@
//! a foreign test can call it would leak implementation surface to the whole
//! crate to satisfy a test.
-
use crate::json_schema::compute_primary_array_path_from_value;
// `super` is `catalog` itself — this file is included as its child module — so
// the glob reaches its private helpers as well as its imports.
diff --git a/crates/openhuman-core/src/integrations/composio/client.rs b/crates/openhuman-core/src/integrations/composio/client.rs
index c426686086..d65d93b204 100644
--- a/crates/openhuman-core/src/integrations/composio/client.rs
+++ b/crates/openhuman-core/src/integrations/composio/client.rs
@@ -20,10 +20,10 @@ mod triggers;
mod tests;
pub use connections::ComposioClient;
-pub use direct::{direct_execute, direct_list_connections};
pub(crate) use direct::{direct_authorize, direct_list_tools};
-pub use factory::{create_composio_client, ComposioClientKind};
+pub use direct::{direct_execute, direct_list_connections};
pub(crate) use factory::{build_composio_client, create_direct_composio_tool_for_api_key};
+pub use factory::{create_composio_client, ComposioClientKind};
// Brought into this module's own namespace (private `use`, not `pub use`)
// so `client_tests.rs` — declared as a direct child module of `client`
@@ -31,8 +31,8 @@ pub(crate) use factory::{build_composio_client, create_direct_composio_tool_for_
// when this was one un-split file. See each item's `pub(super)` in its
// owning submodule.
#[cfg(test)]
-use std::sync::Arc;
-#[cfg(test)]
use super::types::ComposioExecuteResponse;
#[cfg(test)]
use execute::is_post_oauth_auth_readiness_error;
+#[cfg(test)]
+use std::sync::Arc;
diff --git a/crates/openhuman-core/src/integrations/composio/connected_integrations.rs b/crates/openhuman-core/src/integrations/composio/connected_integrations.rs
index 30d91d1ca2..7854de91bb 100644
--- a/crates/openhuman-core/src/integrations/composio/connected_integrations.rs
+++ b/crates/openhuman-core/src/integrations/composio/connected_integrations.rs
@@ -17,8 +17,8 @@ mod catalog_description_tests;
#[cfg(test)]
pub(crate) use cache::composio_cache_test_lock;
pub(crate) use cache::{
- cached_active_integrations, cached_active_integrations_including_expired,
- connected_set_hash, invalidate_connected_integrations_cache, sync_cache_with_connections,
+ cached_active_integrations, cached_active_integrations_including_expired, connected_set_hash,
+ invalidate_connected_integrations_cache, sync_cache_with_connections,
};
pub(crate) use fetch::{
fetch_connected_integrations, fetch_connected_integrations_status, fetch_toolkit_actions,
diff --git a/crates/openhuman-core/src/integrations/composio/mod.rs b/crates/openhuman-core/src/integrations/composio/mod.rs
index 113bf9482d..53592303d2 100644
--- a/crates/openhuman-core/src/integrations/composio/mod.rs
+++ b/crates/openhuman-core/src/integrations/composio/mod.rs
@@ -72,7 +72,8 @@ pub use client::ComposioClient;
pub use identity::connection_identity;
pub(crate) use ops::{
cached_active_integrations, cached_active_integrations_including_expired, connected_set_hash,
- fetch_connected_integrations, fetch_connected_integrations_status, fetch_toolkit_actions, FetchConnectedIntegrationsStatus,
+ fetch_connected_integrations, fetch_connected_integrations_status, fetch_toolkit_actions,
+ FetchConnectedIntegrationsStatus,
};
pub use periodic::{record_sync_success, start_periodic_sync};
pub use schemas::{
diff --git a/crates/openhuman-core/src/integrations/composio/tools/direct.rs b/crates/openhuman-core/src/integrations/composio/tools/direct.rs
index f1167827d6..f1ba23dbeb 100644
--- a/crates/openhuman-core/src/integrations/composio/tools/direct.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools/direct.rs
@@ -27,6 +27,8 @@ pub use types::ComposioTool;
// reachable unqualified via `use super::*`, mirroring the single-scope shape
// `include!` gave it before the split into responsibility-based submodules.
#[cfg(test)]
+use crate::tools::traits::{Tool, ToolCategory};
+#[cfg(test)]
use connections::ComposioAuthConfig;
#[cfg(test)]
use construction::normalize_entity_id;
@@ -38,6 +40,4 @@ use discovery::{
#[cfg(test)]
use http_errors::{extract_api_error_message, extract_redirect_url, sanitize_error_message};
#[cfg(test)]
-use crate::tools::traits::{Tool, ToolCategory};
-#[cfg(test)]
use types::{ensure_https, is_loopback_http_url, COMPOSIO_API_BASE_V3};
diff --git a/crates/openhuman-core/src/mcp/registry/schemas/setup_handlers.rs b/crates/openhuman-core/src/mcp/registry/schemas/setup_handlers.rs
index 0cc9bc01c0..22634e991b 100644
--- a/crates/openhuman-core/src/mcp/registry/schemas/setup_handlers.rs
+++ b/crates/openhuman-core/src/mcp/registry/schemas/setup_handlers.rs
@@ -1,7 +1,6 @@
//! `mcp_setup` handler implementations — deserialise params and delegate
//! to `setup_ops.rs`.
-
use crate::mcp::registry::schemas::params::read_optional_string;
use crate::mcp::registry::schemas::params::read_optional_u32;
use serde_json::{Map, Value};
diff --git a/crates/openhuman-core/src/memory/guard/families/graph_and_bookkeeping.rs b/crates/openhuman-core/src/memory/guard/families/graph_and_bookkeeping.rs
index f9cf97b3d3..caf88721b0 100644
--- a/crates/openhuman-core/src/memory/guard/families/graph_and_bookkeeping.rs
+++ b/crates/openhuman-core/src/memory/guard/families/graph_and_bookkeeping.rs
@@ -5,7 +5,6 @@
//! Split out of `families.rs`; see [`super::types`] for the shared decorator
//! scaffolding these `impl` blocks build on.
-
use crate::memory::api::capabilities::Capability;
use crate::memory::api::error::MemoryError;
use crate::memory::api::goals::GoalsDoc;
diff --git a/crates/openhuman-core/src/memory/guard/families/ingest_and_tree.rs b/crates/openhuman-core/src/memory/guard/families/ingest_and_tree.rs
index dd61fc7574..711319b458 100644
--- a/crates/openhuman-core/src/memory/guard/families/ingest_and_tree.rs
+++ b/crates/openhuman-core/src/memory/guard/families/ingest_and_tree.rs
@@ -13,8 +13,10 @@ use crate::memory::api::provider::content::{
};
use crate::memory::api::provider::types::{IngestItem, IngestOutcome, SourceScope};
use crate::memory::api::provider::{MemoryDocuments, MemoryIngest, MemoryTree};
+use crate::memory::api::tree::{
+ IngestRequest, QueryResult, SummaryForest, TreeLeaf, TreeNode, TreeStatus,
+};
use crate::memory::api::types::NamespaceRetrievalContext;
-use crate::memory::api::tree::{IngestRequest, QueryResult, SummaryForest, TreeLeaf, TreeNode, TreeStatus};
use crate::memory::api::types::{NamespaceDocumentInput, StoredMemoryDocument};
use async_trait::async_trait;
diff --git a/crates/openhuman-core/src/memory/guard/families/retrieval_and_profile.rs b/crates/openhuman-core/src/memory/guard/families/retrieval_and_profile.rs
index 7ecbae06a2..8609eaeb52 100644
--- a/crates/openhuman-core/src/memory/guard/families/retrieval_and_profile.rs
+++ b/crates/openhuman-core/src/memory/guard/families/retrieval_and_profile.rs
@@ -4,8 +4,6 @@
//! Split out of `families.rs`; see [`super::types`] for the shared decorator
//! scaffolding these `impl` blocks build on.
-
-use crate::memory::api::provider::types::SourceScope;
use crate::memory::api::capabilities::Capability;
use crate::memory::api::error::MemoryError;
use crate::memory::api::provider::episodic::{ConversationSegment, EpisodicTurn};
@@ -21,6 +19,7 @@ use crate::memory::api::provider::sync::{
RawArchiveCoverage, RawRebuildOutcome, SourceSyncState, SourceSyncStatus, SyncAuditEntry,
SyncRunOutcome,
};
+use crate::memory::api::provider::types::SourceScope;
use crate::memory::api::provider::{
EpisodicEvent, MemoryCodingSessions, MemoryEpisodic, MemoryProfile, MemoryRetrieval,
MemoryScoring, MemorySourceSync,
diff --git a/crates/openhuman-core/src/memory/guard/families/typed_ingest_and_answer.rs b/crates/openhuman-core/src/memory/guard/families/typed_ingest_and_answer.rs
index 94f7b684d0..f9d5d79f89 100644
--- a/crates/openhuman-core/src/memory/guard/families/typed_ingest_and_answer.rs
+++ b/crates/openhuman-core/src/memory/guard/families/typed_ingest_and_answer.rs
@@ -6,8 +6,6 @@
//! Split out of `families.rs`; see [`super::types`] for the shared decorator
//! scaffolding these `impl` blocks build on.
-
-use crate::memory::api::provider::types::SourceScope;
use crate::memory::api::capabilities::Capability;
use crate::memory::api::chunks::Chunk;
use crate::memory::api::error::MemoryError;
@@ -19,6 +17,7 @@ use crate::memory::api::provider::operations::{
AnswerRequest, AnswerResponse, MemoryAnswer, MemoryConversationIngest, MemoryDocumentIngest,
MemoryEventIngest, MemoryLearningIngest, RawMemoryEvent,
};
+use crate::memory::api::provider::types::SourceScope;
use crate::memory::api::provider::types::{IngestItem, IngestOutcome};
use crate::memory::api::provider::MemoryChunks;
use async_trait::async_trait;
@@ -31,7 +30,6 @@ use super::types::{
GuardedEventIngest, GuardedLearningIngest,
};
-
/// Steps 3 + 4 over one ingest item, shared by the typed-ingest decorators:
/// stamp provenance, redact on egress — the same admission
/// [`GuardedIngest::admit`] applies on the legacy family.
@@ -44,7 +42,10 @@ fn admit_typed_item(policy: &GuardPolicy, mut item: IngestItem) -> IngestItem {
#[async_trait]
impl MemoryDocumentIngest for GuardedDocumentIngest {
async fn ingest_document(&self, document: IngestItem) -> Result<IngestOutcome, MemoryError> {
- let namespace = document.namespace.clone().unwrap_or_else(|| "-".to_string());
+ let namespace = document
+ .namespace
+ .clone()
+ .unwrap_or_else(|| "-".to_string());
self.policy.admit_write(
Capability::DocumentIngest,
"document_ingest.ingest_document",
diff --git a/crates/openhuman-core/src/memory/guard/families/types.rs b/crates/openhuman-core/src/memory/guard/families/types.rs
index 4786ddbdf3..0e758afdcc 100644
--- a/crates/openhuman-core/src/memory/guard/families/types.rs
+++ b/crates/openhuman-core/src/memory/guard/families/types.rs
@@ -10,6 +10,7 @@
use std::sync::Arc;
+use crate::memory::api::capabilities::Capability;
use crate::memory::api::error::MemoryError;
use crate::memory::api::provider::chunks::MemoryChunks;
use crate::memory::api::provider::episodic::MemoryEpisodic;
@@ -27,7 +28,6 @@ use crate::memory::api::provider::{
MemoryDiff, MemoryDocuments, MemoryEntities, MemoryGoals, MemoryGraph, MemoryIngest,
MemoryMaintenance, MemoryProvider, MemorySourceSink, MemoryToolMemory, MemoryTree,
};
-use crate::memory::api::capabilities::Capability;
use super::super::policy::GuardPolicy;
@@ -189,7 +189,6 @@ decorator!(
Scoring
);
-
decorator!(
/// Guarded [`MemoryDocumentIngest`].
GuardedDocumentIngest,
diff --git a/crates/openhuman-core/src/memory/guard/test_support/core_and_docs_impls.rs b/crates/openhuman-core/src/memory/guard/test_support/core_and_docs_impls.rs
index 47b7dbd8fd..685432680a 100644
--- a/crates/openhuman-core/src/memory/guard/test_support/core_and_docs_impls.rs
+++ b/crates/openhuman-core/src/memory/guard/test_support/core_and_docs_impls.rs
@@ -314,8 +314,7 @@ impl MemoryTree for RecordingProvider {
&self,
_per_namespace_cap: usize,
_total_cap: usize,
- ) -> Result<Vec<crate::memory::api::provider::content::RootSummary>, MemoryError>
- {
+ ) -> Result<Vec<crate::memory::api::provider::content::RootSummary>, MemoryError> {
self.record(Call::plain("tree.root_summaries_with_caps"));
Ok(Vec::new())
}
diff --git a/crates/openhuman-core/src/memory/guard/test_support/fixtures.rs b/crates/openhuman-core/src/memory/guard/test_support/fixtures.rs
index da8c45f44d..10a3ef3a03 100644
--- a/crates/openhuman-core/src/memory/guard/test_support/fixtures.rs
+++ b/crates/openhuman-core/src/memory/guard/test_support/fixtures.rs
@@ -9,17 +9,16 @@
use std::sync::{Arc, Mutex};
-use crate::memory::api::provider::MemoryProvider;
-use crate::memory::api::provider::types::{ExportRecord, SourceScope};
use crate::memory::api::provider::episodic::ConversationSegment;
use crate::memory::api::provider::episodic::EpisodicTurn;
use crate::memory::api::provider::retrieval::RetrievalResponse;
+use crate::memory::api::provider::types::{ExportRecord, SourceScope};
+use crate::memory::api::provider::MemoryProvider;
use crate::memory::api::types::{
MemoryCategory, MemoryEntry, MemoryTaint, NamespaceDocumentInput, NamespaceMemoryHit,
NamespaceSummary,
};
-
/// One call that reached the driver.
#[derive(Debug, Clone, PartialEq)]
pub struct Call {
@@ -115,7 +114,9 @@ pub fn export_record(taint: MemoryTaint) -> ExportRecord {
}
/// A guard over a fresh recording provider, plus a handle on that provider.
-pub fn guarded(policy: super::super::GuardPolicy) -> (Arc<RecordingProvider>, super::super::MemoryGuard) {
+pub fn guarded(
+ policy: super::super::GuardPolicy,
+) -> (Arc<RecordingProvider>, super::super::MemoryGuard) {
guarded_with(RecordingProvider::new(), policy)
}
@@ -164,8 +165,6 @@ pub fn document(content: &str, taint: MemoryTaint) -> NamespaceDocumentInput {
}
}
-
-
impl RecordingProvider {
/// A provider with an empty call log and every seeded answer at its
/// default — the shape most tests want before layering a `with_*` on top.
diff --git a/crates/openhuman-core/src/memory/guard/test_support/provider_and_sync_impls.rs b/crates/openhuman-core/src/memory/guard/test_support/provider_and_sync_impls.rs
index 541cc95b55..a56d054688 100644
--- a/crates/openhuman-core/src/memory/guard/test_support/provider_and_sync_impls.rs
+++ b/crates/openhuman-core/src/memory/guard/test_support/provider_and_sync_impls.rs
@@ -89,8 +89,7 @@ impl MemoryMaintenance for RecordingProvider {
async fn degraded_state(
&self,
- ) -> Result<crate::memory::api::provider::diagnosis::DegradedCapabilities, MemoryError>
- {
+ ) -> Result<crate::memory::api::provider::diagnosis::DegradedCapabilities, MemoryError> {
self.record(Call::plain("maintenance.degraded_state"));
Ok(Default::default())
}
@@ -259,4 +258,3 @@ impl MemoryCodingSessions for RecordingProvider {
Ok(CodingSessionIngestReport::default())
}
}
-
diff --git a/crates/openhuman-core/src/memory/guard/test_support/retrieval_and_ingest_impls.rs b/crates/openhuman-core/src/memory/guard/test_support/retrieval_and_ingest_impls.rs
index d358481adc..15f77c0b0b 100644
--- a/crates/openhuman-core/src/memory/guard/test_support/retrieval_and_ingest_impls.rs
+++ b/crates/openhuman-core/src/memory/guard/test_support/retrieval_and_ingest_impls.rs
@@ -8,16 +8,12 @@
//! families live in [`super::provider_and_sync_impls`] and
//! [`super::core_and_docs_impls`].
-
-use crate::memory::api::provider::types::SourceScope;
use crate::memory::api::chunks::Chunk;
use crate::memory::api::error::MemoryError;
-use crate::memory::api::provider::chunks::{
- ChunkDetail, ChunkEmbedding, ChunkQuery,
-};
+use crate::memory::api::provider::chunks::{ChunkDetail, ChunkEmbedding, ChunkQuery};
use crate::memory::api::provider::operations::{
- MemoryAnswer, MemoryConversationIngest, MemoryDocumentIngest,
- MemoryEventIngest, MemoryLearningIngest,
+ MemoryAnswer, MemoryConversationIngest, MemoryDocumentIngest, MemoryEventIngest,
+ MemoryLearningIngest,
};
use crate::memory::api::provider::people::{
AddressBookSeedOutcome, PersonHandle, PersonInteraction, PersonRecord, PersonScore,
@@ -28,12 +24,13 @@ use crate::memory::api::provider::retrieval::{
CoverWindowQuery, EntityMatch, FastRetrieveQuery, RetrievalHit, RetrievalResponse,
SourceRetrievalQuery,
};
+use crate::memory::api::provider::types::SourceScope;
use crate::memory::api::provider::types::{IngestItem, IngestOutcome};
-use crate::memory::api::types::NamespaceMemoryHit;
use crate::memory::api::provider::{
EpisodicEvent, MemoryChunks, MemoryEpisodic, MemoryPeople, MemoryProfile, MemoryRetrieval,
MemoryScoring,
};
+use crate::memory::api::types::NamespaceMemoryHit;
use async_trait::async_trait;
use super::fixtures::{rendered_scope, Call, RecordingProvider};
@@ -58,8 +55,7 @@ impl MemoryEpisodic for RecordingProvider {
async fn session_turns(
&self,
_session_id: &str,
- ) -> Result<Vec<crate::memory::api::provider::episodic::EpisodicTurn>, MemoryError>
- {
+ ) -> Result<Vec<crate::memory::api::provider::episodic::EpisodicTurn>, MemoryError> {
self.record(Call::plain("episodic.session_turns"));
Ok(self.session_turns.lock().unwrap().clone())
}
@@ -67,10 +63,8 @@ impl MemoryEpisodic for RecordingProvider {
async fn open_segment(
&self,
_session_id: &str,
- ) -> Result<
- Option<crate::memory::api::provider::episodic::ConversationSegment>,
- MemoryError,
- > {
+ ) -> Result<Option<crate::memory::api::provider::episodic::ConversationSegment>, MemoryError>
+ {
self.record(Call::plain("episodic.open_segment"));
Ok(None)
}
@@ -78,10 +72,7 @@ impl MemoryEpisodic for RecordingProvider {
async fn segments_pending_summary(
&self,
limit: u32,
- ) -> Result<
- Vec<crate::memory::api::provider::episodic::ConversationSegment>,
- MemoryError,
- > {
+ ) -> Result<Vec<crate::memory::api::provider::episodic::ConversationSegment>, MemoryError> {
self.record(Call::plain("episodic.segments_pending_summary"));
// Honour `limit` — a fake that ignored it would let a test drive more
// segments than the caller asked for and hide a bounded-recovery bug.
@@ -272,8 +263,7 @@ impl MemoryChunks for RecordingProvider {
async fn chunk_score(
&self,
_chunk_id: &str,
- ) -> Result<Option<crate::memory::api::provider::chunks::ChunkScore>, MemoryError>
- {
+ ) -> Result<Option<crate::memory::api::provider::chunks::ChunkScore>, MemoryError> {
self.record(Call::plain("chunks.chunk_score"));
Ok(None)
}
@@ -281,8 +271,7 @@ impl MemoryChunks for RecordingProvider {
async fn source_ingest_status(
&self,
_source_prefixes: &[crate::memory::api::provider::chunks::SourceIngestQuery],
- ) -> Result<Vec<crate::memory::api::provider::chunks::SourceIngestStatus>, MemoryError>
- {
+ ) -> Result<Vec<crate::memory::api::provider::chunks::SourceIngestStatus>, MemoryError> {
self.record(Call::plain("chunks.source_ingest_status"));
Ok(vec![])
}
@@ -555,14 +544,12 @@ impl MemoryEventIngest for RecordingProvider {
}
}
-
#[async_trait]
impl MemoryAnswer for RecordingProvider {
async fn answer(
&self,
_request: crate::memory::api::provider::operations::AnswerRequest,
- ) -> Result<crate::memory::api::provider::operations::AnswerResponse, MemoryError>
- {
+ ) -> Result<crate::memory::api::provider::operations::AnswerResponse, MemoryError> {
self.record(Call {
method: "answer.answer".into(),
content: None,
diff --git a/crates/openhuman-core/src/memory/read_rpc_tests.rs b/crates/openhuman-core/src/memory/read_rpc_tests.rs
index e8caed3c21..e276fb5e0a 100644
--- a/crates/openhuman-core/src/memory/read_rpc_tests.rs
+++ b/crates/openhuman-core/src/memory/read_rpc_tests.rs
@@ -20,7 +20,7 @@ fn test_config() -> (TempDir, Config) {
// ── tree-mode graph export (summaries + leaf chunks) ────────────────────
-#[path = "flush_now_rpc_tests.rs"]
-mod flush_now_rpc_tests;
#[path = "display_name_and_vault_rpc_tests.rs"]
mod display_name_and_vault_rpc_tests;
+#[path = "flush_now_rpc_tests.rs"]
+mod flush_now_rpc_tests;
diff --git a/crates/openhuman-core/src/memory/safety.rs b/crates/openhuman-core/src/memory/safety.rs
index 43960ca7b1..d8fcb72aa8 100644
--- a/crates/openhuman-core/src/memory/safety.rs
+++ b/crates/openhuman-core/src/memory/safety.rs
@@ -48,6 +48,4 @@ mod pii;
mod secrets;
pub use pii::{has_likely_email, has_likely_pii};
-pub use secrets::{
- has_likely_secret, sanitize_json, sanitize_text, SanitizationReport, Sanitized,
-};
+pub use secrets::{has_likely_secret, sanitize_json, sanitize_text, SanitizationReport, Sanitized};
diff --git a/crates/openhuman-core/src/memory/safety/pii.rs b/crates/openhuman-core/src/memory/safety/pii.rs
index e7c91d6ff4..28c936a2ad 100644
--- a/crates/openhuman-core/src/memory/safety/pii.rs
+++ b/crates/openhuman-core/src/memory/safety/pii.rs
@@ -29,8 +29,8 @@ pub use patterns::{has_likely_email, has_likely_pii, redact_pii};
// `include!`-spliced scope.
#[cfg(test)]
pub(super) use checksums::{
- digits, valid_cnpj, valid_cpf, valid_cuit, valid_dni_es, valid_iban, valid_luhn,
- valid_nie_es, valid_nino, valid_ssn, valid_verhoeff,
+ digits, valid_cnpj, valid_cpf, valid_cuit, valid_dni_es, valid_iban, valid_luhn, valid_nie_es,
+ valid_nino, valid_ssn, valid_verhoeff,
};
#[cfg(test)]
pub(super) use normalize::{scan_candidates, NormalizedView};
diff --git a/crates/openhuman-core/src/memory/safety/pii/normalize.rs b/crates/openhuman-core/src/memory/safety/pii/normalize.rs
index f76431edf0..16c3a0ca1b 100644
--- a/crates/openhuman-core/src/memory/safety/pii/normalize.rs
+++ b/crates/openhuman-core/src/memory/safety/pii/normalize.rs
@@ -325,4 +325,3 @@ pub(crate) fn scan_candidates(text: &str) -> Candidates {
cand
}
-
diff --git a/crates/openhuman-core/src/memory/safety/pii/patterns.rs b/crates/openhuman-core/src/memory/safety/pii/patterns.rs
index 3a8931afad..968e7a5001 100644
--- a/crates/openhuman-core/src/memory/safety/pii/patterns.rs
+++ b/crates/openhuman-core/src/memory/safety/pii/patterns.rs
@@ -10,11 +10,11 @@ use std::sync::LazyLock;
use regex::Regex;
use super::checksums::{
- digits, valid_cnpj, valid_cpf, valid_cuit, valid_dni_es, valid_iban, valid_luhn,
- valid_nie_es, valid_nino, valid_ssn, valid_verhoeff,
+ digits, valid_cnpj, valid_cpf, valid_cuit, valid_dni_es, valid_iban, valid_luhn, valid_nie_es,
+ valid_nino, valid_ssn, valid_verhoeff,
};
use super::normalize::{scan_candidates, Candidates, NormalizedView};
-use crate::memory::safety::secrets::{Sanitized, SanitizationReport};
+use crate::memory::safety::secrets::{SanitizationReport, Sanitized};
// ---------- Multilingual personal-PII redaction ----------
//
@@ -373,7 +373,6 @@ fn push_simple(hits: &mut Vec<Hit>, norm: &str, re: &Regex, token: &'static str)
}
}
-
fn push_checksum(
hits: &mut Vec<Hit>,
norm: &str,
@@ -464,4 +463,3 @@ fn splice_redactions(
report: *report,
}
}
-
diff --git a/crates/openhuman-core/src/memory/safety/secrets.rs b/crates/openhuman-core/src/memory/safety/secrets.rs
index 623dcd0bfc..898458a1a8 100644
--- a/crates/openhuman-core/src/memory/safety/secrets.rs
+++ b/crates/openhuman-core/src/memory/safety/secrets.rs
@@ -316,4 +316,3 @@ fn is_sensitive_key(key: &str) -> bool {
|| normalized.contains("secret")
|| normalized.ends_with("key")
}
-
diff --git a/crates/openhuman-core/src/memory/safety_tests.rs b/crates/openhuman-core/src/memory/safety_tests.rs
index b8468dc8dc..842ea20430 100644
--- a/crates/openhuman-core/src/memory/safety_tests.rs
+++ b/crates/openhuman-core/src/memory/safety_tests.rs
@@ -35,7 +35,7 @@ fn unchanged(input: &str) {
assert_eq!(out.report.pii_redactions, 0);
}
-#[path = "sanitize_and_pii_id_tests.rs"]
-mod sanitize_and_pii_id_tests;
#[path = "prefilter_and_checksum_tests.rs"]
mod prefilter_and_checksum_tests;
+#[path = "sanitize_and_pii_id_tests.rs"]
+mod sanitize_and_pii_id_tests;
diff --git a/crates/openhuman-core/src/memory/sources/rpc.rs b/crates/openhuman-core/src/memory/sources/rpc.rs
index d68c71a7d6..63ffaa5a9b 100644
--- a/crates/openhuman-core/src/memory/sources/rpc.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc.rs
@@ -65,21 +65,20 @@ mod source_sync;
mod status_toolkits;
pub use apply_all::{apply_all_in_rpc, AllInResponse};
+pub(crate) use coding_sessions::ingest_budget;
pub use coding_sessions::{
coding_session_status_rpc, ingest_coding_sessions_rpc, CodingSessionIngestRequest,
CodingSessionStatusResponse,
};
-pub(crate) use coding_sessions::ingest_budget;
pub use cost_reporting::{
- estimate_sync_cost_rpc, monthly_cost_summary_rpc, sync_audit_log_rpc,
- EstimateSyncCostRequest, EstimateSyncCostResponse, MonthlyCostSummaryResponse,
- SyncAuditLogResponse,
+ estimate_sync_cost_rpc, monthly_cost_summary_rpc, sync_audit_log_rpc, EstimateSyncCostRequest,
+ EstimateSyncCostResponse, MonthlyCostSummaryResponse, SyncAuditLogResponse,
};
pub use registry_crud::{
- add_rpc, get_rpc, list_items_rpc, list_rpc, read_item_rpc, remove_rpc, update_rpc,
- AddRequest, AddResponse, GetRequest, GetResponse, ListItemsRequest, ListItemsResponse,
- ListResponse, ReadItemRequest, ReadItemResponse, RemoveRequest, RemoveResponse,
- UpdateRequest, UpdateResponse,
+ add_rpc, get_rpc, list_items_rpc, list_rpc, read_item_rpc, remove_rpc, update_rpc, AddRequest,
+ AddResponse, GetRequest, GetResponse, ListItemsRequest, ListItemsResponse, ListResponse,
+ ReadItemRequest, ReadItemResponse, RemoveRequest, RemoveResponse, UpdateRequest,
+ UpdateResponse,
};
pub use source_sync::{
reconcile_rpc, sync_rpc, ReconcileRequest, ReconcileResponse, ReconcileScopeReport,
diff --git a/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs b/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs
index 9df5145d93..e7c0ca00fb 100644
--- a/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc/cost_reporting.rs
@@ -164,7 +164,10 @@ pub struct MonthlyCostSummaryResponse {
///
/// `pub(super)` so `rpc`'s sibling test module can reach it through
/// `super::*`.
-pub(super) fn summarise_month(entries: &[SyncAuditEntry], month: &str) -> MonthlyCostSummaryResponse {
+pub(super) fn summarise_month(
+ entries: &[SyncAuditEntry],
+ month: &str,
+) -> MonthlyCostSummaryResponse {
let mut summary = MonthlyCostSummaryResponse {
month: month.to_string(),
total_cost_usd: 0.0,
diff --git a/crates/openhuman-core/src/memory/sources/rpc_filter_tests_tests.rs b/crates/openhuman-core/src/memory/sources/rpc_filter_tests_tests.rs
index 4c0ea9b556..e83c076173 100644
--- a/crates/openhuman-core/src/memory/sources/rpc_filter_tests_tests.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc_filter_tests_tests.rs
@@ -1,7 +1,7 @@
use std::collections::HashSet;
-use crate::memory::sources::types::{MemorySourceEntry, SourceKind};
use crate::memory::sources::rpc::registry_crud::filter_to_active_composio_sources;
+use crate::memory::sources::types::{MemorySourceEntry, SourceKind};
fn composio_entry(id: &str, connection_id: &str) -> MemorySourceEntry {
MemorySourceEntry {
id: id.to_string(),
diff --git a/crates/openhuman-core/src/memory/sources/rpc_tests.rs b/crates/openhuman-core/src/memory/sources/rpc_tests.rs
index 8e395f8dad..3d35cb6a19 100644
--- a/crates/openhuman-core/src/memory/sources/rpc_tests.rs
+++ b/crates/openhuman-core/src/memory/sources/rpc_tests.rs
@@ -7,16 +7,15 @@
//! that scanner guards is one that may shrink and must never grow — so the
//! honest fix is to put the test where the repo already puts tests.
-
-use crate::memory::sources::types::MemorySourceEntry;
+use super::*;
+use crate::core::subsystem::DriverClass;
+use crate::memory::api::error::MemoryError;
use crate::memory::sources::rpc::apply_all::trigger_enabled_syncs;
use crate::memory::sources::rpc::coding_sessions::unserved;
-use crate::memory::sources::rpc::source_sync::SyncDispatch;
use crate::memory::sources::rpc::source_sync::describe_source_sync_failure;
use crate::memory::sources::rpc::source_sync::sync_dispatch;
-use super::*;
-use crate::core::subsystem::DriverClass;
-use crate::memory::api::error::MemoryError;
+use crate::memory::sources::rpc::source_sync::SyncDispatch;
+use crate::memory::sources::types::MemorySourceEntry;
// Needed to call the family accessors on the *concrete* null provider
// below; the handlers above reach them through `dyn MemoryProvider`, where
// the trait is in scope by construction.
diff --git a/crates/openhuman-core/src/memory/sync/composio/bus/connection_created_subscriber.rs b/crates/openhuman-core/src/memory/sync/composio/bus/connection_created_subscriber.rs
index e644a6e28e..2b10a47810 100644
--- a/crates/openhuman-core/src/memory/sync/composio/bus/connection_created_subscriber.rs
+++ b/crates/openhuman-core/src/memory/sync/composio/bus/connection_created_subscriber.rs
@@ -34,12 +34,12 @@ async fn backend_composio_client(
config: &crate::config::Config,
toolkit: &str,
) -> anyhow::Result<ComposioClient> {
- let live_config = crate::config::rpc::reload_config_from_paths(
- &config.config_path,
- &config.workspace_dir,
- )
- .await
- .map_err(|e| anyhow::anyhow!("composio backend client: failed to reload live config: {e}"))?;
+ let live_config =
+ crate::config::rpc::reload_config_from_paths(&config.config_path, &config.workspace_dir)
+ .await
+ .map_err(|e| {
+ anyhow::anyhow!("composio backend client: failed to reload live config: {e}")
+ })?;
match create_composio_client(&live_config)? {
ComposioClientKind::Backend(client) => Ok(client),
ComposioClientKind::Direct(_) => Err(anyhow::anyhow!(
@@ -211,9 +211,7 @@ impl EventHandler<DomainEvent> for ComposioConnectionCreatedSubscriber {
})
.map(|s| (s.max_items, s.sync_depth_days))
.unwrap_or_else(|| {
- crate::memory::sources::memory_sync_defaults_for_toolkit(
- toolkit.as_str(),
- )
+ crate::memory::sources::memory_sync_defaults_for_toolkit(toolkit.as_str())
})
};
@@ -512,12 +510,9 @@ impl EventHandler<DomainEvent> for ComposioConnectionCreatedSubscriber {
return;
}
let label = format!("{toolkit} connection");
- if let Err(e) = crate::memory::sources::upsert_composio_source(
- &toolkit,
- &connection_id,
- &label,
- )
- .await
+ if let Err(e) =
+ crate::memory::sources::upsert_composio_source(&toolkit, &connection_id, &label)
+ .await
{
tracing::warn!(
toolkit = %toolkit,
diff --git a/crates/openhuman-core/src/memory/sync/composio/bus_tests.rs b/crates/openhuman-core/src/memory/sync/composio/bus_tests.rs
index e443964f08..8405b51bd2 100644
--- a/crates/openhuman-core/src/memory/sync/composio/bus_tests.rs
+++ b/crates/openhuman-core/src/memory/sync/composio/bus_tests.rs
@@ -1,12 +1,11 @@
//! Unit tests for the composio connection-created event handler's gating.
-
-use crate::core::events::DomainEvent;
-use crate::memory::sync::composio::bus::trigger_subscriber::TRIAGE_DISABLED_ENV;
-use crate::memory::sync::composio::bus::trigger_subscriber::triage_disabled;
-use crate::memory::sync::composio::bus::connection_created_subscriber::WaitError;
use super::connection_created_subscriber::toolkit_is_memory_source_registrable;
use super::*;
+use crate::core::events::DomainEvent;
+use crate::memory::sync::composio::bus::connection_created_subscriber::WaitError;
+use crate::memory::sync::composio::bus::trigger_subscriber::triage_disabled;
+use crate::memory::sync::composio::bus::trigger_subscriber::TRIAGE_DISABLED_ENV;
use serde_json::json;
use std::sync::Mutex;
use tinybus::EventHandler;
diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc.rs b/crates/openhuman-core/src/memory/tree/tree/rpc.rs
index 6ab3635138..ebf354832e 100644
--- a/crates/openhuman-core/src/memory/tree/tree/rpc.rs
+++ b/crates/openhuman-core/src/memory/tree/tree/rpc.rs
@@ -20,7 +20,6 @@
//! [`set_enabled`] (the scheduler-gate toggle). Every handler keeps its
//! original `rpc::<name>` path through the re-exports below.
-
mod backfill;
mod chunks;
mod ingest;
diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc/pipeline_status.rs b/crates/openhuman-core/src/memory/tree/tree/rpc/pipeline_status.rs
index 309fc18474..2bc807b047 100644
--- a/crates/openhuman-core/src/memory/tree/tree/rpc/pipeline_status.rs
+++ b/crates/openhuman-core/src/memory/tree/tree/rpc/pipeline_status.rs
@@ -9,7 +9,9 @@ use crate::rpc::RpcOutcome;
use super::backfill::{queue_stats, store_stats};
use super::retry_failed::latest_failed_job_failure;
-use super::stall::{compute_dir_size_bytes, derive_pipeline_status, queue_idle_ms, queue_is_stalled};
+use super::stall::{
+ compute_dir_size_bytes, derive_pipeline_status, queue_idle_ms, queue_is_stalled,
+};
/// Per-status counters for the `mem_tree_jobs` table — snapshot returned by
/// the `memory_tree_pipeline_status` RPC. Only the three states the status
@@ -187,7 +189,9 @@ pub(super) fn latest_quarantine(
/// host's `scheduler_policy` so both surfaces spell a pause the same way.
///
/// `pub(super)` — reused verbatim by tests declared directly under `rpc`.
-pub(super) fn gate_pause_state(policy: crate::cron::scheduler_gate::Policy) -> (bool, Option<String>) {
+pub(super) fn gate_pause_state(
+ policy: crate::cron::scheduler_gate::Policy,
+) -> (bool, Option<String>) {
use crate::cron::scheduler_gate::{PauseReason, Policy};
match policy {
Policy::Paused { reason } => (
diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc_pipeline_status_tests.rs b/crates/openhuman-core/src/memory/tree/tree/rpc_pipeline_status_tests.rs
index 9d5a741a48..d37dbb4787 100644
--- a/crates/openhuman-core/src/memory/tree/tree/rpc_pipeline_status_tests.rs
+++ b/crates/openhuman-core/src/memory/tree/tree/rpc_pipeline_status_tests.rs
@@ -2,10 +2,10 @@ use super::*;
use crate::memory::tree::tree::rpc::pipeline_status::gate_pause_state;
use crate::memory::tree::tree::rpc::retry_failed::blocking_cause;
-use crate::memory::tree::tree::rpc::stall::QUEUE_STALL_THRESHOLD_MS;
use crate::memory::tree::tree::rpc::stall::derive_pipeline_status;
use crate::memory::tree::tree::rpc::stall::queue_idle_ms;
use crate::memory::tree::tree::rpc::stall::queue_is_stalled;
+use crate::memory::tree::tree::rpc::stall::QUEUE_STALL_THRESHOLD_MS;
#[test]
fn derive_pipeline_status_precedence_matches_spec() {
use crate::memory::tree::health::{DegradedState, FailureCode, PipelineFailure};
diff --git a/crates/openhuman-core/src/memory/tree/tree/rpc_tests.rs b/crates/openhuman-core/src/memory/tree/tree/rpc_tests.rs
index e734d86dac..a79db04267 100644
--- a/crates/openhuman-core/src/memory/tree/tree/rpc_tests.rs
+++ b/crates/openhuman-core/src/memory/tree/tree/rpc_tests.rs
@@ -1,8 +1,8 @@
use super::*;
+use crate::memory::read_rpc::Config;
use chrono::Utc;
use serde_json::json;
use tempfile::TempDir;
-use crate::memory::read_rpc::Config;
// `DocumentInput` (and its `ChatBatch` / `EmailThread` siblings, which
// `rpc_ingest_and_chunk_tests` reaches the same way) now arrive through the
// `use super::*` above: they are defined in `canonicalize_types.rs` and
diff --git a/crates/openhuman-core/src/modules/memory.rs b/crates/openhuman-core/src/modules/memory.rs
index d38e96b14c..0b417ec5f0 100644
--- a/crates/openhuman-core/src/modules/memory.rs
+++ b/crates/openhuman-core/src/modules/memory.rs
@@ -67,10 +67,10 @@ mod sync_sessions_episodic;
pub(crate) use capabilities::ARTIFACT_CAPABILITIES;
#[cfg(test)]
pub(crate) use capabilities::{capabilities_for, ARTIFACT_CAPABILITIES_PIN};
-pub use provider::{install_host_callbacks, publish_cli_boot_policy, set_modules_policy};
-pub(crate) use provider::policy;
-pub use provider::{ModuleMemoryProvider, MODULE_ID};
#[cfg(test)]
use provider::from_bus;
+pub(crate) use provider::policy;
+pub use provider::{install_host_callbacks, publish_cli_boot_policy, set_modules_policy};
+pub use provider::{ModuleMemoryProvider, MODULE_ID};
#[cfg(test)]
use sync_sessions_episodic::INGEST_BUS_GRACE;
diff --git a/crates/openhuman-core/src/modules/memory/core_provider.rs b/crates/openhuman-core/src/modules/memory/core_provider.rs
index cfcee82acb..c8e9da07e3 100644
--- a/crates/openhuman-core/src/modules/memory/core_provider.rs
+++ b/crates/openhuman-core/src/modules/memory/core_provider.rs
@@ -6,7 +6,9 @@ use async_trait::async_trait;
use tinymemory_api::capabilities::{Capabilities, Capability};
use tinymemory_api::error::MemoryError;
use tinymemory_api::health::MemoryHealth;
-use tinymemory_api::provider::types::{ExportPage, ExportRecord, ImportOutcome, IngestItem, IngestOutcome, SourceScope};
+use tinymemory_api::provider::types::{
+ ExportPage, ExportRecord, ImportOutcome, IngestItem, IngestOutcome, SourceScope,
+};
use tinymemory_api::provider::{
MemoryAnswer, MemoryChunks, MemoryCodingSessions, MemoryConversationIngest, MemoryCore,
MemoryDiff, MemoryDocumentIngest, MemoryDocuments, MemoryEntities, MemoryEpisodic,
@@ -23,7 +25,9 @@ use crate::modules::ops;
use crate::modules::types::ModuleState;
use super::capabilities::{artifact_capabilities, artifact_serves};
-use super::provider::{from_bus, module_call, module_call_slow, policy, ModuleMemoryProvider, MODULE_ID};
+use super::provider::{
+ from_bus, module_call, module_call_slow, policy, ModuleMemoryProvider, MODULE_ID,
+};
#[async_trait]
impl MemoryProvider for ModuleMemoryProvider {
@@ -73,8 +77,7 @@ impl MemoryProvider for ModuleMemoryProvider {
.as_ref()
.or_else(|| policy())
.is_some_and(|config| config.modules.enabled);
- if modules_enabled && matches!(ops::state_of(MODULE_ID), ModuleState::Loading)
- {
+ if modules_enabled && matches!(ops::state_of(MODULE_ID), ModuleState::Loading) {
return MemoryHealth::degraded("the memory module is loading");
}
match self.proxy("health").await {
diff --git a/crates/openhuman-core/src/modules/memory/documents_tree.rs b/crates/openhuman-core/src/modules/memory/documents_tree.rs
index b734702e45..b76e58831a 100644
--- a/crates/openhuman-core/src/modules/memory/documents_tree.rs
+++ b/crates/openhuman-core/src/modules/memory/documents_tree.rs
@@ -4,9 +4,15 @@ use async_trait::async_trait;
use tinymemory_api::chunks::Chunk;
use tinymemory_api::error::MemoryError;
use tinymemory_api::provider::types::SourceScope;
-use tinymemory_api::provider::{MemoryDocuments, MemoryTree, RootSummary, SummaryContext, SummaryInput, SummaryOutput};
-use tinymemory_api::tree::{IngestRequest, QueryResult, SummaryForest, TreeLeaf, TreeNode, TreeStatus};
-use tinymemory_api::types::{NamespaceDocumentInput, NamespaceRetrievalContext, StoredMemoryDocument};
+use tinymemory_api::provider::{
+ MemoryDocuments, MemoryTree, RootSummary, SummaryContext, SummaryInput, SummaryOutput,
+};
+use tinymemory_api::tree::{
+ IngestRequest, QueryResult, SummaryForest, TreeLeaf, TreeNode, TreeStatus,
+};
+use tinymemory_api::types::{
+ NamespaceDocumentInput, NamespaceRetrievalContext, StoredMemoryDocument,
+};
use tinymemory_bus::names::methods;
use super::provider::{module_call, ModuleMemoryProvider};
@@ -284,4 +290,3 @@ impl MemoryTree for ModuleMemoryProvider {
module_call!(self, "flavour_profile", methods::FLAVOUR_PROFILE, (scope,))
}
}
-
diff --git a/crates/openhuman-core/src/modules/memory/entities_graph_diff.rs b/crates/openhuman-core/src/modules/memory/entities_graph_diff.rs
index 1211b0240b..f36c20115e 100644
--- a/crates/openhuman-core/src/modules/memory/entities_graph_diff.rs
+++ b/crates/openhuman-core/src/modules/memory/entities_graph_diff.rs
@@ -3,7 +3,9 @@
use async_trait::async_trait;
use tinymemory_api::error::MemoryError;
-use tinymemory_api::provider::types::{ChunkEntityOccurrence, DiffReport, EntityHit, EntityOccurrence, SnapshotRef};
+use tinymemory_api::provider::types::{
+ ChunkEntityOccurrence, DiffReport, EntityHit, EntityOccurrence, SnapshotRef,
+};
use tinymemory_api::provider::{MemoryDiff, MemoryEntities, MemoryGraph};
use tinymemory_api::types::{GraphRelationRecord, MemoryKvRecord};
use tinymemory_bus::names::methods;
@@ -190,4 +192,3 @@ impl MemoryDiff for ModuleMemoryProvider {
)
}
}
-
diff --git a/crates/openhuman-core/src/modules/memory/goals_tools_sources.rs b/crates/openhuman-core/src/modules/memory/goals_tools_sources.rs
index 320b55bb6b..70fa4b1f0d 100644
--- a/crates/openhuman-core/src/modules/memory/goals_tools_sources.rs
+++ b/crates/openhuman-core/src/modules/memory/goals_tools_sources.rs
@@ -9,7 +9,10 @@ use tinymemory_api::provider::types::{
IngestOutcome, MaintenanceReport, PurgeOutcome, QueueFailure, QueueStats, ResetOutcome,
SourceItem, StoreStats,
};
-use tinymemory_api::provider::{DegradedCapabilities, Diagnosis, MemoryGoals, MemoryMaintenance, MemorySourceSink, MemoryToolMemory};
+use tinymemory_api::provider::{
+ DegradedCapabilities, Diagnosis, MemoryGoals, MemoryMaintenance, MemorySourceSink,
+ MemoryToolMemory,
+};
use tinymemory_api::tool_memory::ToolMemoryRule;
use tinymemory_api::types::MemoryTaint;
use tinymemory_bus::names::methods;
@@ -157,4 +160,3 @@ impl MemoryMaintenance for ModuleMemoryProvider {
module_call!(self, "degraded_state", methods::DEGRADED_STATE, ())
}
}
-
diff --git a/crates/openhuman-core/src/modules/memory/people_chunks_retrieval.rs b/crates/openhuman-core/src/modules/memory/people_chunks_retrieval.rs
index 3ed85af5d3..d6dc4fe611 100644
--- a/crates/openhuman-core/src/modules/memory/people_chunks_retrieval.rs
+++ b/crates/openhuman-core/src/modules/memory/people_chunks_retrieval.rs
@@ -370,4 +370,3 @@ impl MemoryScoring for ModuleMemoryProvider {
module_call!(self, "embedder_slug", methods::EMBEDDER_SLUG, ())
}
}
-
diff --git a/crates/openhuman-core/src/modules/memory/provider.rs b/crates/openhuman-core/src/modules/memory/provider.rs
index fea7de4de5..19a5d2b91f 100644
--- a/crates/openhuman-core/src/modules/memory/provider.rs
+++ b/crates/openhuman-core/src/modules/memory/provider.rs
@@ -15,7 +15,6 @@ use crate::modules::{host, ops, registry};
use super::capabilities::artifact_capabilities;
-
/// Registry id of the module these calls go to.
pub const MODULE_ID: &str = "tinymemory";
@@ -535,4 +534,3 @@ pub async fn publish_cli_boot_policy() -> Result<Config, String> {
set_modules_policy(Arc::new(config.clone()));
Ok(config)
}
-
diff --git a/crates/openhuman-core/src/modules/memory/sync_sessions_episodic.rs b/crates/openhuman-core/src/modules/memory/sync_sessions_episodic.rs
index 10580cb4a2..281bdf7f89 100644
--- a/crates/openhuman-core/src/modules/memory/sync_sessions_episodic.rs
+++ b/crates/openhuman-core/src/modules/memory/sync_sessions_episodic.rs
@@ -10,7 +10,10 @@ use tinymemory_api::provider::sync::{
RawArchiveCoverage, RawRebuildOutcome, SourceSyncState, SourceSyncStatus, SyncAuditEntry,
SyncRunOutcome,
};
-use tinymemory_api::provider::{ConversationSegment, EpisodicEvent, EpisodicTurn, MemoryCodingSessions, MemoryEpisodic, MemorySourceSync};
+use tinymemory_api::provider::{
+ ConversationSegment, EpisodicEvent, EpisodicTurn, MemoryCodingSessions, MemoryEpisodic,
+ MemorySourceSync,
+};
use tinymemory_bus::names::methods;
use super::provider::{from_bus, module_call, ModuleMemoryProvider};
@@ -180,8 +183,8 @@ impl MemoryCodingSessions for ModuleMemoryProvider {
&self,
request: CodingSessionIngestRequest,
) -> Result<CodingSessionIngestReport, MemoryError> {
- let deadline = crate::memory::sources::rpc::ingest_budget(request.max_sessions)
- + INGEST_BUS_GRACE;
+ let deadline =
+ crate::memory::sources::rpc::ingest_budget(request.max_sessions) + INGEST_BUS_GRACE;
self.proxy("ingest_coding_sessions")
.await?
.with_timeout(deadline)
@@ -311,4 +314,3 @@ impl MemoryEpisodic for ModuleMemoryProvider {
)
}
}
-
diff --git a/crates/openhuman-core/src/modules/memory_tests.rs b/crates/openhuman-core/src/modules/memory_tests.rs
index a0ccf6d902..297f8f5fdb 100644
--- a/crates/openhuman-core/src/modules/memory_tests.rs
+++ b/crates/openhuman-core/src/modules/memory_tests.rs
@@ -7,7 +7,6 @@
//! where they can be honest — `tinymemory`'s own loader E2E, against a real
//! broker and a real `dlopen`.
-
use std::sync::Arc;
use tinymemory_api::capabilities::{Capabilities, Capability};
diff --git a/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs b/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs
index 64f7bab116..77984be880 100644
--- a/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs
+++ b/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs
@@ -169,4 +169,3 @@ pub(crate) const TINYWALLET: ModuleRecord = ModuleRecord {
],
load: LoadPolicy::Lazy,
};
-
diff --git a/crates/openhuman-core/src/modules/registry/records_mcp_connectors.rs b/crates/openhuman-core/src/modules/registry/records_mcp_connectors.rs
index 1c9ca7355d..2dcb7539c6 100644
--- a/crates/openhuman-core/src/modules/registry/records_mcp_connectors.rs
+++ b/crates/openhuman-core/src/modules/registry/records_mcp_connectors.rs
@@ -2,7 +2,6 @@
use crate::modules::types::{LoadPolicy, ModuleRecord, PlatformAsset};
-
/// The `tinymcp` module: the Model Context Protocol client.
///
/// Owns both transports (Streamable HTTP and a subprocess over stdio), the
@@ -159,4 +158,3 @@ pub(crate) const TINYCONNECTORS: ModuleRecord = ModuleRecord {
// loads without configuration and still answers the capability members.
load: LoadPolicy::Lazy,
};
-
diff --git a/crates/openhuman-core/src/modules/registry/records_memory_juice.rs b/crates/openhuman-core/src/modules/registry/records_memory_juice.rs
index f294337386..e7d6c616a2 100644
--- a/crates/openhuman-core/src/modules/registry/records_memory_juice.rs
+++ b/crates/openhuman-core/src/modules/registry/records_memory_juice.rs
@@ -148,4 +148,3 @@ pub(crate) const TINYJUICE: ModuleRecord = ModuleRecord {
],
load: LoadPolicy::Lazy,
};
-
diff --git a/crates/openhuman-core/src/modules/registry/records_voice.rs b/crates/openhuman-core/src/modules/registry/records_voice.rs
index 7898bee39f..d57fc22b77 100644
--- a/crates/openhuman-core/src/modules/registry/records_voice.rs
+++ b/crates/openhuman-core/src/modules/registry/records_voice.rs
@@ -82,4 +82,3 @@ pub(crate) const TINYVOICE: ModuleRecord = ModuleRecord {
],
load: LoadPolicy::Lazy,
};
-
diff --git a/crates/openhuman-core/src/platform/doctor/core/config_checks.rs b/crates/openhuman-core/src/platform/doctor/core/config_checks.rs
index 4d9749226a..90b932cec8 100644
--- a/crates/openhuman-core/src/platform/doctor/core/config_checks.rs
+++ b/crates/openhuman-core/src/platform/doctor/core/config_checks.rs
@@ -5,7 +5,6 @@ use crate::config::Config;
use super::types::DiagnosticItem;
-
pub(super) fn check_config_semantics(config: &Config, items: &mut Vec<DiagnosticItem>) {
let cat = "config";
@@ -221,4 +220,3 @@ pub(super) fn embedding_provider_validation_error(name: &str) -> Option<String>
Err(err) => Some(format!("invalid custom provider URL: {err}")),
}
}
-
diff --git a/crates/openhuman-core/src/platform/doctor/core/memory_agent_checks.rs b/crates/openhuman-core/src/platform/doctor/core/memory_agent_checks.rs
index b169bbcebd..d08c677984 100644
--- a/crates/openhuman-core/src/platform/doctor/core/memory_agent_checks.rs
+++ b/crates/openhuman-core/src/platform/doctor/core/memory_agent_checks.rs
@@ -94,11 +94,10 @@ pub(super) fn check_embedding_model_health(config: &Config, items: &mut Vec<Diag
// Resolve the effective (intended, non-probed) embedding settings.
let local_embedding_model = config.workload_local_model("embeddings");
- let (provider, model, _dims) =
- crate::inference::embeddings::effective_embedding_settings(
- &config.memory,
- local_embedding_model.as_deref(),
- );
+ let (provider, model, _dims) = crate::inference::embeddings::effective_embedding_settings(
+ &config.memory,
+ local_embedding_model.as_deref(),
+ );
log::debug!("[doctor] check_embedding_model_health: provider={provider} model={model}");
@@ -331,4 +330,3 @@ pub(super) fn model_matches(installed: &str, configured: &str) -> bool {
fn model_base(model: &str) -> &str {
model.split(':').next().unwrap()
}
-
diff --git a/crates/openhuman-core/src/platform/doctor/core/run.rs b/crates/openhuman-core/src/platform/doctor/core/run.rs
index bb907a9ca3..df642800d0 100644
--- a/crates/openhuman-core/src/platform/doctor/core/run.rs
+++ b/crates/openhuman-core/src/platform/doctor/core/run.rs
@@ -15,7 +15,6 @@ use super::types::{
};
use super::workspace_checks::check_workspace;
-
/// How many chunks the bound memory driver holds, or why the count could not
/// be taken.
///
diff --git a/crates/openhuman-core/src/platform/doctor/core/workspace_checks.rs b/crates/openhuman-core/src/platform/doctor/core/workspace_checks.rs
index c24cd4673e..7f83e7ca2f 100644
--- a/crates/openhuman-core/src/platform/doctor/core/workspace_checks.rs
+++ b/crates/openhuman-core/src/platform/doctor/core/workspace_checks.rs
@@ -8,7 +8,6 @@ use crate::config::Config;
use super::types::DiagnosticItem;
-
pub(super) fn check_workspace(config: &Config, items: &mut Vec<DiagnosticItem>) {
let cat = "workspace";
let ws = &config.workspace_dir;
diff --git a/crates/openhuman-core/src/platform/socket/ws_loop/connect.rs b/crates/openhuman-core/src/platform/socket/ws_loop/connect.rs
index e0a2daa93b..0c49aab672 100644
--- a/crates/openhuman-core/src/platform/socket/ws_loop/connect.rs
+++ b/crates/openhuman-core/src/platform/socket/ws_loop/connect.rs
@@ -374,7 +374,10 @@ pub(super) fn extract_location_header(
/// `location` may be absolute (`https://host/path?q=1`) or relative
/// (`/socket.io/?EIO=4`). We use the `url` crate's relative-URL parser to do
/// the join the same way browsers do, then map `http`→`ws` / `https`→`wss`.
-pub(super) fn resolve_redirect_target(current_ws_url: &str, location: &str) -> Result<String, String> {
+pub(super) fn resolve_redirect_target(
+ current_ws_url: &str,
+ location: &str,
+) -> Result<String, String> {
let base = url::Url::parse(current_ws_url).map_err(|e| format!("invalid current URL: {e}"))?;
let resolved = base
.join(location)
diff --git a/crates/openhuman-core/src/platform/socket/ws_loop/dispatch.rs b/crates/openhuman-core/src/platform/socket/ws_loop/dispatch.rs
index 38f2835b20..2f89137a27 100644
--- a/crates/openhuman-core/src/platform/socket/ws_loop/dispatch.rs
+++ b/crates/openhuman-core/src/platform/socket/ws_loop/dispatch.rs
@@ -1,7 +1,6 @@
//! Incoming-message dispatch: Engine.IO framing and Socket.IO packet/ack
//! parsing.
-
use crate::platform::socket::manager::emit_state_change;
use crate::platform::socket::medulla::workflows;
use crate::platform::socket::types::ConnectionStatus;
@@ -146,4 +145,3 @@ pub(super) fn parse_sio_ack(text: &str) -> Option<(u64, serde_json::Value)> {
// ---------------------------------------------------------------------------
// Redirect-following connect
// ---------------------------------------------------------------------------
-
diff --git a/crates/openhuman-core/src/platform/socket/ws_loop/reconnect.rs b/crates/openhuman-core/src/platform/socket/ws_loop/reconnect.rs
index 635764e2f9..57640c19fa 100644
--- a/crates/openhuman-core/src/platform/socket/ws_loop/reconnect.rs
+++ b/crates/openhuman-core/src/platform/socket/ws_loop/reconnect.rs
@@ -1,7 +1,6 @@
//! The reconnect loop: [`ws_loop`], its failure-escalation logging, the
//! invalid-token retry decision, and the emit-queue drain used on shutdown.
-
use crate::platform::socket::medulla::workflows;
use std::sync::Arc;
@@ -441,4 +440,3 @@ pub(super) fn drain_pending_emits(rx: &mut mpsc::UnboundedReceiver<String>) -> u
// ---------------------------------------------------------------------------
// Single connection attempt
// ---------------------------------------------------------------------------
-
diff --git a/crates/openhuman-core/src/platform/socket/ws_loop_dispatch_and_redirect_tests.rs b/crates/openhuman-core/src/platform/socket/ws_loop_dispatch_and_redirect_tests.rs
index d690fc0c88..e0a0fcec14 100644
--- a/crates/openhuman-core/src/platform/socket/ws_loop_dispatch_and_redirect_tests.rs
+++ b/crates/openhuman-core/src/platform/socket/ws_loop_dispatch_and_redirect_tests.rs
@@ -1,9 +1,9 @@
use super::*;
-use std::sync::Arc;
-use tokio::sync::watch;
use crate::platform::socket::types::ConnectionStatus;
use serde_json::json;
+use std::sync::Arc;
+use tokio::sync::watch;
// ── Redirect resolution (the real fix for OPENHUMAN-TAURI-9X) ──
#[test]
diff --git a/crates/openhuman-core/src/platform/socket/ws_loop_reconnect_tests.rs b/crates/openhuman-core/src/platform/socket/ws_loop_reconnect_tests.rs
index dc12f4ffae..50555f40fe 100644
--- a/crates/openhuman-core/src/platform/socket/ws_loop_reconnect_tests.rs
+++ b/crates/openhuman-core/src/platform/socket/ws_loop_reconnect_tests.rs
@@ -1,12 +1,12 @@
use super::*;
use crate::platform::socket::token_provider::TokenProvider;
-use std::sync::Arc;
+use crate::platform::socket::types::ConnectionStatus;
use futures_util::StreamExt;
+use std::sync::Arc;
use tokio::sync::mpsc;
use tokio::sync::watch;
use tokio_tungstenite::tungstenite::Error as WsError;
-use crate::platform::socket::types::ConnectionStatus;
/// Driver-level proof: when the configured URL responds with a 301 pointing
/// at a working Engine.IO server, `ws_loop` follows the redirect, completes
/// the handshake, and records a one-shot warning in `SharedState.error` so
diff --git a/crates/openhuman-core/src/platform/socket/ws_loop_tests.rs b/crates/openhuman-core/src/platform/socket/ws_loop_tests.rs
index 8b124547f3..225020742b 100644
--- a/crates/openhuman-core/src/platform/socket/ws_loop_tests.rs
+++ b/crates/openhuman-core/src/platform/socket/ws_loop_tests.rs
@@ -6,11 +6,11 @@ use tokio_tungstenite::tungstenite::http::{header::LOCATION, Response, StatusCod
use crate::platform::socket::token_provider::{is_invalid_token_error, static_token_provider};
use crate::platform::socket::manager::SharedState;
+use crate::platform::socket::types::ConnectionStatus;
+use futures_util::{SinkExt, StreamExt};
use std::sync::Arc;
use tokio::sync::mpsc;
-use futures_util::{SinkExt, StreamExt};
use tokio_tungstenite::tungstenite::{Error as WsError, Message as WsMessage};
-use crate::platform::socket::types::ConnectionStatus;
fn make_shared() -> Arc<SharedState> {
Arc::new(SharedState {
webhook_router: RwLock::new(None),
diff --git a/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs b/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs
index a49b91b865..c3e25b7819 100644
--- a/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs
+++ b/crates/openhuman-core/src/search/tools/tavily/extract_tool.rs
@@ -1,10 +1,9 @@
//! `TavilyExtractTool`: full page content retrieval via `POST /extract`.
-
-use crate::search::tools::tavily::types::escape_link_destination;
-use crate::search::tools::tavily::types::escape_link_text;
use super::client::TavilyClient;
use super::types::{copy_string, non_empty, TavilyExtractResponse, TavilyExtractResult};
+use crate::search::tools::tavily::types::escape_link_destination;
+use crate::search::tools::tavily::types::escape_link_text;
use crate::tools::traits::{Tool, ToolCallOptions, ToolResult};
use async_trait::async_trait;
use serde_json::{json, Value};
diff --git a/crates/openhuman-core/src/security/policy/policy_tests.rs b/crates/openhuman-core/src/security/policy/policy_tests.rs
index 95bce81d6e..08e20d055b 100644
--- a/crates/openhuman-core/src/security/policy/policy_tests.rs
+++ b/crates/openhuman-core/src/security/policy/policy_tests.rs
@@ -113,10 +113,10 @@ fn turn_workspace_policy() -> (tempfile::TempDir, PathBuf, SecurityPolicy) {
#[path = "policy_allowlist_tests.rs"]
mod allowlist_tests;
-#[path = "policy_paths_and_risk_tests.rs"]
-mod paths_and_risk_tests;
#[path = "policy_injection_tests.rs"]
mod injection_tests;
+#[path = "policy_paths_and_risk_tests.rs"]
+mod paths_and_risk_tests;
#[path = "policy_trusted_roots_tests.rs"]
mod trusted_roots_tests;
#[path = "policy_workspace_internal_tests.rs"]
diff --git a/crates/openhuman-core/src/skills/ops_discover.rs b/crates/openhuman-core/src/skills/ops_discover.rs
index 41e5fbe20a..658e3eb8ae 100644
--- a/crates/openhuman-core/src/skills/ops_discover.rs
+++ b/crates/openhuman-core/src/skills/ops_discover.rs
@@ -16,16 +16,15 @@ mod scan;
// `Path`, `Workflow`, `WorkflowScope`, and `precedence` exactly as it did
// before this module was split into submodules.
#[cfg(test)]
-use std::path::Path;
-#[cfg(test)]
use super::ops_types::{Workflow, WorkflowScope};
#[cfg(test)]
use collision::precedence;
+#[cfg(test)]
+use std::path::Path;
pub use api::{
- discover_automations, discover_workflows, discover_workflows_with_profile,
- init_workflows_dir, is_workspace_trusted, load_workflow_metadata,
- load_workflow_metadata_for_profile,
+ discover_automations, discover_workflows, discover_workflows_with_profile, init_workflows_dir,
+ is_workspace_trusted, load_workflow_metadata, load_workflow_metadata_for_profile,
};
pub use resource::{
profile_local_skill_ids, read_workflow_resource, read_workflow_resource_with_profile,
diff --git a/crates/openhuman-core/src/tools/impl/system/shell_tests.rs b/crates/openhuman-core/src/tools/impl/system/shell_tests.rs
index 9880b67c83..c19baecde0 100644
--- a/crates/openhuman-core/src/tools/impl/system/shell_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/system/shell_tests.rs
@@ -83,7 +83,7 @@ impl Drop for EnvGuard {
}
}
-#[path = "shell_tests_schema_and_env_tests.rs"]
-mod schema_and_env_tests;
#[path = "shell_tests_runtime_and_sandbox_tests.rs"]
mod runtime_and_sandbox_tests;
+#[path = "shell_tests_schema_and_env_tests.rs"]
+mod schema_and_env_tests;
diff --git a/crates/openhuman-core/src/tools/ops_tests.rs b/crates/openhuman-core/src/tools/ops_tests.rs
index 10e1aa96de..2a37c9da5c 100644
--- a/crates/openhuman-core/src/tools/ops_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests.rs
@@ -454,11 +454,11 @@ const OPTIONAL_FAMILY_MEMORY_TOOLS: &[&str] = &[
/// disables every driver-backed capability.
const ALWAYS_PRESENT_MEMORY_TOOLS: &[&str] = &["update_memory_md", "memory_store_kinds"];
+#[path = "ops_tests_capability_gating_tests.rs"]
+mod capability_gating_tests;
#[path = "ops_tests_default_registry_tests.rs"]
mod default_registry_tests;
-#[path = "ops_tests_execution_and_serde_tests.rs"]
-mod execution_and_serde_tests;
#[path = "ops_tests_domain_family_tests.rs"]
mod domain_family_tests;
-#[path = "ops_tests_capability_gating_tests.rs"]
-mod capability_gating_tests;
+#[path = "ops_tests_execution_and_serde_tests.rs"]
+mod execution_and_serde_tests;
diff --git a/crates/openhuman-core/src/tools/schemas/registry.rs b/crates/openhuman-core/src/tools/schemas/registry.rs
index 36d7ac5e45..4e86e1883c 100644
--- a/crates/openhuman-core/src/tools/schemas/registry.rs
+++ b/crates/openhuman-core/src/tools/schemas/registry.rs
@@ -4,7 +4,6 @@
//! small allowlist of tool-like operations exposed over JSON-RPC (see the module
//! doc on `super`). [`tools_schemas`] is the schema lookup shared by both.
-
use crate::core::all::RegisteredController;
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
diff --git a/crates/openhuman-core/src/tools/schemas/web_search.rs b/crates/openhuman-core/src/tools/schemas/web_search.rs
index 016d3f2645..26e9f111c4 100644
--- a/crates/openhuman-core/src/tools/schemas/web_search.rs
+++ b/crates/openhuman-core/src/tools/schemas/web_search.rs
@@ -304,7 +304,10 @@ pub(super) fn handle_searxng_search(params: Map<String, Value>) -> ControllerFut
})
}
-pub(super) fn optional_string_array(params: &Map<String, Value>, key: &str) -> Result<Vec<String>, String> {
+pub(super) fn optional_string_array(
+ params: &Map<String, Value>,
+ key: &str,
+) -> Result<Vec<String>, String> {
let Some(value) = params.get(key) else {
return Ok(Vec::new());
};
diff --git a/crates/openhuman-core/src/voice/always_on.rs b/crates/openhuman-core/src/voice/always_on.rs
index 5520529cb8..4094ae8423 100644
--- a/crates/openhuman-core/src/voice/always_on.rs
+++ b/crates/openhuman-core/src/voice/always_on.rs
@@ -41,10 +41,10 @@ pub use processor::{start_if_enabled, stop};
use processor::{notch_status, PAUSED};
-#[cfg(test)]
-use processor::ENABLED;
#[cfg(test)]
use crate::modules::voice as tinyvoice;
+#[cfg(test)]
+use processor::ENABLED;
#[cfg(test)]
#[path = "always_on_tests.rs"]
diff --git a/crates/openhuman-core/src/voice/realtime_harness.rs b/crates/openhuman-core/src/voice/realtime_harness.rs
index f076b30de0..199fbdb36f 100644
--- a/crates/openhuman-core/src/voice/realtime_harness.rs
+++ b/crates/openhuman-core/src/voice/realtime_harness.rs
@@ -28,6 +28,8 @@ mod turn_handler;
pub use prompt::extract_prompt;
pub use turn_handler::handle_voice_harness_turn;
+#[cfg(test)]
+use crate::agent::progress::AgentProgress;
#[cfg(test)]
use agent::VOICE_DIRECTIVE;
#[cfg(test)]
@@ -37,8 +39,6 @@ use prompt::{
};
#[cfg(test)]
use turn_handler::{next_handoff_line, VOICE_HANDOFF_LINES};
-#[cfg(test)]
-use crate::agent::progress::AgentProgress;
#[cfg(test)]
#[path = "realtime_harness_tests.rs"]
diff --git a/crates/openhuman-core/src/voice/realtime_harness/chat_delivery.rs b/crates/openhuman-core/src/voice/realtime_harness/chat_delivery.rs
index 7518e33e01..df7c20291e 100644
--- a/crates/openhuman-core/src/voice/realtime_harness/chat_delivery.rs
+++ b/crates/openhuman-core/src/voice/realtime_harness/chat_delivery.rs
@@ -66,15 +66,13 @@ pub(super) fn deliver_voice_result_to_chat(
// session (a fast read-back turn). Skipped for read-back turns themselves to
// avoid a loop; harmless if the call already ended (nobody is subscribed).
if allow_speak_back {
- crate::web_chat::publish_web_channel_event(
- crate::core::socketio::WebChannelEvent {
- event: "voice_speak".to_string(),
- client_id: VOICE_CHAT_CLIENT_ID.to_string(),
- full_response: Some(spoken.to_string()),
- success: Some(true),
- ..Default::default()
- },
- );
+ crate::web_chat::publish_web_channel_event(crate::core::socketio::WebChannelEvent {
+ event: "voice_speak".to_string(),
+ client_id: VOICE_CHAT_CLIENT_ID.to_string(),
+ full_response: Some(spoken.to_string()),
+ success: Some(true),
+ ..Default::default()
+ });
}
}
diff --git a/crates/openhuman-core/src/voice/realtime_harness/turn_handler.rs b/crates/openhuman-core/src/voice/realtime_harness/turn_handler.rs
index bca163603f..68b7b65eca 100644
--- a/crates/openhuman-core/src/voice/realtime_harness/turn_handler.rs
+++ b/crates/openhuman-core/src/voice/realtime_harness/turn_handler.rs
@@ -14,8 +14,13 @@ use tokio::sync::Semaphore;
use crate::agent::progress::AgentProgress;
use super::agent::run_voice_turn;
-use super::chat_delivery::{deliver_voice_failure_to_chat, deliver_voice_result_to_chat, emit_error, emit_event};
-use super::prompt::{extract_prompt, is_answerable_prompt, is_content_free, readback_payload, should_arm_speak_back, spoken_delta};
+use super::chat_delivery::{
+ deliver_voice_failure_to_chat, deliver_voice_result_to_chat, emit_error, emit_event,
+};
+use super::prompt::{
+ extract_prompt, is_answerable_prompt, is_content_free, readback_payload, should_arm_speak_back,
+ spoken_delta,
+};
/// How long a voice turn may run before we stop making the caller wait and hand
/// the result off to chat. The cloud voice session cancels a turn with no spoken
diff --git a/crates/openhuman-core/src/voice/server.rs b/crates/openhuman-core/src/voice/server.rs
index aca9f79d84..48cf16278f 100644
--- a/crates/openhuman-core/src/voice/server.rs
+++ b/crates/openhuman-core/src/voice/server.rs
@@ -24,13 +24,6 @@ pub use runtime::VoiceServer;
pub use singleton::{global_server, run_standalone, start_if_enabled, try_global_server};
pub use types::{ServerState, VoiceServerConfig, VoiceServerStatus};
-#[cfg(test)]
-use pipeline::{
- build_initial_prompt, capture_expected_app_name, process_recording_bg, push_recent_transcript,
- truncate_for_log, update_state_if_current,
-};
-#[cfg(test)]
-use types::DEFAULT_SILENCE_THRESHOLD;
#[cfg(test)]
use crate::config::Config;
#[cfg(test)]
@@ -38,9 +31,16 @@ use crate::voice::audio_capture::RecordingHandle;
#[cfg(test)]
use crate::voice::hotkey::ActivationMode;
#[cfg(test)]
+use pipeline::{
+ build_initial_prompt, capture_expected_app_name, process_recording_bg, push_recent_transcript,
+ truncate_for_log, update_state_if_current,
+};
+#[cfg(test)]
use std::sync::Arc;
#[cfg(test)]
use tokio::sync::Mutex;
+#[cfg(test)]
+use types::DEFAULT_SILENCE_THRESHOLD;
const LOG_PREFIX: &str = "[voice_server]";
diff --git a/crates/openhuman-core/src/voice/server/pipeline.rs b/crates/openhuman-core/src/voice/server/pipeline.rs
index 7a07507a9d..3cad54aadd 100644
--- a/crates/openhuman-core/src/voice/server/pipeline.rs
+++ b/crates/openhuman-core/src/voice/server/pipeline.rs
@@ -10,14 +10,16 @@ use std::time::Instant;
use log::{debug, info, warn};
use tokio::sync::Mutex;
+use crate::config::Config;
#[cfg(target_os = "macos")]
use crate::desktop::accessibility;
-use crate::config::Config;
use crate::modules::voice::{is_hallucinated, HallucinationMode};
use crate::voice::audio_capture::RecordingHandle;
use crate::voice::text_input;
-use super::types::{ServerState, VoiceServerConfig, MAX_INITIAL_PROMPT_CHARS, MAX_RECENT_TRANSCRIPTS};
+use super::types::{
+ ServerState, VoiceServerConfig, MAX_INITIAL_PROMPT_CHARS, MAX_RECENT_TRANSCRIPTS,
+};
use super::LOG_PREFIX;
/// Capture the frontmost app name at hotkey press so insertion can be validated later.
diff --git a/crates/openhuman-core/src/web3/wallet/execution.rs b/crates/openhuman-core/src/web3/wallet/execution.rs
index 94a06a2001..30d8a75add 100644
--- a/crates/openhuman-core/src/web3/wallet/execution.rs
+++ b/crates/openhuman-core/src/web3/wallet/execution.rs
@@ -26,40 +26,42 @@
mod accounts;
mod broadcast;
-mod quotes;
mod queries;
+mod quotes;
mod transfer;
mod tx_lookup;
mod types;
mod validate;
pub(crate) use accounts::require_evm_account;
-pub(crate) use broadcast::{sign_and_broadcast_evm, sign_and_broadcast_solana};
pub use broadcast::execute_prepared;
+pub(crate) use broadcast::{sign_and_broadcast_evm, sign_and_broadcast_solana};
+pub use queries::{
+ balances, chain_status, network_defaults, supported_assets, EVM_BALANCE_NETWORKS,
+};
pub use quotes::prepared_quotes_for_test;
pub(crate) use quotes::{current_owner, now_ms};
#[cfg(test)]
pub(crate) use quotes::{insert_quote_for_test, reset_quote_store_for_tests};
-pub use queries::{balances, chain_status, network_defaults, supported_assets, EVM_BALANCE_NETWORKS};
pub use transfer::prepare_transfer;
pub use tx_lookup::{lookup_tx, tx_receipt, tx_status};
pub use types::{
BalanceInfo, ChainStatus, ExecutePreparedParams, ExecutionResult, PrepareTransferParams,
- PreparedKind, PreparedStatus, PreparedTransaction, ProviderStatus, SupportedAsset, TxLookupInfo,
- TxReceiptInfo, TxState, TxStatusInfo,
+ PreparedKind, PreparedStatus, PreparedTransaction, ProviderStatus, SupportedAsset,
+ TxLookupInfo, TxReceiptInfo, TxState, TxStatusInfo,
};
pub(crate) use types::{QuoteOwner, RawBroadcastResult};
-pub use validate::{hex_to_bytes, hex_to_u128, u128_to_hex};
-pub(crate) use validate::{chain_str, format_amount, validate_amount, validate_calldata};
#[cfg(test)]
pub(crate) use validate::compressed_public_key;
+pub(crate) use validate::{chain_str, format_amount, validate_amount, validate_calldata};
+pub use validate::{hex_to_bytes, hex_to_u128, u128_to_hex};
+#[cfg(test)]
+use parking_lot::Mutex;
#[cfg(test)]
use quotes::{next_quote_id, store_quote, take_quote_for};
#[cfg(test)]
use validate::estimated_fee_raw;
-#[cfg(test)]
-use parking_lot::Mutex;
const LOG_PREFIX: &str = "[wallet]";
diff --git a/crates/openhuman-core/src/web3/wallet/execution/accounts.rs b/crates/openhuman-core/src/web3/wallet/execution/accounts.rs
index 22dd8a7644..2c436aae95 100644
--- a/crates/openhuman-core/src/web3/wallet/execution/accounts.rs
+++ b/crates/openhuman-core/src/web3/wallet/execution/accounts.rs
@@ -1,7 +1,9 @@
//! Resolving a derived wallet account for a chain, erroring cleanly when the
//! wallet has not been configured yet.
-use super::super::ops::{status as wallet_status, WalletAccount, WalletChain, WALLET_NOT_CONFIGURED_MESSAGE};
+use super::super::ops::{
+ status as wallet_status, WalletAccount, WalletChain, WALLET_NOT_CONFIGURED_MESSAGE,
+};
use super::validate::chain_str;
/// Resolve the derived EVM account address, erroring if the wallet is not
diff --git a/crates/openhuman-core/src/web3/wallet/execution/broadcast.rs b/crates/openhuman-core/src/web3/wallet/execution/broadcast.rs
index c4506f3cb1..80d19b2336 100644
--- a/crates/openhuman-core/src/web3/wallet/execution/broadcast.rs
+++ b/crates/openhuman-core/src/web3/wallet/execution/broadcast.rs
@@ -6,7 +6,9 @@ use log::warn;
use crate::rpc::RpcOutcome;
-use super::super::chains::{btc as chain_btc, evm as chain_evm, solana as chain_sol, tron as chain_tron};
+use super::super::chains::{
+ btc as chain_btc, evm as chain_evm, solana as chain_sol, tron as chain_tron,
+};
use super::super::defaults::{explorer_tx_url, EvmNetwork};
use super::super::ops::WalletChain;
use super::quotes::{current_owner, now_ms, store_quote, take_quote_for, QUOTE_TTL_MS};
diff --git a/crates/openhuman-core/src/web3/wallet/execution/queries.rs b/crates/openhuman-core/src/web3/wallet/execution/queries.rs
index b4be35fb19..4aab7781d4 100644
--- a/crates/openhuman-core/src/web3/wallet/execution/queries.rs
+++ b/crates/openhuman-core/src/web3/wallet/execution/queries.rs
@@ -5,7 +5,9 @@ use log::{debug, warn};
use crate::rpc::RpcOutcome;
-use super::super::chains::{btc as chain_btc, evm as chain_evm, solana as chain_sol, tron as chain_tron};
+use super::super::chains::{
+ btc as chain_btc, evm as chain_evm, solana as chain_sol, tron as chain_tron,
+};
use super::super::defaults::{
evm_asset_catalog, network_defaults as default_networks, rpc_url_for_chain, EvmNetwork,
WalletAssetDefinition, WalletNetworkDefaults,
diff --git a/crates/openhuman-core/src/web3/wallet/execution/transfer.rs b/crates/openhuman-core/src/web3/wallet/execution/transfer.rs
index c9e6d9d315..5331b4cbf8 100644
--- a/crates/openhuman-core/src/web3/wallet/execution/transfer.rs
+++ b/crates/openhuman-core/src/web3/wallet/execution/transfer.rs
@@ -11,7 +11,9 @@ use super::super::ops::WalletChain;
use super::accounts::require_account;
use super::quotes::{current_owner, next_quote_id, now_ms, store_quote, QUOTE_TTL_MS};
use super::types::{PrepareTransferParams, PreparedKind, PreparedStatus, PreparedTransaction};
-use super::validate::{chain_str, estimated_fee_raw, format_amount, validate_address, validate_amount};
+use super::validate::{
+ chain_str, estimated_fee_raw, format_amount, validate_address, validate_amount,
+};
use super::LOG_PREFIX;
pub async fn prepare_transfer(
diff --git a/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs b/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs
index 926583287a..b42a0b08c5 100644
--- a/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs
+++ b/crates/openhuman-core/src/web3/wallet/execution/tx_lookup.rs
@@ -5,7 +5,9 @@ use log::debug;
use crate::rpc::RpcOutcome;
-use super::super::chains::{btc as chain_btc, evm as chain_evm, solana as chain_sol, tron as chain_tron};
+use super::super::chains::{
+ btc as chain_btc, evm as chain_evm, solana as chain_sol, tron as chain_tron,
+};
use super::super::defaults::EvmNetwork;
use super::super::ops::WalletChain;
use super::types::{TxLookupInfo, TxReceiptInfo, TxStatusInfo};
diff --git a/crates/openhuman-core/src/web3/wallet/ops.rs b/crates/openhuman-core/src/web3/wallet/ops.rs
index 59f3b2f029..d44eedb20a 100644
--- a/crates/openhuman-core/src/web3/wallet/ops.rs
+++ b/crates/openhuman-core/src/web3/wallet/ops.rs
@@ -7,12 +7,12 @@
mod state;
mod types;
+use types::StoredWalletState;
+pub(crate) use types::WalletSecretMaterial;
pub use types::{
RevealRecoveryPhraseResult, WalletAccount, WalletChain, WalletSetupParams, WalletSetupSource,
WalletStatus, WALLET_NOT_CONFIGURED_MESSAGE,
};
-pub(crate) use types::WalletSecretMaterial;
-use types::StoredWalletState;
use log::debug;
diff --git a/crates/openhuman-core/src/web3/wallet/ops/state.rs b/crates/openhuman-core/src/web3/wallet/ops/state.rs
index 7c7f95face..11e9ae618d 100644
--- a/crates/openhuman-core/src/web3/wallet/ops/state.rs
+++ b/crates/openhuman-core/src/web3/wallet/ops/state.rs
@@ -377,10 +377,7 @@ pub(super) fn current_time_ms() -> u64 {
.unwrap_or(0)
}
-pub(super) fn to_status(
- config: &Config,
- state: Option<StoredWalletState>,
-) -> super::WalletStatus {
+pub(super) fn to_status(config: &Config, state: Option<StoredWalletState>) -> super::WalletStatus {
match state {
Some(state) => {
// A mnemonic is "stored" if it's either in the JSON field (headless path)
diff --git a/crates/openhuman-core/src/web3/x402/ops/client.rs b/crates/openhuman-core/src/web3/x402/ops/client.rs
index 4e413124ba..0f18bb5eee 100644
--- a/crates/openhuman-core/src/web3/x402/ops/client.rs
+++ b/crates/openhuman-core/src/web3/x402/ops/client.rs
@@ -307,13 +307,11 @@ async fn wallet_signer() -> Result<
.await
.map_err(|e| X402Error::Wallet(format!("load config: {e}")))?;
- let mnemonic = crate::security::encryption::rpc::decrypt_secret(
- &config,
- &secret.encrypted_mnemonic,
- )
- .await
- .map_err(|e| X402Error::Wallet(format!("decrypt mnemonic: {e}")))?
- .value;
+ let mnemonic =
+ crate::security::encryption::rpc::decrypt_secret(&config, &secret.encrypted_mnemonic)
+ .await
+ .map_err(|e| X402Error::Wallet(format!("decrypt mnemonic: {e}")))?
+ .value;
let signing_secret = tinywallet_bus::wire::SecretMaterial {
mnemonic,
diff --git a/crates/openhuman-core/src/web3/x402/ops/evm_payment.rs b/crates/openhuman-core/src/web3/x402/ops/evm_payment.rs
index f640c1a8f9..0a287d82a7 100644
--- a/crates/openhuman-core/src/web3/x402/ops/evm_payment.rs
+++ b/crates/openhuman-core/src/web3/x402/ops/evm_payment.rs
@@ -226,13 +226,11 @@ pub(super) async fn evm_signer() -> Result<
.await
.map_err(|e| X402Error::Wallet(format!("load config: {e}")))?;
- let mnemonic = crate::security::encryption::rpc::decrypt_secret(
- &config,
- &secret.encrypted_mnemonic,
- )
- .await
- .map_err(|e| X402Error::Wallet(format!("decrypt mnemonic: {e}")))?
- .value;
+ let mnemonic =
+ crate::security::encryption::rpc::decrypt_secret(&config, &secret.encrypted_mnemonic)
+ .await
+ .map_err(|e| X402Error::Wallet(format!("decrypt mnemonic: {e}")))?
+ .value;
let signing_secret = tinywallet_bus::wire::SecretMaterial {
mnemonic,
diff --git a/crates/openhuman-core/src/web_chat/ops.rs b/crates/openhuman-core/src/web_chat/ops.rs
index ab05b52b4a..020f2f37f5 100644
--- a/crates/openhuman-core/src/web_chat/ops.rs
+++ b/crates/openhuman-core/src/web_chat/ops.rs
@@ -26,9 +26,9 @@ pub use start_chat::start_chat;
#[cfg(any(test, debug_assertions))]
pub use state::parallel_in_flight_entries_for_test;
-pub(crate) use state::{event_session_id_for, key_for};
-pub use state::{cancel_should_target, in_flight_entries_for_test, invalidate_thread_sessions};
pub(super) use state::THREAD_SESSIONS;
+pub use state::{cancel_should_target, in_flight_entries_for_test, invalidate_thread_sessions};
+pub(crate) use state::{event_session_id_for, key_for};
#[cfg(any(test, debug_assertions))]
pub use test_hooks::set_test_forced_run_chat_task_error;
diff --git a/crates/openhuman-rpc/src/lib_tests.rs b/crates/openhuman-rpc/src/lib_tests.rs
index 9926ef9b48..e1037cf3e2 100644
--- a/crates/openhuman-rpc/src/lib_tests.rs
+++ b/crates/openhuman-rpc/src/lib_tests.rs
@@ -1,87 +1,87 @@
use super::*;
- use serde_json::json;
+use serde_json::json;
- #[test]
- fn new_preserves_value_and_logs() {
- let outcome: RpcOutcome<i64> = RpcOutcome::new(7, vec!["a".into(), "b".into()]);
- assert_eq!(outcome.value, 7);
- assert_eq!(outcome.logs, vec!["a".to_string(), "b".to_string()]);
- }
+#[test]
+fn new_preserves_value_and_logs() {
+ let outcome: RpcOutcome<i64> = RpcOutcome::new(7, vec!["a".into(), "b".into()]);
+ assert_eq!(outcome.value, 7);
+ assert_eq!(outcome.logs, vec!["a".to_string(), "b".to_string()]);
+}
- #[test]
- fn single_log_stores_exactly_one_log() {
- let outcome = RpcOutcome::single_log(json!({"ok": true}), "hello");
- assert_eq!(outcome.logs.len(), 1);
- assert_eq!(outcome.logs[0], "hello");
- assert_eq!(outcome.value, json!({"ok": true}));
- }
+#[test]
+fn single_log_stores_exactly_one_log() {
+ let outcome = RpcOutcome::single_log(json!({"ok": true}), "hello");
+ assert_eq!(outcome.logs.len(), 1);
+ assert_eq!(outcome.logs[0], "hello");
+ assert_eq!(outcome.value, json!({"ok": true}));
+}
- #[test]
- fn single_log_accepts_string_and_str_via_into() {
- let a = RpcOutcome::single_log(json!(1), "static str");
- let b = RpcOutcome::single_log(json!(1), String::from("owned string"));
- assert_eq!(a.logs[0], "static str");
- assert_eq!(b.logs[0], "owned string");
- }
+#[test]
+fn single_log_accepts_string_and_str_via_into() {
+ let a = RpcOutcome::single_log(json!(1), "static str");
+ let b = RpcOutcome::single_log(json!(1), String::from("owned string"));
+ assert_eq!(a.logs[0], "static str");
+ assert_eq!(b.logs[0], "owned string");
+}
- #[test]
- fn into_cli_compatible_json_no_logs_returns_bare_value() {
- let outcome = RpcOutcome::<serde_json::Value>::new(json!({"x": 1}), vec![]);
- let out = outcome.into_cli_compatible_json().unwrap();
- assert_eq!(out, json!({"x": 1}));
- assert!(out.get("logs").is_none());
- }
+#[test]
+fn into_cli_compatible_json_no_logs_returns_bare_value() {
+ let outcome = RpcOutcome::<serde_json::Value>::new(json!({"x": 1}), vec![]);
+ let out = outcome.into_cli_compatible_json().unwrap();
+ assert_eq!(out, json!({"x": 1}));
+ assert!(out.get("logs").is_none());
+}
- #[test]
- fn into_cli_compatible_json_with_logs_wraps_in_envelope() {
- let outcome = RpcOutcome::single_log(json!(42), "did something");
- let out = outcome.into_cli_compatible_json().unwrap();
- assert_eq!(out["result"], json!(42));
- assert_eq!(out["logs"], json!(["did something"]));
- // And only those two keys exist.
- assert_eq!(out.as_object().unwrap().len(), 2);
- }
+#[test]
+fn into_cli_compatible_json_with_logs_wraps_in_envelope() {
+ let outcome = RpcOutcome::single_log(json!(42), "did something");
+ let out = outcome.into_cli_compatible_json().unwrap();
+ assert_eq!(out["result"], json!(42));
+ assert_eq!(out["logs"], json!(["did something"]));
+ // And only those two keys exist.
+ assert_eq!(out.as_object().unwrap().len(), 2);
+}
- #[test]
- fn into_cli_compatible_json_serializes_typed_value() {
- #[derive(serde::Serialize)]
- struct Payload<'a> {
- name: &'a str,
- count: u32,
- }
- let outcome = RpcOutcome::new(
- Payload {
- name: "atlas",
- count: 3,
- },
- vec![],
- );
- let out = outcome.into_cli_compatible_json().unwrap();
- assert_eq!(out, json!({"name": "atlas", "count": 3}));
+#[test]
+fn into_cli_compatible_json_serializes_typed_value() {
+ #[derive(serde::Serialize)]
+ struct Payload<'a> {
+ name: &'a str,
+ count: u32,
}
+ let outcome = RpcOutcome::new(
+ Payload {
+ name: "atlas",
+ count: 3,
+ },
+ vec![],
+ );
+ let out = outcome.into_cli_compatible_json().unwrap();
+ assert_eq!(out, json!({"name": "atlas", "count": 3}));
+}
- #[test]
- fn into_cli_compatible_json_treats_null_value_as_bare_when_no_logs() {
- let outcome: RpcOutcome<Option<i32>> = RpcOutcome::new(None, vec![]);
- let out = outcome.into_cli_compatible_json().unwrap();
- assert!(out.is_null());
- }
+#[test]
+fn into_cli_compatible_json_treats_null_value_as_bare_when_no_logs() {
+ let outcome: RpcOutcome<Option<i32>> = RpcOutcome::new(None, vec![]);
+ let out = outcome.into_cli_compatible_json().unwrap();
+ assert!(out.is_null());
+}
- #[test]
- fn into_cli_compatible_json_preserves_log_order() {
- let outcome = RpcOutcome::new(
- json!({"ok": true}),
- vec!["first".into(), "second".into(), "third".into()],
- );
- let out = outcome.into_cli_compatible_json().unwrap();
- assert_eq!(out["logs"], json!(["first", "second", "third"]));
- }
+#[test]
+fn into_cli_compatible_json_preserves_log_order() {
+ let outcome = RpcOutcome::new(
+ json!({"ok": true}),
+ vec!["first".into(), "second".into(), "third".into()],
+ );
+ let out = outcome.into_cli_compatible_json().unwrap();
+ assert_eq!(out["logs"], json!(["first", "second", "third"]));
+}
- #[test]
- fn into_cli_compatible_json_empty_string_logs_still_envelope() {
- // An empty log string is still a log — envelope shape must kick in.
- let outcome = RpcOutcome::new(json!("x"), vec!["".into()]);
- let out = outcome.into_cli_compatible_json().unwrap();
- assert!(out.get("result").is_some());
- assert_eq!(out["logs"], json!([""]));
- }
+#[test]
+fn into_cli_compatible_json_empty_string_logs_still_envelope() {
+ // An empty log string is still a log — envelope shape must kick in.
+ let outcome = RpcOutcome::new(json!("x"), vec!["".into()]);
+ let out = outcome.into_cli_compatible_json().unwrap();
+ assert!(out.get("result").is_some());
+ assert_eq!(out["logs"], json!([""]));
+}
diff --git a/crates/openhuman-rpc/src/structured_error_tests.rs b/crates/openhuman-rpc/src/structured_error_tests.rs
index 4777c1c10a..944cb581c0 100644
--- a/crates/openhuman-rpc/src/structured_error_tests.rs
+++ b/crates/openhuman-rpc/src/structured_error_tests.rs
@@ -1,38 +1,38 @@
use super::*;
- use serde_json::json;
+use serde_json::json;
- #[test]
- fn encode_then_decode_round_trips() {
- let original = StructuredRpcError {
- message: "thread thread-123 not found".to_string(),
- data: Some(json!({ "kind": "ThreadNotFound", "thread_id": "thread-123" })),
- expected_user_state: true,
- };
- let encoded = original.encode();
- assert!(
- encoded.starts_with(STRUCTURED_RPC_ERROR_SENTINEL),
- "encoded string must carry the sentinel prefix"
- );
- let decoded = StructuredRpcError::decode(&encoded).expect("decoded");
- assert_eq!(decoded, original);
- }
+#[test]
+fn encode_then_decode_round_trips() {
+ let original = StructuredRpcError {
+ message: "thread thread-123 not found".to_string(),
+ data: Some(json!({ "kind": "ThreadNotFound", "thread_id": "thread-123" })),
+ expected_user_state: true,
+ };
+ let encoded = original.encode();
+ assert!(
+ encoded.starts_with(STRUCTURED_RPC_ERROR_SENTINEL),
+ "encoded string must carry the sentinel prefix"
+ );
+ let decoded = StructuredRpcError::decode(&encoded).expect("decoded");
+ assert_eq!(decoded, original);
+}
- #[test]
- fn decode_returns_none_for_plain_strings() {
- assert!(StructuredRpcError::decode("plain error").is_none());
- assert!(StructuredRpcError::decode("").is_none());
- assert!(StructuredRpcError::decode("__OPENHUMAN_STRUCTURED_RPC_ERROR_V1__").is_none());
- }
+#[test]
+fn decode_returns_none_for_plain_strings() {
+ assert!(StructuredRpcError::decode("plain error").is_none());
+ assert!(StructuredRpcError::decode("").is_none());
+ assert!(StructuredRpcError::decode("__OPENHUMAN_STRUCTURED_RPC_ERROR_V1__").is_none());
+}
- #[test]
- fn decode_returns_none_for_corrupt_envelope() {
- let bad = format!("{STRUCTURED_RPC_ERROR_SENTINEL}not-json");
- assert!(StructuredRpcError::decode(&bad).is_none());
- }
+#[test]
+fn decode_returns_none_for_corrupt_envelope() {
+ let bad = format!("{STRUCTURED_RPC_ERROR_SENTINEL}not-json");
+ assert!(StructuredRpcError::decode(&bad).is_none());
+}
- #[test]
- fn expected_user_state_defaults_to_false_when_absent() {
- let raw = format!("{STRUCTURED_RPC_ERROR_SENTINEL}{{\"message\":\"x\",\"data\":null}}");
- let decoded = StructuredRpcError::decode(&raw).expect("decoded");
- assert!(!decoded.expected_user_state);
- }
+#[test]
+fn expected_user_state_defaults_to_false_when_absent() {
+ let raw = format!("{STRUCTURED_RPC_ERROR_SENTINEL}{{\"message\":\"x\",\"data\":null}}");
+ let decoded = StructuredRpcError::decode(&raw).expect("decoded");
+ assert!(!decoded.expected_user_state);
+}