Skip to content

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

chore: apply rustfmt import ordering and line wrapping

Steven Enamakel86d0ac252a13
diff --git a/crates/openhuman-core/src/channels/providers/relay/channel.rs b/crates/openhuman-core/src/channels/providers/relay/channel.rs
index f87c3c6583..7ccc2cf392 100644
--- a/crates/openhuman-core/src/channels/providers/relay/channel.rs
+++ b/crates/openhuman-core/src/channels/providers/relay/channel.rs
@@ -10,7 +10,7 @@ use std::sync::Mutex;
use async_trait::async_trait;
use serde_json::json;
-use crate::web_chat::{publish_web_channel_event, WebChannelEvent};
+use crate::web_chat::{WebChannelEvent, publish_web_channel_event};
use tinychannels_bus::{ChannelMessage, SendMessage};
use tinychannels_runtime::Channel;
diff --git a/crates/openhuman-core/src/cron/scheduler/executor.rs b/crates/openhuman-core/src/cron/scheduler/executor.rs
index 77312ab3dc..560b13ac1f 100644
--- a/crates/openhuman-core/src/cron/scheduler/executor.rs
+++ b/crates/openhuman-core/src/cron/scheduler/executor.rs
@@ -16,12 +16,12 @@ use super::failure_classification::{
};
use crate::core::bus::BUS;
use crate::core::events::DomainEvent;
-use crate::cron::bus_host::{kind_refusal, Binding};
-use crate::cron::handlers::{kind_handler, JobRunContext};
+use crate::cron::bus_host::{Binding, kind_refusal};
+use crate::cron::handlers::{JobRunContext, kind_handler};
use std::collections::HashMap;
use std::sync::Mutex;
-use tinyflows_bus::schedule::types::{CronJob, JobType, SessionTarget};
use tinyflows_bus::schedule::Attempt;
+use tinyflows_bus::schedule::types::{CronJob, JobType, SessionTarget};
/// Run states kept before the map is cleared outright (a run whose task was
/// aborted never reaches `failed`).
diff --git a/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs b/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
index 7051a957d8..de91419a81 100644
--- a/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
+++ b/crates/openhuman-core/src/cron/scheduler/origin_delivery.rs
@@ -14,8 +14,8 @@
use super::delivery::strip_openhuman_link_markup;
use crate::config::Config;
use crate::core::runtime::DispatchCtx;
-use crate::web_chat::{publish_web_channel_event, WebChannelEvent};
-use anyhow::{anyhow, Result};
+use crate::web_chat::{WebChannelEvent, publish_web_channel_event};
+use anyhow::{Result, anyhow};
use std::path::Path;
use {
crate::cron::channel_bridge, tinyflows_bus::schedule::types::CronJob,
@@ -72,8 +72,8 @@ pub(crate) async fn append_to_origin_transcript(
append: &TranscriptAppend<'_>,
) -> Result<(), String> {
use tinyagents_session::transcript::{
- append_background_message_in, BackgroundAppend, BackgroundAppendOutcome, SessionRef,
- TranscriptMessage,
+ BackgroundAppend, BackgroundAppendOutcome, SessionRef, TranscriptMessage,
+ append_background_message_in,
};
let session = SessionRef::scoped(append.thread_id.to_string(), append.agent_id.to_string());
let options = BackgroundAppend::new(
@@ -280,11 +280,7 @@ async fn deliver_to_web_thread(
.map_err(|e| anyhow!("could not store the reply in the origin thread: {e}"))?;
publish_web_channel_event(WebChannelEvent::ProactiveMessage {
- context: crate::web_chat::event_context(
- "system",
- thread_id,
- request_id.clone(),
- ),
+ context: crate::web_chat::event_context("system", thread_id, request_id.clone()),
full_response: Some(text.to_string()),
message: None,
success: Some(true),
diff --git a/crates/openhuman-core/src/flows/ops/streaming.rs b/crates/openhuman-core/src/flows/ops/streaming.rs
index 95851269d1..69ada5945b 100644
--- a/crates/openhuman-core/src/flows/ops/streaming.rs
+++ b/crates/openhuman-core/src/flows/ops/streaming.rs
@@ -127,23 +127,25 @@ pub(super) async fn finalize_flow_stream(
.await;
}
Err(err) => {
- crate::web_chat::publish_web_channel_event(crate::web_chat::WebChannelEvent::ChatError {
- context: crate::web_chat::event_context(
- "system",
- target.thread_id.clone(),
- target.request_id.clone(),
- ),
- message: Some(err.clone()),
- error_type: Some("agent_error".to_string()),
- error_source: None,
- error_retryable: None,
- error_retry_after_ms: None,
- error_provider: None,
- error_fallback_available: None,
- copy_key: None,
- copy_params: None,
- guardrail: None,
- });
+ crate::web_chat::publish_web_channel_event(
+ crate::web_chat::WebChannelEvent::ChatError {
+ context: crate::web_chat::event_context(
+ "system",
+ target.thread_id.clone(),
+ target.request_id.clone(),
+ ),
+ message: Some(err.clone()),
+ error_type: Some("agent_error".to_string()),
+ error_source: None,
+ error_retryable: None,
+ error_retry_after_ms: None,
+ error_provider: None,
+ error_fallback_available: None,
+ copy_key: None,
+ copy_params: None,
+ guardrail: None,
+ },
+ );
}
}
// Settle this turn's snapshot now the turn is over. `attach_flow_progress_bridge`
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 c55e7aedb2..089c98ed24 100644
--- a/crates/openhuman-core/src/voice/realtime_harness/chat_delivery.rs
+++ b/crates/openhuman-core/src/voice/realtime_harness/chat_delivery.rs
@@ -3,7 +3,7 @@
//! relay.
use log::{info, warn};
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use crate::platform::socket::manager::global_socket_manager;
@@ -51,18 +51,16 @@ pub(super) fn deliver_voice_result_to_chat(
"[voice-harness] delivering deferred result to chat correlation={correlation_id} chars={} speak_back={allow_speak_back}",
spoken.chars().count()
);
- crate::web_chat::publish_web_channel_event(crate::web_chat::WebChannelEvent::ProactiveMessage {
- context: crate::web_chat::event_context(
- VOICE_CHAT_CLIENT_ID,
- VOICE_CHAT_THREAD_ID,
- "",
- ),
- full_response: Some(spoken.to_string()),
- message: None,
- success: Some(true),
- persisted_message_id: None,
- parts: None,
- });
+ crate::web_chat::publish_web_channel_event(
+ crate::web_chat::WebChannelEvent::ProactiveMessage {
+ context: crate::web_chat::event_context(VOICE_CHAT_CLIENT_ID, VOICE_CHAT_THREAD_ID, ""),
+ full_response: Some(spoken.to_string()),
+ message: None,
+ success: Some(true),
+ persisted_message_id: None,
+ parts: None,
+ },
+ );
// Speak-back: push the finished answer to the renderer's LIVE voice session so
// the agent can read it aloud. The frontend voice hook listens for `voice_speak`
@@ -71,11 +69,7 @@ pub(super) fn deliver_voice_result_to_chat(
// avoid a loop; harmless if the call already ended (nobody is subscribed).
if allow_speak_back {
crate::web_chat::publish_web_channel_event(crate::web_chat::WebChannelEvent::VoiceSpeak {
- context: crate::web_chat::event_context(
- VOICE_CHAT_CLIENT_ID,
- "",
- "",
- ),
+ context: crate::web_chat::event_context(VOICE_CHAT_CLIENT_ID, "", ""),
full_response: Some(spoken.to_string()),
success: Some(true),
});
@@ -97,20 +91,18 @@ pub(super) fn deliver_voice_failure_to_chat(correlation_id: &str) {
info!(
"[voice-harness] delivering deferred failure notice to chat correlation={correlation_id}"
);
- crate::web_chat::publish_web_channel_event(crate::web_chat::WebChannelEvent::ProactiveMessage {
- context: crate::web_chat::event_context(
- VOICE_CHAT_CLIENT_ID,
- VOICE_CHAT_THREAD_ID,
- "",
- ),
- full_response: Some(
- "Sorry — I couldn't finish that request just now. Please try again.".to_string(),
- ),
- message: None,
- success: Some(false),
- persisted_message_id: None,
- parts: None,
- });
+ crate::web_chat::publish_web_channel_event(
+ crate::web_chat::WebChannelEvent::ProactiveMessage {
+ context: crate::web_chat::event_context(VOICE_CHAT_CLIENT_ID, VOICE_CHAT_THREAD_ID, ""),
+ full_response: Some(
+ "Sorry — I couldn't finish that request just now. Please try again.".to_string(),
+ ),
+ message: None,
+ success: Some(false),
+ persisted_message_id: None,
+ parts: None,
+ },
+ );
}
pub(super) async fn emit_event(event: &str, payload: Value) {
diff --git a/crates/openhuman-core/src/web_chat/web_tests_rate_limit_classification_tests.rs b/crates/openhuman-core/src/web_chat/web_tests_rate_limit_classification_tests.rs
index b72ca387b2..b606ac8d22 100644
--- a/crates/openhuman-core/src/web_chat/web_tests_rate_limit_classification_tests.rs
+++ b/crates/openhuman-core/src/web_chat/web_tests_rate_limit_classification_tests.rs
@@ -321,7 +321,8 @@ async fn start_chat_emits_structured_rate_limit_metadata_on_chat_error_event() {
);
assert_eq!(
match recv.wire_event() {
- crate::web_chat::WebChannelEvent::ChatError { error_provider, .. } => error_provider.as_deref(),
+ crate::web_chat::WebChannelEvent::ChatError { error_provider, .. } =>
+ error_provider.as_deref(),
_ => None,
},
Some("openrouter"),
diff --git a/crates/openhuman-core/src/web_chat/web_tests_session_and_concurrency_tests.rs b/crates/openhuman-core/src/web_chat/web_tests_session_and_concurrency_tests.rs
index f73f5ec9d5..797d87a998 100644
--- a/crates/openhuman-core/src/web_chat/web_tests_session_and_concurrency_tests.rs
+++ b/crates/openhuman-core/src/web_chat/web_tests_session_and_concurrency_tests.rs
@@ -699,7 +699,10 @@ fn assert_turn_timeout(event: &crate::web_chat::ScopedWebEvent) {
assert_eq!(*error_retryable, Some(true));
let message = message.clone();
assert!(
- !message.as_deref().unwrap_or_default().contains("openhuman_turn_wall_clock_timeout"),
+ !message
+ .as_deref()
+ .unwrap_or_default()
+ .contains("openhuman_turn_wall_clock_timeout"),
"internal marker must not leak into user copy: {message:?}"
);
}