Skip to content

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

chore: remove unused imports across core modules

Steven Enamakel77d2e9279882
diff --git a/crates/openhuman-core/src/agent/tinyagents/reaper.rs b/crates/openhuman-core/src/agent/tinyagents/reaper.rs
index 819a2aa312..33fe8af741 100644
--- a/crates/openhuman-core/src/agent/tinyagents/reaper.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/reaper.rs
@@ -19,7 +19,7 @@ use std::path::Path;
/// sweep visits `local` and then each known agent (`crate::storage::agents`).
pub(crate) async fn reap_orphaned_runs(workspace: &Path) -> usize {
let shared = crate::storage::installed_is_shared();
- crate::storage::agents::for_each_scope("run reaper", || reap_unless_shared(workspace, shared))
+ crate::storage::agents::for_each_scope("run reaper", |_| reap_unless_shared(workspace, shared))
.await
.into_iter()
.map(|(_, reaped)| reaped)
diff --git a/crates/openhuman-core/src/desktop/notifications/bus.rs b/crates/openhuman-core/src/desktop/notifications/bus.rs
index 54e6318d4c..5e67a9c686 100644
--- a/crates/openhuman-core/src/desktop/notifications/bus.rs
+++ b/crates/openhuman-core/src/desktop/notifications/bus.rs
@@ -492,7 +492,7 @@ async fn event_owner(
if crate::storage::installed().is_none() {
return Ok(None);
}
- let owner = crate::storage::agents::find_owner("notification owner", || async {
+ let owner = crate::storage::agents::find_owner("notification owner", |_| async {
match crate::cron::get_job(config, job_id) {
Ok(_) => Ok(true),
// tinyflows reports a missing job as `Cron job '<id>' not found`
diff --git a/crates/openhuman-core/src/flows/bus/owner.rs b/crates/openhuman-core/src/flows/bus/owner.rs
index 1800070838..fb661d59a7 100644
--- a/crates/openhuman-core/src/flows/bus/owner.rs
+++ b/crates/openhuman-core/src/flows/bus/owner.rs
@@ -62,7 +62,7 @@ async fn resolve(config: &Config, flow_id: &str) -> Result<Option<String>, Looku
Some(Ok(false)) | None => forget(flow_id),
}
}
- let Some(owner) = find_owner("flow owner", || has_flow(config, flow_id)).await? else {
+ let Some(owner) = find_owner("flow owner", |_| has_flow(config, flow_id)).await? else {
return Ok(None);
};
tracing::debug!(
diff --git a/crates/openhuman-core/src/flows/ops/run_management.rs b/crates/openhuman-core/src/flows/ops/run_management.rs
index 8f0de20789..172e1dd1ef 100644
--- a/crates/openhuman-core/src/flows/ops/run_management.rs
+++ b/crates/openhuman-core/src/flows/ops/run_management.rs
@@ -269,7 +269,7 @@ pub async fn sweep_orphaned_running_runs_on_boot(config: &Config) -> usize {
0
}
rm::BootSweepPlan::EveryScope => {
- crate::storage::agents::for_each_scope("flows boot sweep", || {
+ crate::storage::agents::for_each_scope("flows boot sweep", |_| {
sweep_orphaned_running_runs_in_scope(config)
})
.await
diff --git a/crates/openhuman-core/src/flows/ops/triggers.rs b/crates/openhuman-core/src/flows/ops/triggers.rs
index 8c4a2cffdd..d1c10a4272 100644
--- a/crates/openhuman-core/src/flows/ops/triggers.rs
+++ b/crates/openhuman-core/src/flows/ops/triggers.rs
@@ -179,7 +179,7 @@ pub async fn reconcile_schedule_triggers_on_boot(config: &Config) -> Result<(),
// that scope, where the scheduler visits them.
let mut errors = Vec::new();
for (agent, result) in
- crate::storage::agents::for_each_scope("flows schedule reconcile", || {
+ crate::storage::agents::for_each_scope("flows schedule reconcile", |_| {
reconcile_schedule_triggers_in_scope(config)
})
.await
diff --git a/crates/openhuman-core/src/integrations/task_sources/bus.rs b/crates/openhuman-core/src/integrations/task_sources/bus.rs
index 94003e11ea..a06d1645b4 100644
--- a/crates/openhuman-core/src/integrations/task_sources/bus.rs
+++ b/crates/openhuman-core/src/integrations/task_sources/bus.rs
@@ -52,8 +52,8 @@ impl EventHandler<DomainEvent> for TaskSourcesConnectionSubscriber {
// Every scope may hold sources for this toolkit (`crate::storage`):
// handle each scope as its own agent, with that agent's config.
- crate::storage::agents::for_each_live_scope("task_sources connection", || async move {
- fire_in_scope(&DispatchCtx::ambient(), provider, toolkit, connection_id).await
+ crate::storage::agents::for_each_live_scope("task_sources connection", |scope_ctx| async move {
+ fire_in_scope(&scope_ctx, provider, toolkit, connection_id).await
})
.await;
}
diff --git a/crates/openhuman-core/src/integrations/task_sources/periodic.rs b/crates/openhuman-core/src/integrations/task_sources/periodic.rs
index a98457475a..82f57c9956 100644
--- a/crates/openhuman-core/src/integrations/task_sources/periodic.rs
+++ b/crates/openhuman-core/src/integrations/task_sources/periodic.rs
@@ -101,8 +101,8 @@ async fn run_loop() {
// `local`, then every agent that keeps its sources in its own storage
// scope (`crate::storage::agents`).
for (agent, result) in
- crate::storage::agents::for_each_live_scope("task_sources", || async {
- run_one_tick(&DispatchCtx::ambient()).await
+ crate::storage::agents::for_each_live_scope("task_sources", |ctx| async move {
+ run_one_tick(&ctx).await
})
.await
{
diff --git a/crates/openhuman-core/src/security/devices/owner.rs b/crates/openhuman-core/src/security/devices/owner.rs
index 6209272052..b59ffe4338 100644
--- a/crates/openhuman-core/src/security/devices/owner.rs
+++ b/crates/openhuman-core/src/security/devices/owner.rs
@@ -150,8 +150,8 @@ pub(super) async fn owner_of(
Some(Ok(false)) | None => forget(channel_id),
}
}
- let lookups = crate::storage::agents::for_each_scope("device owner", || {
- has_live_device(&ctx, channel_id)
+ let lookups = crate::storage::agents::for_each_scope("device owner", |scope_ctx| {
+ has_live_device_in(scope_ctx, channel_id)
})
.await;
let owner = decide(lookups)?;
diff --git a/crates/openhuman-core/src/storage/blob_sweep.rs b/crates/openhuman-core/src/storage/blob_sweep.rs
index 6eb08cd3c7..f1956cd585 100644
--- a/crates/openhuman-core/src/storage/blob_sweep.rs
+++ b/crates/openhuman-core/src/storage/blob_sweep.rs
@@ -100,7 +100,7 @@ pub(crate) async fn sweep_profiles(backend: &dyn StorageBackend, profile_ids: &[
/// Agent scopes are enumerated from the installed backend (the only caller,
/// [`sweep_installed`], passes that one).
pub async fn sweep_all(backend: Arc<dyn StorageBackend>) -> u64 {
- let scoped: u64 = super::agents::for_each_scope("blob sweep", || {
+ let scoped: u64 = super::agents::for_each_scope("blob sweep", |_| {
let backend = Arc::clone(&backend);
async move {
match super::current_scope() {