Skip to content

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

refactor(core): update storage and utility function signatures

Steven Enamakel575f949c4a96
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs
index 1d10910906..b4df1624e4 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents.rs
@@ -233,7 +233,7 @@ impl Docs {
let id = key_of(subagent_session_id)?;
let updated = self.0.run(|docs| async move {
crate::storage::documents::update_document(&docs, SESSIONS, &id, move |current| {
- let stored: StoredSession = serde_json::from_value(current)
+ let stored: StoredSession = serde_json::from_value(current.clone())
.map_err(|error| crate::storage::StorageError::backend(error.to_string()))?;
let mut session = DurableSubagentSession::from(stored);
if !update(&mut session, chrono::Utc::now().to_rfc3339()) {
diff --git a/crates/openhuman-core/src/desktop/notifications/store_documents.rs b/crates/openhuman-core/src/desktop/notifications/store_documents.rs
index ef3d77e8f2..3010bd8d51 100644
--- a/crates/openhuman-core/src/desktop/notifications/store_documents.rs
+++ b/crates/openhuman-core/src/desktop/notifications/store_documents.rs
@@ -235,10 +235,10 @@ async fn claim_content(
.and_then(Value::as_i64);
if skip_recent && last.is_some_and(|last| last >= window_start) {
previous = None;
- return Ok(None);
+ return None;
}
previous = Some(last);
- Ok(Some(json!({ "last_ms": now_ms })))
+ Some(json!({ "last_ms": now_ms }))
})
.await?;
Ok(previous)
diff --git a/crates/openhuman-core/src/inbound/settings.rs b/crates/openhuman-core/src/inbound/settings.rs
index a28aedbc14..a00ab649ae 100644
--- a/crates/openhuman-core/src/inbound/settings.rs
+++ b/crates/openhuman-core/src/inbound/settings.rs
@@ -167,7 +167,7 @@ pub fn module_config(config: &Config) -> Value {
}
};
tracing::debug!(
- queues = resolved.manifest.queues.len(),
+ queues = resolved.manifest.queues().len(),
backend = %resolved.backend,
"[inbound] configuring the tinyeventqueues module"
);
diff --git a/crates/openhuman-core/src/integrations/composio/file_store_documents.rs b/crates/openhuman-core/src/integrations/composio/file_store_documents.rs
index e146f5a1cf..2008622c5d 100644
--- a/crates/openhuman-core/src/integrations/composio/file_store_documents.rs
+++ b/crates/openhuman-core/src/integrations/composio/file_store_documents.rs
@@ -33,7 +33,7 @@ use tinystoragedrivers_types::{Capability, CollectionSpec, Query, StorageError};
use crate::storage::documents::Repo;
use crate::storage::import_state;
-use crate::storage::{Storage, state_kv::StateKv};
+use crate::storage::{DocumentStoreExt, Storage, state_kv::StateKv};
/// The `tsd.kv` owner and namespace of the state values.
const KV_OWNER: &str = "composio";
diff --git a/crates/openhuman-core/src/modules/site_memory_host.rs b/crates/openhuman-core/src/modules/site_memory_host.rs
index 3f3ee583d9..3deb65543e 100644
--- a/crates/openhuman-core/src/modules/site_memory_host.rs
+++ b/crates/openhuman-core/src/modules/site_memory_host.rs
@@ -74,7 +74,7 @@ impl SiteStore {
let kv = crate::storage::state_kv::StateKv::open(workspace, "computer", "site_memory")
.map_err(storage_error)?;
let legacy = sites_dir(workspace);
- kv.import_once("sites_dir", || import_legacy(&kv, &legacy))
+ kv.import_once("sites_dir", |_| import_legacy(&kv, &legacy))
.map_err(storage_error)?;
Ok(Self { kv })
}
diff --git a/crates/openhuman-core/src/skills/run_log.rs b/crates/openhuman-core/src/skills/run_log.rs
index 4eabfe8dc0..c5a6e71f55 100644
--- a/crates/openhuman-core/src/skills/run_log.rs
+++ b/crates/openhuman-core/src/skills/run_log.rs
@@ -169,7 +169,7 @@ pub fn read_run_log_slice(
let store = run_log_store(workspace).map_err(io_error)?;
crate::storage::block_on(async move {
store
- .read_slice(id, offset, max_bytes)
+ .read_slice(&id, offset, max_bytes)
.await
.map_err(|error| StorageError::backend(error.to_string()))
})