Skip to content

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

fix(agent): satisfy migrated runtime clippy

Steven Enamakeldb516f29839d
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/scout_run.rs b/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/scout_run.rs
index 8f7bc4deb5..b83a96c07b 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/scout_run.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/agent_prepare_context/scout_run.rs
@@ -514,7 +514,7 @@ pub(super) async fn run_context_scout_with_catalog_and_workspace(
&outcome.task_id,
&outcome.agent_id,
None,
- &question,
+ question,
checkpoint.is_some(),
),
))
diff --git a/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs b/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
index c0f5960f67..66d90c78df 100644
--- a/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver/grounded_close.rs
@@ -224,9 +224,11 @@ async fn completion(
ModelStreamItem::MessageDelta(delta) => buffered.push_str(&delta.text),
ModelStreamItem::Completed(response) => {
let text = response.text();
- let selected = (!text.trim().is_empty())
- .then_some(text)
- .unwrap_or(buffered);
+ let selected = if !text.trim().is_empty() {
+ text
+ } else {
+ buffered
+ };
return (
selected,
crate::agent::tinyagents::model::usage_info_from_response(&response),
diff --git a/crates/openhuman-core/src/agent/session_host/hooks.rs b/crates/openhuman-core/src/agent/session_host/hooks.rs
index 22e7688642..ffa7d2bf97 100644
--- a/crates/openhuman-core/src/agent/session_host/hooks.rs
+++ b/crates/openhuman-core/src/agent/session_host/hooks.rs
@@ -15,6 +15,7 @@ use crate::agent::tinyagents::host::OpenHumanRunContext;
/// The runtime makes the durable commit before `after_commit` and guarantees a
/// single terminal callback. OpenHuman adapters use these points for progress,
/// BUS projection, memory/experience work and usage finalization.
+#[allow(clippy::type_complexity)]
pub struct OpenHumanSessionHooks {
before_resume: Arc<
dyn for<'a> Fn(
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session.rs b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
index 5d2abb05e6..34416ed2c2 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session.rs
@@ -137,6 +137,7 @@ struct OpenHumanTurnPreludeMutable {
}
impl OpenHumanTurnPrelude {
+ #[allow(clippy::type_complexity)]
fn current_tool_source(
&self,
) -> (
@@ -366,7 +367,6 @@ impl OpenHumanTurnPrelude {
.lock()
.unwrap_or_else(std::sync::PoisonError::into_inner)
.build_system_prompt(&context)
- .map_err(Into::into)
}
async fn refresh_cold_integrations(&self) {
@@ -1569,7 +1569,7 @@ impl OpenHumanSessionHost {
.unwrap_or_else(|poisoned| poisoned.into_inner())
.prelude
.clone();
- let prelude = prelude.ok_or_else(|| {
+ let prelude = prelude.ok_or({
tinyagents_runtime::RuntimeError::MissingDependency(
"OpenHumanTurnPrelude",
)
@@ -1643,7 +1643,7 @@ impl OpenHumanSessionHost {
.unwrap_or_else(|poisoned| poisoned.into_inner())
.context_middleware
.clone()
- .ok_or_else(|| {
+ .ok_or({
tinyagents_runtime::RuntimeError::MissingDependency(
"TurnContextMiddleware",
)
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
index f88c2ee9aa..0b09c333f5 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
@@ -647,6 +647,7 @@ impl OpenHumanPersistence {
.map_err(|error| SubagentError::Persistence(error.to_string()))?;
let file = OpenOptions::new()
.create(true)
+ .truncate(false)
.read(true)
.write(true)
.open(path)
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
index 2b0b2dfdae..18c332cc00 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/turn_context.rs
@@ -291,17 +291,18 @@ impl Middleware<(), crate::agent::tinyagents::host::OpenHumanRunContext>
guard.input_tokens += usage.input_tokens;
guard.output_tokens += usage.output_tokens;
guard.cached_input_tokens += usage.cache_read_tokens;
- let host_usage =
- crate::agent::tinyagents::model::usage_info_from_response(response)
- .unwrap_or_else(|| crate::inference::provider::UsageInfo {
- input_tokens: usage.input_tokens,
- output_tokens: usage.output_tokens,
- context_window: 0,
- cached_input_tokens: usage.cache_read_tokens,
- cache_creation_tokens: usage.cache_creation_tokens,
- reasoning_tokens: usage.reasoning_tokens,
- charged_amount_usd: 0.0,
- });
+ let host_usage = crate::agent::tinyagents::model::usage_info_from_response(
+ response,
+ )
+ .unwrap_or(crate::inference::provider::UsageInfo {
+ input_tokens: usage.input_tokens,
+ output_tokens: usage.output_tokens,
+ context_window: 0,
+ cached_input_tokens: usage.cache_read_tokens,
+ cache_creation_tokens: usage.cache_creation_tokens,
+ reasoning_tokens: usage.reasoning_tokens,
+ charged_amount_usd: 0.0,
+ });
// Use the host's per-call pricing helper whenever the provider
// omitted an authoritative amount. `route` is preferred over a
// construction-time model because it preserves fallback pricing.
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
index b2352df296..ce333b663b 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_runner.rs
@@ -671,7 +671,7 @@ async fn run_turn_via_tinyagents_inner(
..
}) = run_context.origin.as_ref()
{
- journal::register_request_journal_run(&request_id, journal_run_id.as_str());
+ journal::register_request_journal_run(request_id, journal_run_id.as_str());
}
}