Skip to content

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

refactor(core): clean up imports and assertions

Steven Enamakel0073c4af68e7
diff --git a/crates/openhuman-core/src/inference/host_runtime/ops.rs b/crates/openhuman-core/src/inference/host_runtime/ops.rs
index 8dd82040a2..592d3cf2d5 100644
--- a/crates/openhuman-core/src/inference/host_runtime/ops.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/ops.rs
@@ -15,10 +15,10 @@ mod turn_guards;
pub(crate) use agent_chat::agent_chat_for_with_turn_model_source;
pub use agent_chat::{
- AgentChatEnv, AgentChatReply, AgentChatTarget, agent_chat, agent_chat_for,
- agent_chat_reply_for, agent_chat_simple,
+ agent_chat, agent_chat_for, agent_chat_reply_for, agent_chat_simple, AgentChatEnv,
+ AgentChatReply, AgentChatTarget,
};
-pub use complete_once::{CompletionEndpoint, complete_once};
+pub use complete_once::{complete_once, CompletionEndpoint};
pub use runtime_ops::{
local_ai_prompt, local_ai_status, local_ai_summarize, local_ai_transcribe,
local_ai_transcribe_bytes, local_ai_tts, local_ai_vision_prompt,
diff --git a/crates/openhuman-core/src/triage/escalation.rs b/crates/openhuman-core/src/triage/escalation.rs
index 7a150a3aef..9c5f58d3fa 100644
--- a/crates/openhuman-core/src/triage/escalation.rs
+++ b/crates/openhuman-core/src/triage/escalation.rs
@@ -14,7 +14,7 @@
//! creating child-task lifecycle records.
use crate::core::runtime::DispatchCtx;
-use anyhow::{Context, anyhow};
+use anyhow::{anyhow, Context};
use crate::agent::harness::fork_context::ParentExecutionContext;
use crate::agent::orchestration::parent_context::build_root_parent;
diff --git a/crates/openhuman-core/src/triage/escalation_model_tests.rs b/crates/openhuman-core/src/triage/escalation_model_tests.rs
index d6e66c08f4..4eaf5336f4 100644
--- a/crates/openhuman-core/src/triage/escalation_model_tests.rs
+++ b/crates/openhuman-core/src/triage/escalation_model_tests.rs
@@ -171,11 +171,9 @@ async fn react_dispatch_keeps_routing_without_creating_child_lifecycle_records()
.map(|tool| tool.name.as_str())
.collect();
assert!(tool_names.contains(&"read_workspace_state"));
- assert!(
- !tool_names
- .iter()
- .any(|name| { *name == "spawn_subagent" || name.starts_with("delegate_") })
- );
+ assert!(!tool_names
+ .iter()
+ .any(|name| { *name == "spawn_subagent" || name.starts_with("delegate_") }));
assert!(!tool_names.contains(&"shell"));
assert!(!tool_names.contains(&"file_write"));
drop(requests);
@@ -295,13 +293,11 @@ async fn direct_turn_model_source_metadata_probe_does_not_duplicate_egress_discl
requests[0].1, model_marker,
"the expected model served the turn"
);
- assert!(
- requests[0]
- .2
- .messages
- .iter()
- .any(|message| { message.text().contains("send this trigger reply") })
- );
+ assert!(requests[0]
+ .2
+ .messages
+ .iter()
+ .any(|message| { message.text().contains("send this trigger reply") }));
drop(requests);
let sentinel = "triage-direct-source-egress-sentinel";
BUS.publish(crate::core::events::DomainEvent::ExternalTransferPending {
@@ -497,12 +493,13 @@ async fn escalate_dispatch_preserves_orchestrator_tools_without_child_delegation
.iter()
.map(|tool| tool.name.as_str())
.collect();
- assert!(tool_names.contains(&"grep"), "the orchestrator keeps its advertised coding tool");
assert!(
- !tool_names
- .iter()
- .any(|name| { *name == "spawn_subagent" || name.starts_with("delegate_") })
+ tool_names.contains(&"grep"),
+ "the orchestrator keeps its advertised coding tool"
);
+ assert!(!tool_names
+ .iter()
+ .any(|name| { *name == "spawn_subagent" || name.starts_with("delegate_") }));
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/triage/escalation_tests.rs b/crates/openhuman-core/src/triage/escalation_tests.rs
index 0d5a97789f..f468158cd0 100644
--- a/crates/openhuman-core/src/triage/escalation_tests.rs
+++ b/crates/openhuman-core/src/triage/escalation_tests.rs
@@ -2,7 +2,7 @@ use super::*;
use crate::agent_registry::host_definition::AgentDefinitionRegistry;
use crate::core::events::DomainEvent;
use serde_json::json;
-use tokio::time::{Duration, sleep, timeout};
+use tokio::time::{sleep, timeout, Duration};
/// The triage parent is the shared root context with one override: nested
/// spawns scoped to the dispatched target. Guards the #4369 collapse against
diff --git a/tests/composio_list_tools_stack_overflow_regression.rs b/tests/composio_list_tools_stack_overflow_regression.rs
index 4bcef71e7f..e2070e006e 100644
--- a/tests/composio_list_tools_stack_overflow_regression.rs
+++ b/tests/composio_list_tools_stack_overflow_regression.rs
@@ -440,10 +440,8 @@ async fn drive_subagent() {
2,
"the model must continue after the tool result"
);
- assert!(
- tool_output
- .lock()
- .as_deref()
- .is_some_and(|output| output.contains("composio is disabled"))
- );
+ assert!(tool_output
+ .lock()
+ .as_deref()
+ .is_some_and(|output| output.contains("composio is disabled")));
}