Skip to content

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

chore(threads): reorder imports and wrap long lines

Steven Enamakel44d7bba44c9a
diff --git a/crates/openhuman-core/src/agent/message_convert.rs b/crates/openhuman-core/src/agent/message_convert.rs
index 5c5b9aa778..042c758e84 100644
--- a/crates/openhuman-core/src/agent/message_convert.rs
+++ b/crates/openhuman-core/src/agent/message_convert.rs
@@ -26,8 +26,8 @@ use crate::inference::provider::ChatResponse;
use tinyagents_runtime::transcript::reasoning_from_content;
#[cfg(test)]
use tinyagents_runtime::transcript::{
- message_to_display_transcript as message_to_chat_message,
- message_to_native_transcript as message_to_native_chat_message, REASONING_EXT_KEY,
+ REASONING_EXT_KEY, message_to_display_transcript as message_to_chat_message,
+ message_to_native_transcript as message_to_native_chat_message,
};
use tinyagents_session::transcript::TranscriptMessage;
diff --git a/crates/openhuman-core/src/agent/message_convert_tests.rs b/crates/openhuman-core/src/agent/message_convert_tests.rs
index 3466bdfb32..b2829a0d93 100644
--- a/crates/openhuman-core/src/agent/message_convert_tests.rs
+++ b/crates/openhuman-core/src/agent/message_convert_tests.rs
@@ -61,18 +61,21 @@ fn durable_upload_parts_survive_message_row_replay_without_inline_payloads() {
let Message::User(user) = replay else {
panic!("user row expected")
};
- assert!(user
- .content
- .iter()
- .any(|part| matches!(part, ContentBlock::Audio(MediaRef::Path { .. }))));
- assert!(user
- .content
- .iter()
- .any(|part| matches!(part, ContentBlock::Video(MediaRef::Path { .. }))));
- assert!(user
- .content
- .iter()
- .any(|part| matches!(part, ContentBlock::Document(MediaRef::Path { .. }))));
+ assert!(
+ user.content
+ .iter()
+ .any(|part| matches!(part, ContentBlock::Audio(MediaRef::Path { .. })))
+ );
+ assert!(
+ user.content
+ .iter()
+ .any(|part| matches!(part, ContentBlock::Video(MediaRef::Path { .. })))
+ );
+ assert!(
+ user.content
+ .iter()
+ .any(|part| matches!(part, ContentBlock::Document(MediaRef::Path { .. })))
+ );
assert!(!serde_json::to_string(&row).unwrap().contains("base64"));
}
use tinyinference_llm::model::ModelRequest;
@@ -339,10 +342,12 @@ fn reasoning_content_uses_typed_thinking_block_and_round_trips_metadata() {
ContentBlock::Thinking { text, signature: None } if text == "private thoughts"
)
}));
- assert!(!assistant
- .content
- .iter()
- .any(|block| matches!(block, ContentBlock::ProviderExtension(_))));
+ assert!(
+ !assistant
+ .content
+ .iter()
+ .any(|block| matches!(block, ContentBlock::ProviderExtension(_)))
+ );
let back = message_to_chat_message(&msg).expect("assistant converts");
assert_eq!(back.content, "visible answer");
diff --git a/crates/openhuman-core/src/threads/artifact_rows_tests.rs b/crates/openhuman-core/src/threads/artifact_rows_tests.rs
index 569192e1cf..71e370a47d 100644
--- a/crates/openhuman-core/src/threads/artifact_rows_tests.rs
+++ b/crates/openhuman-core/src/threads/artifact_rows_tests.rs
@@ -150,27 +150,31 @@ async fn recording_an_artifact_twice_writes_one_row() {
let ws = temp_ws();
seed_thread(&ws, "t-1");
- assert!(record_artifact_row(
- &DispatchCtx::unbound(),
- ws.clone(),
- "t-1",
- "a",
- "A",
- Some("req-1")
- )
- .await
- .unwrap());
+ assert!(
+ record_artifact_row(
+ &DispatchCtx::unbound(),
+ ws.clone(),
+ "t-1",
+ "a",
+ "A",
+ Some("req-1")
+ )
+ .await
+ .unwrap()
+ );
// A new version, a retry or a re-delivered ready event.
- assert!(!record_artifact_row(
- &DispatchCtx::unbound(),
- ws.clone(),
- "t-1",
- "a",
- "A v2",
- Some("req-2")
- )
- .await
- .unwrap());
+ assert!(
+ !record_artifact_row(
+ &DispatchCtx::unbound(),
+ ws.clone(),
+ "t-1",
+ "a",
+ "A v2",
+ Some("req-2")
+ )
+ .await
+ .unwrap()
+ );
let rows: Vec<_> =
conversations::blocking::get_messages_with_artifact_rows(DispatchCtx::unbound(), ws, "t-1")
diff --git a/crates/openhuman-core/src/threads/attachments.rs b/crates/openhuman-core/src/threads/attachments.rs
index bc7d64bb2e..bc24e1ae0f 100644
--- a/crates/openhuman-core/src/threads/attachments.rs
+++ b/crates/openhuman-core/src/threads/attachments.rs
@@ -22,10 +22,7 @@ struct StoredAttachment {
/// Persist sanitized typed parts and their private staged paths in message
/// metadata. The public row projection strips the private path records.
-pub(crate) fn save(
- metadata: &mut Value,
- entries: Vec<(ContentPart, String)>,
-) -> Vec<ContentPart> {
+pub(crate) fn save(metadata: &mut Value, entries: Vec<(ContentPart, String)>) -> Vec<ContentPart> {
let stored = entries
.into_iter()
.map(|(part, path)| StoredAttachment { part, path })
@@ -62,7 +59,15 @@ pub(crate) fn from_staged_parts(
) -> Result<Vec<(ContentPart, String)>, String> {
let media_count = parts
.iter()
- .filter(|part| matches!(part, ContentPart::Image { .. } | ContentPart::Audio { .. } | ContentPart::Video { .. } | ContentPart::File { .. }))
+ .filter(|part| {
+ matches!(
+ part,
+ ContentPart::Image { .. }
+ | ContentPart::Audio { .. }
+ | ContentPart::Video { .. }
+ | ContentPart::File { .. }
+ )
+ })
.count();
if media_count != files.len() {
return Err("typed attachment staging did not preserve media ordering".into());
@@ -72,51 +77,82 @@ pub(crate) fn from_staged_parts(
let mut output = Vec::with_capacity(media_count);
for part in parts {
match part {
- ContentPart::Image { media, caption, alt_text } => {
+ ContentPart::Image {
+ media,
+ caption,
+ alt_text,
+ } => {
let file = files.next().expect("media count was checked");
- output.push((ContentPart::Image {
- media: stored_media(media, file),
- caption: caption.clone(),
- alt_text: alt_text.clone(),
- }, file.path.clone()));
+ output.push((
+ ContentPart::Image {
+ media: stored_media(media, file),
+ caption: caption.clone(),
+ alt_text: alt_text.clone(),
+ },
+ file.path.clone(),
+ ));
}
- ContentPart::Audio { media, codec, duration_ms, title, transcript } => {
+ ContentPart::Audio {
+ media,
+ codec,
+ duration_ms,
+ title,
+ transcript,
+ } => {
let file = files.next().expect("media count was checked");
- output.push((ContentPart::Audio {
- media: stored_media(media, file),
- codec: codec.clone(),
- duration_ms: *duration_ms,
- title: title.clone(),
- transcript: transcript.clone(),
- }, file.path.clone()));
+ output.push((
+ ContentPart::Audio {
+ media: stored_media(media, file),
+ codec: codec.clone(),
+ duration_ms: *duration_ms,
+ title: title.clone(),
+ transcript: transcript.clone(),
+ },
+ file.path.clone(),
+ ));
}
- ContentPart::Video { media, caption, duration_ms, thumbnail } => {
+ ContentPart::Video {
+ media,
+ caption,
+ duration_ms,
+ thumbnail,
+ } => {
let file = files.next().expect("media count was checked");
- output.push((ContentPart::Video {
- media: stored_media(media, file),
- caption: caption.clone(),
- duration_ms: *duration_ms,
- thumbnail: thumbnail.as_ref().map(|thumb| {
- let mut sanitized = thumb.clone();
- sanitized.path = None;
- sanitized.url = None;
- sanitized.local_cache_path = None;
- sanitized.opaque_id = None;
- sanitized
- }),
- }, file.path.clone()));
+ output.push((
+ ContentPart::Video {
+ media: stored_media(media, file),
+ caption: caption.clone(),
+ duration_ms: *duration_ms,
+ thumbnail: thumbnail.as_ref().map(|thumb| {
+ let mut sanitized = thumb.clone();
+ sanitized.path = None;
+ sanitized.url = None;
+ sanitized.local_cache_path = None;
+ sanitized.opaque_id = None;
+ sanitized
+ }),
+ },
+ file.path.clone(),
+ ));
}
- ContentPart::File { media, file_name, caption } => {
+ ContentPart::File {
+ media,
+ file_name,
+ caption,
+ } => {
let file = files.next().expect("media count was checked");
let mut stored = stored_media(media, file);
if let Some(name) = file_name {
stored.file_name = Some(name.clone());
}
- output.push((ContentPart::File {
- media: stored,
- file_name: file_name.clone(),
- caption: caption.clone(),
- }, file.path.clone()));
+ output.push((
+ ContentPart::File {
+ media: stored,
+ file_name: file_name.clone(),
+ caption: caption.clone(),
+ },
+ file.path.clone(),
+ ));
}
ContentPart::Text { .. } | ContentPart::VoiceNote { .. } => {}
_ => return Err("typed attachment has an unsupported kind".into()),
@@ -171,7 +207,10 @@ pub(crate) fn validate_opaque_parts(parts: &[ContentPart]) -> Result<(), String>
if !ids.insert(opaque_id) {
return Err("stored attachment refs must be unique".into());
}
- if let ContentPart::Video { thumbnail: Some(thumb), .. } = part
+ if let ContentPart::Video {
+ thumbnail: Some(thumb),
+ ..
+ } = part
&& (thumb.path.is_some() || thumb.url.is_some() || thumb.local_cache_path.is_some())
{
return Err("stored attachment thumbnail must not include a path or URL".into());
diff --git a/crates/openhuman-core/src/threads/attachments_tests.rs b/crates/openhuman-core/src/threads/attachments_tests.rs
index a34201a4b8..cff77adc16 100644
--- a/crates/openhuman-core/src/threads/attachments_tests.rs
+++ b/crates/openhuman-core/src/threads/attachments_tests.rs
@@ -43,9 +43,17 @@ fn public_projection_hides_paths_but_keeps_opaque_attachment_refs() {
..Default::default()
});
let mut metadata = json!({"keep": true});
- let public = save(&mut metadata, vec![(part.clone(), "uploads/thread/a.png".into())]);
+ let public = save(
+ &mut metadata,
+ vec![(part.clone(), "uploads/thread/a.png".into())],
+ );
assert_eq!(public, vec![part]);
- assert!(metadata[STORAGE_KEY][0]["path"].as_str().unwrap().contains("uploads/"));
+ assert!(
+ metadata[STORAGE_KEY][0]["path"]
+ .as_str()
+ .unwrap()
+ .contains("uploads/")
+ );
let projected = public_refs(&metadata);
assert_eq!(projected, public);
diff --git a/crates/openhuman-core/src/threads/mod.rs b/crates/openhuman-core/src/threads/mod.rs
index b23909aff7..6d7dad583e 100644
--- a/crates/openhuman-core/src/threads/mod.rs
+++ b/crates/openhuman-core/src/threads/mod.rs
@@ -18,13 +18,13 @@ pub mod turn_state;
pub mod welcome_migration;
pub mod wire_schema;
-pub use error::{ThreadsError, THREAD_NOT_FOUND_KIND};
+pub use error::{THREAD_NOT_FOUND_KIND, ThreadsError};
pub use rpc_models::*;
pub use schemas::{
all_controller_schemas as all_threads_controller_schemas,
all_registered_controllers as all_threads_registered_controllers,
};
-pub use welcome_migration::{migrate_welcome_agent_artifacts, WelcomeMigrationResult};
+pub use welcome_migration::{WelcomeMigrationResult, migrate_welcome_agent_artifacts};
/// Log prefix for thread-title generation (grep-friendly).
pub(crate) const THREAD_TITLE_LOG_PREFIX: &str = "[threads:title]";
diff --git a/crates/openhuman-core/src/threads/ops.rs b/crates/openhuman-core/src/threads/ops.rs
index acdbe92188..577add69d3 100644
--- a/crates/openhuman-core/src/threads/ops.rs
+++ b/crates/openhuman-core/src/threads/ops.rs
@@ -21,29 +21,29 @@ pub use crud::{
thread_update_labels, thread_update_title, thread_upsert, threads_list, transcript_search,
};
pub use edit::{
- edit_message, regenerate, EditMessageRequest, EditOrRegenerateResponse, RegenerateRequest,
+ EditMessageRequest, EditOrRegenerateResponse, RegenerateRequest, edit_message, regenerate,
};
pub use live_state::{
- goal_get, todos_get, ThreadGoalGetResponse, ThreadLiveStateRequest, ThreadTodosGetResponse,
+ ThreadGoalGetResponse, ThreadLiveStateRequest, ThreadTodosGetResponse, goal_get, todos_get,
};
pub use purge::threads_purge;
-pub use search::{thread_search, ThreadSearchHit, ThreadSearchRequest, ThreadSearchResponse};
+pub use search::{ThreadSearchHit, ThreadSearchRequest, ThreadSearchResponse, thread_search};
pub use title_generation::thread_generate_title;
-pub use transcript::{transcript_get, TranscriptGetRequest};
+pub use transcript::{TranscriptGetRequest, transcript_get};
pub use turn_state_ops::{
turn_state_clear, turn_state_get, turn_state_get_turn, turn_state_history, turn_state_list,
};
-pub use usage::{token_usage, SubagentUsageDto, ThreadTokenUsageRequest, ThreadTokenUsageResponse};
+pub use usage::{SubagentUsageDto, ThreadTokenUsageRequest, ThreadTokenUsageResponse, token_usage};
pub use working_dir::thread_update_working_dir;
pub(crate) use working_dir::thread_working_dir;
// 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 crate::threads::store::{ConversationMessage, ConversationThread, CreateConversationThread};
-#[cfg(test)]
use crate::threads::THREAD_TITLE_LOG_PREFIX;
#[cfg(test)]
+use crate::threads::store::{ConversationMessage, ConversationThread, CreateConversationThread};
+#[cfg(test)]
use crate::threads::{
AppendConversationMessageRequest, ConversationMessageRecord, DeleteConversationThreadRequest,
EmptyRequest, GenerateConversationThreadTitleRequest,
diff --git a/crates/openhuman-core/src/threads/ops/crud.rs b/crates/openhuman-core/src/threads/ops/crud.rs
index 49a7c71db6..0d280467eb 100644
--- a/crates/openhuman-core/src/threads/ops/crud.rs
+++ b/crates/openhuman-core/src/threads/ops/crud.rs
@@ -5,11 +5,11 @@ use super::support::{
counts, envelope, message_to_record, record_to_message, run_to_completion, thread_to_summary,
workspace_dir,
};
-use crate::core::runtime::DispatchCtx;
use crate::core::Outcome;
+use crate::core::runtime::DispatchCtx;
+use crate::threads::ThreadsError;
use crate::threads::store as conversations;
use crate::threads::store::{ConversationMessagePatch, CrossThreadHit};
-use crate::threads::ThreadsError;
use crate::threads::{
ApiEnvelope, AppendConversationMessageRequest, ConversationMessageRecord,
ConversationMessagesRequest, ConversationMessagesResponse, ConversationThreadSummary,
@@ -232,7 +232,9 @@ async fn message_append_with_config(
if !typed_attachments.is_empty()
&& (original_content.contains("[IMAGE:")
|| original_content.contains("[FILE:")
- || !crate::agent::attachments::parse(&original_content).1.is_empty())
+ || !crate::agent::attachments::parse(&original_content)
+ .1
+ .is_empty())
{
return Err(ThreadsError::Message(
"typed attachments cannot be combined with legacy attachment markers".into(),
@@ -350,22 +352,17 @@ async fn message_append_with_config(
.await
.map_err(|error| ThreadsError::Message(format!("stage user attachments: {error}")))?;
if typed_media_count > 0 {
- let (clean_content, staged_files) =
- crate::agent::attachments::parse(&staged_content);
+ let (clean_content, staged_files) = crate::agent::attachments::parse(&staged_content);
if staged_files.len() != typed_media_count {
return Err(ThreadsError::Message(
"typed attachment staging did not preserve media order".into(),
));
}
- let entries = crate::threads::attachments::from_staged_parts(
- &typed_attachments,
- &staged_files,
- )
- .map_err(ThreadsError::Message)?;
- request.message.attachments = crate::threads::attachments::save(
- &mut request.message.extra_metadata,
- entries,
- );
+ let entries =
+ crate::threads::attachments::from_staged_parts(&typed_attachments, &staged_files)
+ .map_err(ThreadsError::Message)?;
+ request.message.attachments =
+ crate::threads::attachments::save(&mut request.message.extra_metadata, entries);
request.message.content = clean_content.trim().to_string();
} else {
request.message.content = staged_content;
diff --git a/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs b/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs
index 10c7bdf58c..bcf6c589a0 100644
--- a/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs
+++ b/crates/openhuman-core/src/threads/ops/crud_message_append_tests.rs
@@ -118,47 +118,55 @@ async fn user_append_stages_original_strips_upload_bytes_and_reuses_returned_con
.await
.unwrap();
assert_eq!(persisted.len(), 2);
- assert!(!serde_json::to_string(&persisted)
- .unwrap()
- .contains("base64,"));
+ assert!(
+ !serde_json::to_string(&persisted)
+ .unwrap()
+ .contains("base64,")
+ );
}
#[tokio::test]
async fn rejected_upload_never_appends_a_message() {
let (_temp, mut config) = setup().await;
config.multimodal_files.max_files = 0;
- assert!(append_with_test_config(
- request(
- "disabled",
- "[IMAGE:data:image/png;base64,iVBORw0KGgo=]",
- "user"
- ),
- &config,
- None,
- )
- .await
- .is_err());
+ assert!(
+ append_with_test_config(
+ request(
+ "disabled",
+ "[IMAGE:data:image/png;base64,iVBORw0KGgo=]",
+ "user"
+ ),
+ &config,
+ None,
+ )
+ .await
+ .is_err()
+ );
config.multimodal_files.max_files = 3;
- assert!(append_with_test_config(
- request("bad", "[FILE:data:application/zip;base64,!]", "user"),
- &config,
- None,
- )
- .await
- .is_err());
+ assert!(
+ append_with_test_config(
+ request("bad", "[FILE:data:application/zip;base64,!]", "user"),
+ &config,
+ None,
+ )
+ .await
+ .is_err()
+ );
assert!(
append_with_test_config(request("missing", "image.png", "user"), &config, None)
.await
.is_err()
);
- assert!(conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir.clone(),
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty());
+ assert!(
+ conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir.clone(),
+ "uploads".into()
+ )
+ .await
+ .unwrap()
+ .is_empty()
+ );
}
#[tokio::test]
@@ -186,14 +194,16 @@ async fn external_origin_cannot_reuse_an_existing_attachment_marker() {
.await
.is_err()
);
- assert!(conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir,
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty());
+ assert!(
+ conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir,
+ "uploads".into()
+ )
+ .await
+ .unwrap()
+ .is_empty()
+ );
}
#[tokio::test]
@@ -262,14 +272,16 @@ async fn append_uses_host_persistence_workspace_separate_from_rpc_config() {
.await
.unwrap();
assert_eq!(persisted.len(), 1);
- assert!(conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir,
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty());
+ assert!(
+ conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir,
+ "uploads".into()
+ )
+ .await
+ .unwrap()
+ .is_empty()
+ );
}
#[tokio::test]
@@ -280,17 +292,21 @@ async fn poster_only_user_metadata_is_rejected_before_persistence() {
"attachmentNames": ["video.mp4"],
"attachmentPosters": ["data:image/png;base64,iVBORw0KGgo="]
});
- assert!(append_with_test_config(upload, &config, None)
+ assert!(
+ append_with_test_config(upload, &config, None)
+ .await
+ .is_err()
+ );
+ assert!(
+ conversations::blocking::get_messages(
+ crate::core::runtime::DispatchCtx::ambient(),
+ config.workspace_dir.clone(),
+ "uploads".into()
+ )
.await
- .is_err());
- assert!(conversations::blocking::get_messages(
- crate::core::runtime::DispatchCtx::ambient(),
- config.workspace_dir.clone(),
- "uploads".into()
- )
- .await
- .unwrap()
- .is_empty());
+ .unwrap()
+ .is_empty()
+ );
}
#[tokio::test]
@@ -353,7 +369,12 @@ async fn typed_attachment_is_staged_like_a_marker_and_leaves_the_text_clean() {
);
assert_eq!(saved.content, "look");
assert_eq!(saved.attachments.len(), 1);
- assert!(saved.extra_metadata.get("__openhumanStoredAttachments").is_none());
+ assert!(
+ saved
+ .extra_metadata
+ .get("__openhumanStoredAttachments")
+ .is_none()
+ );
let opaque_id = match &saved.attachments[0] {
ContentPart::Image { media, .. } => {
assert!(media.path.is_none());
@@ -379,9 +400,7 @@ async fn typed_attachment_is_staged_like_a_marker_and_leaves_the_text_clean() {
assert_eq!(entries[0]["part"]["media"]["opaqueId"], opaque_id);
let path = entries[0]["path"].as_str().unwrap();
assert_eq!(
- tokio::fs::read(config.action_dir.join(path))
- .await
- .unwrap(),
+ tokio::fs::read(config.action_dir.join(path)).await.unwrap(),
b"\x89PNG\r\n\x1a\n"
);
}
diff --git a/crates/openhuman-core/src/threads/ops/edit.rs b/crates/openhuman-core/src/threads/ops/edit.rs
index 924d67996b..ae52c268bb 100644
--- a/crates/openhuman-core/src/threads/ops/edit.rs
+++ b/crates/openhuman-core/src/threads/ops/edit.rs
@@ -39,19 +39,19 @@
//! turn.
use serde::{Deserialize, Serialize};
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyagents_session::transcript::{
SessionRef, SessionTranscript, TranscriptLocator, TranscriptMessage, TranscriptMeta,
TruncateCut,
};
-use crate::core::runtime::DispatchCtx;
use crate::core::Outcome;
-use crate::threads::store::{self as conversations, reply_run_id, run_reply_message_id};
+use crate::core::runtime::DispatchCtx;
use crate::threads::ThreadsError;
+use crate::threads::store::{self as conversations, reply_run_id, run_reply_message_id};
-use super::support::{transcript_store, workspace_dir, TranscriptStore};
+use super::support::{TranscriptStore, transcript_store, workspace_dir};
#[derive(Debug, Clone, Deserialize)]
#[serde(deny_unknown_fields)]
diff --git a/crates/openhuman-core/src/threads/ops/edit_turn_state_tests.rs b/crates/openhuman-core/src/threads/ops/edit_turn_state_tests.rs
index 64eb56a87e..57adf0631f 100644
--- a/crates/openhuman-core/src/threads/ops/edit_turn_state_tests.rs
+++ b/crates/openhuman-core/src/threads/ops/edit_turn_state_tests.rs
@@ -6,7 +6,7 @@
//! truncation tests do.
use super::*;
-use crate::threads::store::{self as conversations, run_reply_message_id, ConversationMessage};
+use crate::threads::store::{self as conversations, ConversationMessage, run_reply_message_id};
use serde_json::json;
use std::sync::Arc;
use tempfile::TempDir;
diff --git a/crates/openhuman-core/src/threads/ops/purge.rs b/crates/openhuman-core/src/threads/ops/purge.rs
index 550ea415b5..f2799c0b88 100644
--- a/crates/openhuman-core/src/threads/ops/purge.rs
+++ b/crates/openhuman-core/src/threads/ops/purge.rs
@@ -1,8 +1,8 @@
//! Workspace-wide conversation purge.
use super::support::{envelope, run_to_completion, workspace_dir};
-use crate::core::runtime::DispatchCtx;
use crate::core::Outcome;
+use crate::core::runtime::DispatchCtx;
use crate::threads::store as conversations;
use crate::threads::{ApiEnvelope, EmptyRequest, PurgeConversationThreadsResponse};
use std::path::PathBuf;
diff --git a/crates/openhuman-core/src/threads/ops/search.rs b/crates/openhuman-core/src/threads/ops/search.rs
index cd98401ef8..1e6e5fe5b8 100644
--- a/crates/openhuman-core/src/threads/ops/search.rs
+++ b/crates/openhuman-core/src/threads/ops/search.rs
@@ -7,8 +7,8 @@
use super::crud::transcript_search;
use super::support::envelope;
-use crate::core::runtime::DispatchCtx;
use crate::core::Outcome;
+use crate::core::runtime::DispatchCtx;
use crate::threads::ApiEnvelope;
/// Hits returned when the caller does not ask for a number.
diff --git a/crates/openhuman-core/src/threads/ops/support.rs b/crates/openhuman-core/src/threads/ops/support.rs
index 05f07b86af..0fd04ad064 100644
--- a/crates/openhuman-core/src/threads/ops/support.rs
+++ b/crates/openhuman-core/src/threads/ops/support.rs
@@ -3,11 +3,11 @@
//! store-type <-> wire-type conversions every handler needs.
use crate::config::Config;
-use crate::core::runtime::context::CoreContext;
use crate::core::runtime::DispatchCtx;
+use crate::core::runtime::context::CoreContext;
+use crate::threads::THREAD_TITLE_LOG_PREFIX;
use crate::threads::store as conversations;
use crate::threads::store::{ConversationMessage, ConversationThread};
-use crate::threads::THREAD_TITLE_LOG_PREFIX;
use crate::threads::{ConversationMessageRecord, ConversationThreadSummary};
use std::path::PathBuf;
use tinyagents_harness::title::{title_from_user_message, title_log_fingerprint};
diff --git a/crates/openhuman-core/src/threads/ops/title_generation.rs b/crates/openhuman-core/src/threads/ops/title_generation.rs
index 136f523a28..f1cd662b6c 100644
--- a/crates/openhuman-core/src/threads/ops/title_generation.rs
+++ b/crates/openhuman-core/src/threads/ops/title_generation.rs
@@ -3,12 +3,12 @@
use super::support::{counts, envelope, thread_to_summary, update_thread_with_fallback_title};
use crate::config::Config;
-use crate::core::runtime::DispatchCtx;
use crate::core::Outcome;
+use crate::core::runtime::DispatchCtx;
use crate::inference::provider;
-use crate::threads::store as conversations;
-use crate::threads::ThreadsError;
use crate::threads::THREAD_TITLE_LOG_PREFIX;
+use crate::threads::ThreadsError;
+use crate::threads::store as conversations;
use crate::threads::{
ApiEnvelope, ConversationThreadSummary, GenerateConversationThreadTitleRequest,
};
diff --git a/crates/openhuman-core/src/threads/ops/transcript.rs b/crates/openhuman-core/src/threads/ops/transcript.rs
index 52253ec857..228a4528f1 100644
--- a/crates/openhuman-core/src/threads/ops/transcript.rs
+++ b/crates/openhuman-core/src/threads/ops/transcript.rs
@@ -1,9 +1,9 @@
//! Paginated projection of a thread's settled transcript.
use super::support::{counts, envelope, transcript_store};
-use crate::core::runtime::DispatchCtx;
use crate::core::Outcome;
-use crate::threads::{store as conversations, ApiEnvelope, PaginationMeta};
+use crate::core::runtime::DispatchCtx;
+use crate::threads::{ApiEnvelope, PaginationMeta, store as conversations};
use tinyagents_session::transcript::view::DisplayItem;
/// Request for [`transcript_get`]: the thread to project, plus newest-first
diff --git a/crates/openhuman-core/src/threads/ops/transcript_tests.rs b/crates/openhuman-core/src/threads/ops/transcript_tests.rs
index 30180be306..752f002bdb 100644
--- a/crates/openhuman-core/src/threads/ops/transcript_tests.rs
+++ b/crates/openhuman-core/src/threads/ops/transcript_tests.rs
@@ -125,7 +125,7 @@ async fn write_thread(ctx: &DispatchCtx) {
#[tokio::test]
async fn transcript_projection_includes_voice_metadata_from_persisted_thread_rows() {
- use crate::threads::store::{blocking, ConversationMessage, CreateConversationThread};
+ use crate::threads::store::{ConversationMessage, CreateConversationThread, blocking};
use serde_json::json;
let dir = tempfile::tempdir().unwrap();
diff --git a/crates/openhuman-core/src/threads/ops/usage.rs b/crates/openhuman-core/src/threads/ops/usage.rs
index 42183542f1..c19f6d8623 100644
--- a/crates/openhuman-core/src/threads/ops/usage.rs
+++ b/crates/openhuman-core/src/threads/ops/usage.rs
@@ -1,8 +1,8 @@
//! Aggregated token/cost usage for a thread, re-audited at current pricing.
use super::support::{counts, envelope, transcript_store};
-use crate::core::runtime::DispatchCtx;
use crate::core::Outcome;
+use crate::core::runtime::DispatchCtx;
use crate::threads::ApiEnvelope;
use tinyagents_session::transcript::spend::thread_spend_in;
diff --git a/crates/openhuman-core/src/threads/ops/usage_tests.rs b/crates/openhuman-core/src/threads/ops/usage_tests.rs
index 1024ff8ce6..db8f2212f9 100644
--- a/crates/openhuman-core/src/threads/ops/usage_tests.rs
+++ b/crates/openhuman-core/src/threads/ops/usage_tests.rs
@@ -1,7 +1,7 @@
use super::*;
use tinyagents_harness::cost::CostSource;
-use tinyagents_session::transcript::spend::CostSplit;
use tinyagents_session::transcript::UsageCostSource;
+use tinyagents_session::transcript::spend::CostSplit;
const UNCATALOGUED: &str = "openrouter/z-ai/glm-5.3-flash";
const CATALOGUED: &str = "claude-sonnet-4-6";
diff --git a/crates/openhuman-core/src/threads/ops/working_dir.rs b/crates/openhuman-core/src/threads/ops/working_dir.rs
index 725784f57e..fe097fd374 100644
--- a/crates/openhuman-core/src/threads/ops/working_dir.rs
+++ b/crates/openhuman-core/src/threads/ops/working_dir.rs
@@ -8,11 +8,11 @@
//! in another.
use super::support::{counts, envelope, thread_to_summary, workspace_dir};
-use crate::core::runtime::DispatchCtx;
use crate::core::Outcome;
+use crate::core::runtime::DispatchCtx;
use crate::security::SecurityPolicy;
-use crate::threads::store as conversations;
use crate::threads::ThreadsError;
+use crate::threads::store as conversations;
use crate::threads::{
ApiEnvelope, ConversationThreadSummary, UpdateConversationThreadWorkingDirRequest,
};
diff --git a/crates/openhuman-core/src/threads/ops_tests.rs b/crates/openhuman-core/src/threads/ops_tests.rs
index b5a70cb205..9fc9b9d778 100644
--- a/crates/openhuman-core/src/threads/ops_tests.rs
+++ b/crates/openhuman-core/src/threads/ops_tests.rs
@@ -6,11 +6,11 @@ use super::*;
// Re-imported here rather than through `ops`: `ops` itself no longer names
// these, so importing them there would be an unused import in a non-test build.
use crate::config::test_env::EnvVarGuard;
+use crate::threads::ThreadsError;
use crate::threads::store as conversations_store;
use crate::threads::turn_state::{ClearTurnStateRequest, GetTurnStateRequest};
-use crate::threads::ThreadsError;
-use serde_json::{json, Value};
-use tinyagents_harness::title::{build_title_prompt, THREAD_TITLE_SYSTEM_PROMPT};
+use serde_json::{Value, json};
+use tinyagents_harness::title::{THREAD_TITLE_SYSTEM_PROMPT, build_title_prompt};
use tinyagents_session::turn_state::TurnState;
// ── thread_to_summary / message_to_record / record_to_message ─
diff --git a/crates/openhuman-core/src/threads/ops_title_and_cancellation_tests.rs b/crates/openhuman-core/src/threads/ops_title_and_cancellation_tests.rs
index 59656f869d..bb0b76da78 100644
--- a/crates/openhuman-core/src/threads/ops_title_and_cancellation_tests.rs
+++ b/crates/openhuman-core/src/threads/ops_title_and_cancellation_tests.rs
@@ -61,8 +61,8 @@ async fn thread_update_title_returns_error_for_missing_thread() {
/// cleanup in one spawned task, so the tail runs regardless of the caller.
#[tokio::test]
async fn run_to_completion_runs_the_tail_after_the_caller_is_dropped() {
- use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
+ use std::sync::atomic::{AtomicBool, Ordering};
let tail_ran = Arc::new(AtomicBool::new(false));
let flag = Arc::clone(&tail_ran);
diff --git a/crates/openhuman-core/src/threads/schemas/registry.rs b/crates/openhuman-core/src/threads/schemas/registry.rs
index ac62edb74c..a25494af25 100644
--- a/crates/openhuman-core/src/threads/schemas/registry.rs
+++ b/crates/openhuman-core/src/threads/schemas/registry.rs
@@ -1,8 +1,8 @@
//! Controller schema and registered-controller lists for the `threads`
//! namespace.
-use crate::core::all::RegisteredController;
use crate::core::ControllerSchema;
+use crate::core::all::RegisteredController;
use super::handlers::{
handle_create_new, handle_delete, handle_edit_message, handle_generate_title, handle_goal_get,
diff --git a/crates/openhuman-core/src/threads/schemas/schema_defs.rs b/crates/openhuman-core/src/threads/schemas/schema_defs.rs
index 2ec6724764..6962a9d697 100644
--- a/crates/openhuman-core/src/threads/schemas/schema_defs.rs
+++ b/crates/openhuman-core/src/threads/schemas/schema_defs.rs
@@ -160,8 +160,7 @@ pub(crate) fn schemas(function: &str) -> ControllerSchema {
"generate_title" => ControllerSchema {
namespace: "threads",
function: "generate_title",
- description:
- "Generate a short thread title from the first user message and assistant reply.",
+ description: "Generate a short thread title from the first user message and assistant reply.",
inputs: vec![
FieldSchema {
name: "thread_id",
@@ -172,8 +171,7 @@ pub(crate) fn schemas(function: &str) -> ControllerSchema {
FieldSchema {
name: "assistant_message",
ty: TypeSchema::Option(Box::new(TypeSchema::String)),
- comment:
- "Optional completed assistant reply to use instead of the stored first agent message.",
+ comment: "Optional completed assistant reply to use instead of the stored first agent message.",
required: false,
},
],
@@ -316,8 +314,7 @@ pub(crate) fn schemas(function: &str) -> ControllerSchema {
"turn_state_list" => ControllerSchema {
namespace: "threads",
function: "turn_state_list",
- description:
- "List every persisted turn snapshot — used to surface interrupted turns on cold boot.",
+ description: "List every persisted turn snapshot — used to surface interrupted turns on cold boot.",
inputs: vec![],
outputs: vec![FieldSchema {
name: "result",
@@ -329,8 +326,7 @@ pub(crate) fn schemas(function: &str) -> ControllerSchema {
"turn_state_history" => ControllerSchema {
namespace: "threads",
function: "turn_state_history",
- description:
- "List every persisted turn snapshot for one thread, newest first — the per-turn process history.",
+ description: "List every persisted turn snapshot for one thread, newest first — the per-turn process history.",
inputs: vec![FieldSchema {
name: "thread_id",
ty: TypeSchema::String,
@@ -406,8 +402,7 @@ pub(crate) fn schemas(function: &str) -> ControllerSchema {
"transcript_get" => ControllerSchema {
namespace: "threads",
function: "transcript_get",
- description:
- "Project a thread's settled transcript (read from the session store) into typed display items, newest-first paginated.",
+ description: "Project a thread's settled transcript (read from the session store) into typed display items, newest-first paginated.",
inputs: vec![
FieldSchema {
name: "thread_id",
@@ -438,8 +433,7 @@ pub(crate) fn schemas(function: &str) -> ControllerSchema {
"goal_get" => ControllerSchema {
namespace: "threads",
function: "goal_get",
- description:
- "Read a thread's current goal (Codex-style completion contract), or null when it has none.",
+ description: "Read a thread's current goal (Codex-style completion contract), or null when it has none.",
inputs: vec![FieldSchema {
name: "thread_id",
ty: TypeSchema::String,
@@ -473,8 +467,7 @@ pub(crate) fn schemas(function: &str) -> ControllerSchema {
"edit_message" => ControllerSchema {
namespace: "threads",
function: "edit_message",
- description:
- "Edit a past user message: cancel the thread's in-flight turn, drop that message and everything after it, and restart the turn with the new content.",
+ description: "Edit a past user message: cancel the thread's in-flight turn, drop that message and everything after it, and restart the turn with the new content.",
inputs: vec![
FieldSchema {
name: "thread_id",
@@ -517,8 +510,7 @@ pub(crate) fn schemas(function: &str) -> ControllerSchema {
"regenerate" => ControllerSchema {
namespace: "threads",
function: "regenerate",
- description:
- "Regenerate a past assistant reply (or, with no message_id, the thread's last turn): cancel the in-flight turn, drop the answer and everything after it, and restart with the same prompt.",
+ description: "Regenerate a past assistant reply (or, with no message_id, the thread's last turn): cancel the in-flight turn, drop the answer and everything after it, and restart with the same prompt.",
inputs: vec![
FieldSchema {
name: "thread_id",
@@ -549,8 +541,7 @@ pub(crate) fn schemas(function: &str) -> ControllerSchema {
"search" => ControllerSchema {
namespace: "threads",
function: "search",
- description:
- "Search message text across every thread (global search). Hits are newest first, each with a snippet around the match.",
+ description: "Search message text across every thread (global search). Hits are newest first, each with a snippet around the match.",
inputs: vec![
FieldSchema {
name: "query",
diff --git a/crates/openhuman-core/src/threads/store/backend.rs b/crates/openhuman-core/src/threads/store/backend.rs
index 065f6d3eba..7bd472f9f4 100644
--- a/crates/openhuman-core/src/threads/store/backend.rs
+++ b/crates/openhuman-core/src/threads/store/backend.rs
@@ -81,7 +81,7 @@ fn describe(error: &ConversationError, subject: Subject<'_>) -> String {
let text = inner.to_string();
match (subject.thread, subject.message) {
(Some(t), Some(m)) if text.contains("message") => {
- return format!("message {m} not found in thread {t}")
+ return format!("message {m} not found in thread {t}");
}
(Some(t), _) => return format!("thread {t} not found"),
_ => {}
diff --git a/crates/openhuman-core/src/threads/store/blocking_tests.rs b/crates/openhuman-core/src/threads/store/blocking_tests.rs
index 45e3cd5ff9..8408bb9367 100644
--- a/crates/openhuman-core/src/threads/store/blocking_tests.rs
+++ b/crates/openhuman-core/src/threads/store/blocking_tests.rs
@@ -118,8 +118,8 @@ async fn store_errors_surface_unchanged() {
/// recovers far enough to report the failure.
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn concurrent_operations_complete_without_stalling_the_single_async_worker() {
- use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
use std::sync::Arc;
+ use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
use std::time::{Duration, Instant};
const TICK_TARGET: u32 = 64;
diff --git a/crates/openhuman-core/src/threads/store/bus.rs b/crates/openhuman-core/src/threads/store/bus.rs
index 474845b173..78f144cc25 100644
--- a/crates/openhuman-core/src/threads/store/bus.rs
+++ b/crates/openhuman-core/src/threads/store/bus.rs
@@ -36,7 +36,7 @@ use tinychannels_bus::ChannelMessage;
use tinychannels_runtime::context::conversation_history_key;
use super::{
- append_message, ensure_thread, get_messages, ConversationMessage, CreateConversationThread,
+ ConversationMessage, CreateConversationThread, append_message, ensure_thread, get_messages,
};
static CONVERSATION_PERSISTENCE_HANDLE: OnceLock<SubscriptionHandle> = OnceLock::new();
diff --git a/crates/openhuman-core/src/threads/store/legacy_import.rs b/crates/openhuman-core/src/threads/store/legacy_import.rs
index b047e39961..89ee6d89df 100644
--- a/crates/openhuman-core/src/threads/store/legacy_import.rs
+++ b/crates/openhuman-core/src/threads/store/legacy_import.rs
@@ -11,7 +11,7 @@
use std::collections::BTreeMap;
use std::path::Path;
-use anyhow::{anyhow, Context, Result};
+use anyhow::{Context, Result, anyhow};
use serde::Deserialize;
use sha2::{Digest, Sha256};
use tinyagents_session::threads::{
@@ -155,7 +155,7 @@ pub(super) fn import_once(
Ok(_) => return Ok(()),
Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(()),
Err(error) => {
- return Err(anyhow::Error::new(error).context("stat the legacy threads log"))
+ return Err(anyhow::Error::new(error).context("stat the legacy threads log"));
}
}
let marked = repo.run(|docs| {
diff --git a/crates/openhuman-core/src/threads/store/legacy_import_tests.rs b/crates/openhuman-core/src/threads/store/legacy_import_tests.rs
index 2917965f4b..842e0543dc 100644
--- a/crates/openhuman-core/src/threads/store/legacy_import_tests.rs
+++ b/crates/openhuman-core/src/threads/store/legacy_import_tests.rs
@@ -157,10 +157,12 @@ fn threads_round_trip_through_the_backend_store() {
.unwrap();
assert_eq!(appended.id, "a");
assert_eq!(store.get_messages("t").unwrap().len(), 1);
- assert!(!store
- .search_cross_thread_messages("needle", 5, None)
- .unwrap()
- .is_empty());
+ assert!(
+ !store
+ .search_cross_thread_messages("needle", 5, None)
+ .unwrap()
+ .is_empty()
+ );
assert!(store.delete_thread("t", "2026-01-02T00:00:00Z").unwrap());
assert!(store.list_threads().unwrap().is_empty());
}
diff --git a/crates/openhuman-core/src/threads/store/mod.rs b/crates/openhuman-core/src/threads/store/mod.rs
index 58af866392..fcc8586e5a 100644
--- a/crates/openhuman-core/src/threads/store/mod.rs
+++ b/crates/openhuman-core/src/threads/store/mod.rs
@@ -72,15 +72,15 @@ pub(crate) use bus::claim_channel_turn;
pub(crate) use bus::persist_channel_message;
pub use bus::register_conversation_persistence_subscriber;
pub use store::{
- append_message, delete_messages_from, delete_thread, ensure_thread, list_threads,
- purge_threads, update_message, update_thread_labels, update_thread_title,
- update_thread_working_dir, ConversationStore,
+ ConversationStore, append_message, delete_messages_from, delete_thread, ensure_thread,
+ list_threads, purge_threads, update_message, update_thread_labels, update_thread_title,
+ update_thread_working_dir,
};
pub(crate) use transcript_key::bind_transcript_key;
pub use types::{
- is_deterministic_message_id, reply_run_id, run_reply_message_id, ConversationThread,
- CreateConversationThread, CrossThreadHit, ThreadMessage as ConversationMessage,
- ThreadMessagePatch as ConversationMessagePatch,
+ ConversationThread, CreateConversationThread, CrossThreadHit,
+ ThreadMessage as ConversationMessage, ThreadMessagePatch as ConversationMessagePatch,
+ is_deterministic_message_id, reply_run_id, run_reply_message_id,
};
/// A thread's messages without artifact rows. Artifact rows place artifact
diff --git a/crates/openhuman-core/src/threads/store/transcript_key.rs b/crates/openhuman-core/src/threads/store/transcript_key.rs
index 12ad20b3eb..2ed3cd7c1b 100644
--- a/crates/openhuman-core/src/threads/store/transcript_key.rs
+++ b/crates/openhuman-core/src/threads/store/transcript_key.rs
@@ -12,7 +12,7 @@
//! recorded key. A thread with no record falls back to the current rule.
use anyhow::Result;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinystoragedrivers::{CollectionSpec, ErrorKind, Filter, Precondition};
use super::backend::ConversationStore;
diff --git a/crates/openhuman-core/src/threads/store/transcript_key_tests.rs b/crates/openhuman-core/src/threads/store/transcript_key_tests.rs
index 2efe48664f..3544115b61 100644
--- a/crates/openhuman-core/src/threads/store/transcript_key_tests.rs
+++ b/crates/openhuman-core/src/threads/store/transcript_key_tests.rs
@@ -58,9 +58,11 @@ fn deleting_a_thread_forgets_its_key() {
.record_transcript_key("thread-b", "orchestrator")
.unwrap();
- assert!(store
- .delete_thread("thread-a", "2026-01-02T00:00:00Z")
- .unwrap());
+ assert!(
+ store
+ .delete_thread("thread-a", "2026-01-02T00:00:00Z")
+ .unwrap()
+ );
assert_eq!(store.transcript_key("thread-a").unwrap(), None);
assert!(store.transcript_key("thread-b").unwrap().is_some());
diff --git a/crates/openhuman-core/src/threads/transcript_host_tests.rs b/crates/openhuman-core/src/threads/transcript_host_tests.rs
index 58ba544734..fe3ce006c3 100644
--- a/crates/openhuman-core/src/threads/transcript_host_tests.rs
+++ b/crates/openhuman-core/src/threads/transcript_host_tests.rs
@@ -10,10 +10,10 @@ use std::sync::Arc;
use crate::agent::session_store::splice_fixture::memory_locator;
use tempfile::TempDir;
+use tinyagents_session::transcript::TranscriptMessage;
use tinyagents_session::transcript::view::{
- project_records, project_thread_in, DisplayItem, ToolCallStatus,
+ DisplayItem, ToolCallStatus, project_records, project_thread_in,
};
-use tinyagents_session::transcript::TranscriptMessage;
use tinyagents_session::transcript::{self, TranscriptLocator};
/// A thread's display records, read back through the store port.
diff --git a/crates/openhuman-core/src/threads/turn_state/mirror.rs b/crates/openhuman-core/src/threads/turn_state/mirror.rs
index e804ac30ef..79db4f5d3d 100644
--- a/crates/openhuman-core/src/threads/turn_state/mirror.rs
+++ b/crates/openhuman-core/src/threads/turn_state/mirror.rs
@@ -27,11 +27,11 @@ pub use observe::ObserveProgress;
#[cfg(test)]
use tinyagents_session::port::{InMemoryTurnStates, TurnStates};
#[cfg(test)]
+use tinyagents_session::turn_state::TurnStateMirror;
+#[cfg(test)]
use tinyagents_session::turn_state::mirror::MAX_PERSISTED_TRANSCRIPT_ITEM;
#[cfg(test)]
use tinyagents_session::turn_state::types::{
SubagentToolCall, SubagentTranscriptItem, ToolTimelineStatus, TranscriptItem, TurnLifecycle,
TurnPhase,
};
-#[cfg(test)]
-use tinyagents_session::turn_state::TurnStateMirror;
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 20fd51c4be..40ef5dd813 100644
--- a/crates/openhuman-core/src/threads/turn_state/mirror/observe.rs
+++ b/crates/openhuman-core/src/threads/turn_state/mirror/observe.rs
@@ -8,12 +8,12 @@
use crate::threads::turn_state::rpc_types::persisted_tool_failure;
use tinyagents_harness::progress::AgentProgress;
+use tinyagents_session::turn_state::TurnStateMirror;
use tinyagents_session::turn_state::mirror::caps::{cap_persisted_args, cap_persisted_output};
use tinyagents_session::turn_state::types::{
SubagentActivity, SubagentToolCall, SubagentTranscriptItem, ToolTimelineEntry,
ToolTimelineStatus, TurnLifecycle, TurnPhase,
};
-use tinyagents_session::turn_state::TurnStateMirror;
/// Host extension of the upstream mirror: fold one [`AgentProgress`] event into
/// the snapshot.
diff --git a/crates/openhuman-core/src/threads/welcome_migration.rs b/crates/openhuman-core/src/threads/welcome_migration.rs
index 87a7e3a207..13dcca3723 100644
--- a/crates/openhuman-core/src/threads/welcome_migration.rs
+++ b/crates/openhuman-core/src/threads/welcome_migration.rs
@@ -20,7 +20,7 @@ use std::fs;
use std::path::Path;
use crate::threads::store as conversations;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
const MIGRATION_MARKER: &str = "state/migrations/welcome_to_orchestrator_v1.done";
const WELCOME_THREAD_LABEL: &str = "onboarding";
diff --git a/crates/openhuman-core/src/threads/welcome_migration_tests.rs b/crates/openhuman-core/src/threads/welcome_migration_tests.rs
index d83cee7236..09a3928c62 100644
--- a/crates/openhuman-core/src/threads/welcome_migration_tests.rs
+++ b/crates/openhuman-core/src/threads/welcome_migration_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::threads::store::{ensure_thread, list_threads, CreateConversationThread};
+use crate::threads::store::{CreateConversationThread, ensure_thread, list_threads};
use tempfile::TempDir;
fn make_thread(id: &str, labels: Vec<String>) -> CreateConversationThread {
diff --git a/crates/openhuman-core/src/web_chat/schemas.rs b/crates/openhuman-core/src/web_chat/schemas.rs
index c416759ca0..f31e1ce00e 100644
--- a/crates/openhuman-core/src/web_chat/schemas.rs
+++ b/crates/openhuman-core/src/web_chat/schemas.rs
@@ -5,8 +5,8 @@
use crate::core::runtime::DispatchCtx;
use serde_json::{Map, Value};
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use super::ops::{
@@ -207,9 +207,7 @@ fn handle_chat(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture
let stored_parts = p
.attachments
.iter()
- .filter(|part| {
- !matches!(part, tinychannels_bus::ContentPart::VoiceNote { .. })
- })
+ .filter(|part| !matches!(part, tinychannels_bus::ContentPart::VoiceNote { .. }))
.cloned()
.collect::<Vec<_>>();
let stored_attachments = if stored_parts.is_empty() {
@@ -219,11 +217,11 @@ fn handle_chat(ctx: DispatchCtx, params: Map<String, Value>) -> ControllerFuture
None
} else {
crate::threads::attachments::validate_opaque_parts(&stored_parts)?;
- let persisted_message_id = p
- .persisted_message_id
- .clone()
- .filter(|id| !id.is_empty())
- .ok_or_else(|| "opaque media refs require persisted_message_id".to_string())?;
+ let persisted_message_id =
+ p.persisted_message_id
+ .clone()
+ .filter(|id| !id.is_empty())
+ .ok_or_else(|| "opaque media refs require persisted_message_id".to_string())?;
Some(crate::agent::queued_turn::StoredAttachmentInput {
persisted_message_id,
parts: stored_parts,