Skip to content

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

refactor(core): use anyhow for async block execution

Steven Enamakel1c4fe58564c1
diff --git a/crates/openhuman-core/src/config/workspace/state.rs b/crates/openhuman-core/src/config/workspace/state.rs
index 327a4e55f5..d2ec48df08 100644
--- a/crates/openhuman-core/src/config/workspace/state.rs
+++ b/crates/openhuman-core/src/config/workspace/state.rs
@@ -79,7 +79,7 @@ impl WatcherStateStore {
let path = path.to_string_lossy().into_owned();
let key = key_for(&path);
let kv = Arc::clone(&self.kv);
- crate::storage::block_on(async move {
+ crate::storage::block_on_anyhow(async move {
loop {
let current = kv.get(&key).await?;
let (mtime_secs, expected) = match current {
@@ -126,7 +126,7 @@ impl WatcherStateStore {
/// Load every non-deleted state in stable key order.
pub fn load_all(&self) -> Result<Vec<FileState>> {
let kv = Arc::clone(&self.kv);
- crate::storage::block_on(async move {
+ crate::storage::block_on_anyhow(async move {
let mut cursor: Option<Cursor> = None;
let mut states = Vec::new();
loop {
diff --git a/crates/openhuman-core/src/storage/layout/legacy.rs b/crates/openhuman-core/src/storage/layout/legacy.rs
index c933c1fff6..0672c171bf 100644
--- a/crates/openhuman-core/src/storage/layout/legacy.rs
+++ b/crates/openhuman-core/src/storage/layout/legacy.rs
@@ -139,11 +139,11 @@ pub async fn migrate(target: &Target) -> Result<(), LayoutError> {
.await
.map_err(|e| LayoutError::Other(anyhow::anyhow!("schema migration: {e}")))?;
drop(backend);
- if let Some((scope, step, message)) = report.failures.first() {
- return Err(LayoutError::Other(anyhow::anyhow!(
- "schema migration failed in scope {scope} step {step}: {message}"
- )));
- }
+ log::debug!(
+ scopes = report.scopes,
+ collections = report.collections,
+ "[storage::layout] owner collections prepared"
+ );
if db.is_file() {
super::db::checkpoint(&db)?;
}