Skip to content

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

fix(embed): report retained storage driver in runtime info

Steven Enamakele65a3aac57fd
diff --git a/crates/openhuman-embed/src/runtime/build.rs b/crates/openhuman-embed/src/runtime/build.rs
index 305e6a59c6..ff77260bca 100644
--- a/crates/openhuman-embed/src/runtime/build.rs
+++ b/crates/openhuman-embed/src/runtime/build.rs
@@ -159,10 +159,6 @@ impl RuntimeBuilder {
// build cannot undo (the stored API key, the host memory engine), so
// a refused controller extension leaves neither behind. Restorable
// seams are undone by this guard if the boot below fails.
- let mut storage_info = super::StorageInfo::describe(
- self.seams.storage.as_ref(),
- config.as_ref().unwrap_or(&Config::default()),
- );
let mut host_seams = std::mem::take(&mut self.seams);
if host_seams.storage.is_none() {
if let Some(config) = &config {
@@ -179,6 +175,11 @@ impl RuntimeBuilder {
if host_seams.storage.is_none() && matches!(self.workspace, Workspace::Stateless) {
host_seams.storage = Some(super::StorageSource::Url("memory".into()));
}
+ let mut storage_info = super::StorageInfo::describe(
+ host_seams.storage.as_ref(),
+ config.as_ref().unwrap_or(&Config::default()),
+ host_seams.storage_driver.as_deref(),
+ );
validate_storage_feature(host_seams.storage.as_ref())?;
host_seams
.open_storage()
@@ -189,10 +190,13 @@ impl RuntimeBuilder {
_ => None,
};
if self.session_store.is_none() {
- if let Some(backend) = &storage_backend {
+ if storage_backend.is_some() {
let stores = openhuman_core::storage::sessions::TenantSessionStores::new(
backend.clone(),
- !openhuman_core::storage::driver_is_shared(backend.driver()),
+ host_seams
+ .storage_driver
+ .as_deref()
+ .is_some_and(|driver| !openhuman_core::storage::driver_is_shared(driver)),
)
.map_err(|e| RuntimeError::Build(e.into()))?;
self.session_store = Some(Arc::new(stores));
@@ -280,11 +284,8 @@ impl RuntimeBuilder {
let storage_backend = storage_backend.or_else(openhuman_core::storage::installed);
if !storage_info.configured {
if let Some(backend) = &storage_backend {
- storage_info = super::StorageInfo {
- source: "backend".into(),
- driver: Some(backend.driver().into()),
- configured: true,
- };
+ let installed_url = openhuman_core::storage::installed_url();
+ storage_info = super::StorageInfo::backend(installed_url.as_deref());
}
}
diff --git a/crates/openhuman-embed/src/runtime/info.rs b/crates/openhuman-embed/src/runtime/info.rs
index e3daf89670..9fefa9d3a0 100644
--- a/crates/openhuman-embed/src/runtime/info.rs
+++ b/crates/openhuman-embed/src/runtime/info.rs
@@ -89,13 +89,13 @@ pub struct StorageInfo {
pub configured: bool,
}
impl StorageInfo {
- pub(super) fn describe(source: Option<&super::StorageSource>, config: &Config) -> Self {
+ pub(super) fn describe(
+ source: Option<&super::StorageSource>,
+ config: &Config,
+ retained_driver: Option<&str>,
+ ) -> Self {
match source {
- Some(super::StorageSource::Backend(backend)) => Self {
- source: "backend".into(),
- driver: Some(backend.driver().into()),
- configured: true,
- },
+ Some(super::StorageSource::Backend(_)) => Self::backend_driver(retained_driver),
Some(super::StorageSource::Url(url)) => Self::url("explicit", url),
None => match openhuman_core::storage::explicit_url(config) {
Some(url) => Self::url("configuration", &url),
@@ -117,6 +117,21 @@ impl StorageInfo {
configured: true,
}
}
+
+ pub(super) fn backend(installed_url: Option<&str>) -> Self {
+ match installed_url {
+ Some(url) => Self::url("backend", url),
+ None => Self::backend_driver(None),
+ }
+ }
+
+ fn backend_driver(driver: Option<&str>) -> Self {
+ Self {
+ source: "backend".into(),
+ driver: driver.map(str::to_owned),
+ configured: true,
+ }
+ }
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
@@ -186,7 +201,11 @@ impl RuntimeBuilder {
self.selection.as_ref(),
);
info.configuration_resolved = self.config_source == super::ConfigSource::Resolved;
- info.storage = StorageInfo::describe(self.seams.storage.as_ref(), &config);
+ info.storage = StorageInfo::describe(
+ self.seams.storage.as_ref(),
+ &config,
+ self.seams.storage_driver.as_deref(),
+ );
// `build` gives a stateless workspace with no storage source an
// in-memory backend; report what it will install.
if !info.storage.configured && matches!(self.workspace, crate::Workspace::Stateless) {
@@ -294,7 +313,7 @@ fn make_info(
has_tool_rules: config.tool_rules.default != tinytools::DefaultEffect::Allow
|| !config.tool_rules.rules.is_empty(),
},
- storage: StorageInfo::describe(None, config),
+ storage: StorageInfo::describe(None, config, None),
modules: selection.map(|s| s.modules.clone()).unwrap_or_default(),
weight: selection
.map(|s| s.weight)