Skip to content

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

fix(storage): fall back to workspace backend when no host backend installed

Steven Enamakelc7a5adbfa9f0
diff --git a/crates/openhuman-core/src/modules/storage_host.rs b/crates/openhuman-core/src/modules/storage_host.rs
index 351582e567..12440c6501 100644
--- a/crates/openhuman-core/src/modules/storage_host.rs
+++ b/crates/openhuman-core/src/modules/storage_host.rs
@@ -599,7 +599,16 @@ impl CallerDirectory for Live {
#[async_trait]
impl Environment for Live {
fn backend(&self) -> Option<Arc<dyn StorageBackend>> {
- crate::storage::installed()
+ // A host that installed a backend (the app, or an embedder that passed
+ // one) wins. An embedder that did not gets the workspace default every
+ // other store already opens for itself ([`crate::storage::backend_for`]),
+ // so a module is not the one consumer left with no storage.
+ crate::storage::installed().or_else(|| {
+ let workspace = crate::core::runtime::DispatchCtx::ambient()
+ .workspace_dir()
+ .ok()?;
+ crate::storage::backend_for(&workspace).ok()
+ })
}
fn module_scope(&self, module_id: &str) -> Result<Scope, StorageError> {