The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(storage): use local scope explicitly in storage operations
Steven Enamakel54dfdb1a6ee3
diff --git a/crates/openhuman-core/src/config/workspace/state.rs b/crates/openhuman-core/src/config/workspace/state.rsindex d09d48d5c9..327a4e55f5 100644--- a/crates/openhuman-core/src/config/workspace/state.rs+++ b/crates/openhuman-core/src/config/workspace/state.rs@@ -12,7 +12,7 @@ use anyhow::{anyhow, Context, Result};use serde::{Deserialize, Serialize};use serde_json::Value;use sha2::{Digest, Sha256};-use tinystoragedrivers::{Scope, StorageBackend, StorageConfig};+use tinystoragedrivers::{StorageBackend, StorageConfig};use tinystoragedrivers_api::KvStore;use tinystoragedrivers_types::{Cursor, Precondition};@@ -51,7 +51,7 @@ impl WatcherStateStore {fn from_backend(backend: Arc<dyn StorageBackend>) -> Result<Self> {let storage = backend- .for_scope(&Scope::local())+ .for_scope(&crate::storage::Scope::local()).map_err(anyhow::Error::from).context("open watcher scope")?;Ok(Self {diff --git a/crates/openhuman-core/src/storage/agents.rs b/crates/openhuman-core/src/storage/agents.rsindex a1b5fcf71b..0122d2f211 100644--- a/crates/openhuman-core/src/storage/agents.rs+++ b/crates/openhuman-core/src/storage/agents.rs@@ -29,7 +29,7 @@ use std::future::Future;use std::sync::{Arc, LazyLock, Mutex};use serde_json::{json, Value};-use tinystoragedrivers::{CollectionSpec, Precondition, Query, Scope};+use tinystoragedrivers::{CollectionSpec, Precondition, Query};use super::schema_support::key_of;use super::{block_on, installed, DocumentStoreExt, StorageBackend};@@ -98,7 +98,11 @@ fn record_in(backend: Arc<dyn StorageBackend>, agent: &str) {}let id = agent.to_string();let result = block_on(async move {- let docs = Arc::clone(backend.for_scope(&Scope::local())?.documents());+ let docs = Arc::clone(+ backend+ .for_scope(&super::Scope::local())?+ .documents(),+ );docs.ensure_collection(&CollectionSpec::new(AGENTS)).await?;docs.put(AGENTS,@@ -126,7 +130,11 @@ fn record_in(backend: Arc<dyn StorageBackend>, agent: &str) {/// Agent ids recorded in the backend by this or an earlier process.fn recorded(backend: Arc<dyn StorageBackend>) -> Vec<String> {let result = block_on(async move {- let docs = Arc::clone(backend.for_scope(&Scope::local())?.documents());+ let docs = Arc::clone(+ backend+ .for_scope(&super::Scope::local())?+ .documents(),+ );docs.ensure_collection(&CollectionSpec::new(AGENTS)).await?;let stored = docs.query_all(AGENTS, &Query::all()).await?;Ok(stored