Skip to content

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

chore: reorder imports and test module declarations for consistency

Steven Enamakel89eb046d1307
diff --git a/crates/openhuman-core/src/skills/ops_install/fetch.rs b/crates/openhuman-core/src/skills/ops_install/fetch.rs
index 90980c598f..a6c30b2d74 100644
--- a/crates/openhuman-core/src/skills/ops_install/fetch.rs
+++ b/crates/openhuman-core/src/skills/ops_install/fetch.rs
@@ -8,10 +8,10 @@ use serde::{Deserialize, Serialize};
use super::super::ops_discover::{discover_workflows_inner, is_workspace_trusted};
use super::super::ops_parse::parse_workflow_md_str;
use super::super::ops_types::SKILL_MD;
+use super::url_validation::{is_loopback_http_url, read_allow_local_http_env};
use super::url_validation::{
normalize_install_url, validate_install_url_with_config, validate_resolved_host,
};
-use super::url_validation::{is_loopback_http_url, read_allow_local_http_env};
/// Strip userinfo, query, and fragment from a URL for safe inclusion in
/// observability tags. Returns `<scheme>://<host>[:<port>]<path>` on success,
diff --git a/crates/openhuman-core/src/skills/ops_tests.rs b/crates/openhuman-core/src/skills/ops_tests.rs
index f34cd29b3c..479aa6ecbe 100644
--- a/crates/openhuman-core/src/skills/ops_tests.rs
+++ b/crates/openhuman-core/src/skills/ops_tests.rs
@@ -36,9 +36,9 @@ fn make_legacy_skill(ws: &Path, name: &str) -> PathBuf {
skill_dir
}
-#[path = "ops_discovery_tests.rs"]
-mod discovery_tests;
#[path = "ops_create_and_url_tests.rs"]
mod create_and_url_tests;
+#[path = "ops_discovery_tests.rs"]
+mod discovery_tests;
#[path = "ops_uninstall_tests.rs"]
mod uninstall_tests;
diff --git a/crates/openhuman-core/src/threads/ops.rs b/crates/openhuman-core/src/threads/ops.rs
index 0546277961..48e983d8f6 100644
--- a/crates/openhuman-core/src/threads/ops.rs
+++ b/crates/openhuman-core/src/threads/ops.rs
@@ -27,16 +27,20 @@ pub use usage::{token_usage, SubagentUsageDto, ThreadTokenUsageRequest, ThreadTo
// Test-only re-exports so `use super::*;` in the split-out test modules below
// keeps resolving the shared helpers that now live in `support`.
#[cfg(test)]
-use support::{
- counts, envelope, message_to_record, record_to_message, request_id, run_to_completion,
- thread_to_summary,
+use crate::memory::conversations::{
+ ConversationMessage, ConversationThread, CreateConversationThread,
};
#[cfg(test)]
-use crate::memory::conversations::{ConversationMessage, ConversationThread, CreateConversationThread};
-#[cfg(test)]
use crate::memory::{
AppendConversationMessageRequest, ConversationMessageRecord, DeleteConversationThreadRequest,
EmptyRequest, GenerateConversationThreadTitleRequest, PaginationMeta,
};
#[cfg(test)]
-use crate::threads::title::{is_auto_generated_thread_title, title_from_user_message, THREAD_TITLE_LOG_PREFIX};
+use crate::threads::title::{
+ is_auto_generated_thread_title, title_from_user_message, THREAD_TITLE_LOG_PREFIX,
+};
+#[cfg(test)]
+use support::{
+ counts, envelope, message_to_record, record_to_message, request_id, run_to_completion,
+ thread_to_summary,
+};
diff --git a/crates/openhuman-core/src/threads/ops/crud.rs b/crates/openhuman-core/src/threads/ops/crud.rs
index e516563f98..39420cc5ca 100644
--- a/crates/openhuman-core/src/threads/ops/crud.rs
+++ b/crates/openhuman-core/src/threads/ops/crud.rs
@@ -280,9 +280,8 @@ async fn thread_delete_inner(
// nowhere left to deliver to — abort + cleanup is the whole behavior.
let cancelled =
crate::agent::orchestration::running_subagents::cancel_for_thread(&request.thread_id);
- let discarded = crate::agent::orchestration::background_completions::discard_for_thread(
- &request.thread_id,
- );
+ let discarded =
+ crate::agent::orchestration::background_completions::discard_for_thread(&request.thread_id);
log::debug!(
"[threads] thread_delete thread_id={} cancelled_subagents={} discarded_completions={}",
request.thread_id,
diff --git a/crates/openhuman-core/src/threads/ops/support.rs b/crates/openhuman-core/src/threads/ops/support.rs
index bbe5f4a312..4e6f307d5b 100644
--- a/crates/openhuman-core/src/threads/ops/support.rs
+++ b/crates/openhuman-core/src/threads/ops/support.rs
@@ -4,13 +4,15 @@
use crate::config::Config;
use crate::core::runtime::context::CoreContext;
+use crate::memory::conversations;
+use crate::memory::conversations::{ConversationMessage, ConversationThread};
use crate::memory::{
ApiEnvelope, ApiMeta, ConversationMessageRecord, ConversationThreadSummary, PaginationMeta,
};
-use crate::memory::conversations;
-use crate::memory::conversations::{ConversationMessage, ConversationThread};
use crate::rpc::RpcOutcome;
-use crate::threads::title::{title_from_user_message, title_log_fingerprint, THREAD_TITLE_LOG_PREFIX};
+use crate::threads::title::{
+ title_from_user_message, title_log_fingerprint, THREAD_TITLE_LOG_PREFIX,
+};
use serde::Serialize;
use std::collections::BTreeMap;
use std::path::PathBuf;
diff --git a/crates/openhuman-core/src/threads/ops/title_generation.rs b/crates/openhuman-core/src/threads/ops/title_generation.rs
index 3f0ffbc700..4a02a5ff48 100644
--- a/crates/openhuman-core/src/threads/ops/title_generation.rs
+++ b/crates/openhuman-core/src/threads/ops/title_generation.rs
@@ -5,7 +5,9 @@ use super::support::{counts, envelope, thread_to_summary, update_thread_with_fal
use crate::config::Config;
use crate::inference::provider;
use crate::memory::conversations;
-use crate::memory::{ApiEnvelope, ConversationThreadSummary, GenerateConversationThreadTitleRequest};
+use crate::memory::{
+ ApiEnvelope, ConversationThreadSummary, GenerateConversationThreadTitleRequest,
+};
use crate::rpc::RpcOutcome;
use crate::threads::title::{
build_title_request, is_auto_generated_thread_title, sanitize_generated_title,
diff --git a/crates/openhuman-core/src/threads/schemas.rs b/crates/openhuman-core/src/threads/schemas.rs
index 1afe5d0336..a48578da82 100644
--- a/crates/openhuman-core/src/threads/schemas.rs
+++ b/crates/openhuman-core/src/threads/schemas.rs
@@ -10,15 +10,15 @@ mod schema_defs;
pub use registry::{all_controller_schemas, all_registered_controllers};
-#[cfg(test)]
-pub(crate) use schema_defs::schemas;
-#[cfg(test)]
-use handlers::{handle_task_board_get, handle_task_board_put, parse};
-#[cfg(test)]
-use serde_json::{Map, Value};
#[cfg(test)]
use crate::memory::{
AppendConversationMessageRequest, ConversationMessagesRequest, DeleteConversationThreadRequest,
EmptyRequest, GenerateConversationThreadTitleRequest, UpdateConversationMessageRequest,
UpsertConversationThreadRequest,
};
+#[cfg(test)]
+use handlers::{handle_task_board_get, handle_task_board_put, parse};
+#[cfg(test)]
+pub(crate) use schema_defs::schemas;
+#[cfg(test)]
+use serde_json::{Map, Value};
diff --git a/crates/openhuman-core/src/threads/turn_state/mirror.rs b/crates/openhuman-core/src/threads/turn_state/mirror.rs
index fd8fa7879d..b7aca1f72d 100644
--- a/crates/openhuman-core/src/threads/turn_state/mirror.rs
+++ b/crates/openhuman-core/src/threads/turn_state/mirror.rs
@@ -25,8 +25,6 @@ mod state;
pub use state::TurnStateMirror;
-#[cfg(test)]
-pub(crate) use caps::MAX_PERSISTED_TRANSCRIPT_ITEM;
#[cfg(test)]
use super::store::TurnStateStore;
#[cfg(test)]
@@ -34,3 +32,5 @@ use super::types::{
SubagentToolCall, SubagentTranscriptItem, ToolTimelineStatus, TranscriptItem, TurnLifecycle,
TurnPhase,
};
+#[cfg(test)]
+pub(crate) use caps::MAX_PERSISTED_TRANSCRIPT_ITEM;
diff --git a/crates/openhuman-core/src/threads/turn_state/mirror/observe.rs b/crates/openhuman-core/src/threads/turn_state/mirror/observe.rs
index e9a330f4ce..d8b34bfafb 100644
--- a/crates/openhuman-core/src/threads/turn_state/mirror/observe.rs
+++ b/crates/openhuman-core/src/threads/turn_state/mirror/observe.rs
@@ -526,7 +526,13 @@ impl TurnStateMirror {
/// one entry (mirrors the frontend `appendSubagentStreamDelta`). Mutate-
/// only (no flush) — high-frequency like the parent's `TextDelta`; the
/// accumulated prose is persisted at the next sub-agent tool boundary.
- fn push_subagent_prose(&mut self, task_id: &str, iteration: u32, delta: &str, is_thinking: bool) {
+ fn push_subagent_prose(
+ &mut self,
+ task_id: &str,
+ iteration: u32,
+ delta: &str,
+ is_thinking: bool,
+ ) {
let Some(entry) = self.find_subagent_entry_mut(task_id) else {
return;
};
diff --git a/crates/openhuman-core/src/threads/turn_state/mirror_tests.rs b/crates/openhuman-core/src/threads/turn_state/mirror_tests.rs
index 0ba6cf4bf2..b4f34c16de 100644
--- a/crates/openhuman-core/src/threads/turn_state/mirror_tests.rs
+++ b/crates/openhuman-core/src/threads/turn_state/mirror_tests.rs
@@ -44,7 +44,7 @@ fn seed_root_transcript(workspace: &std::path::Path, thread_id: &str) -> std::pa
path
}
-#[path = "mirror_observe_tests.rs"]
-mod observe_tests;
#[path = "mirror_finish_and_subagent_args_tests.rs"]
mod finish_and_subagent_args_tests;
+#[path = "mirror_observe_tests.rs"]
+mod observe_tests;