Skip to content

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

feat(embed): record storage driver from configured URL

Steven Enamakel0dd57c0a92d9
diff --git a/crates/openhuman-embed/src/runtime/seams.rs b/crates/openhuman-embed/src/runtime/seams.rs
index fa4303400e..57c9b747d2 100644
--- a/crates/openhuman-embed/src/runtime/seams.rs
+++ b/crates/openhuman-embed/src/runtime/seams.rs
@@ -56,7 +56,7 @@ impl std::fmt::Debug for StorageSource {
// A URL can carry credentials: never print it.
match self {
Self::Url(_) => f.write_str("StorageSource::Url(<redacted>)"),
- Self::Backend(backend) => write!(f, "StorageSource::Backend({})", backend.driver()),
+ Self::Backend(_) => f.write_str("StorageSource::Backend(<custom>)"),
}
}
}
@@ -89,6 +89,9 @@ pub(crate) struct HostSeams {
pub(crate) server_launcher: Option<ServerLauncher>,
pub(crate) live_policy: Option<Arc<SecurityPolicy>>,
pub(crate) storage: Option<StorageSource>,
+ /// Driver metadata from a configured URL, retained after it is opened.
+ /// Custom backends have no inferred driver identity.
+ pub(crate) storage_driver: Option<String>,
}
impl HostSeams {
@@ -100,6 +103,12 @@ impl HostSeams {
/// The URL could not be parsed or opened.
pub(crate) async fn open_storage(&mut self) -> Result<(), String> {
if let Some(StorageSource::Url(url)) = &self.storage {
+ self.storage_driver = Some(
+ openhuman_core::storage::StorageUrl::parse(url)
+ .map_err(|_| String::from("invalid storage URL"))?
+ .driver()
+ .to_string(),
+ );
let backend = openhuman_core::storage::open(url)
.await
.map_err(|error| format!("opening the storage backend: {error}"))?;
@@ -114,6 +123,12 @@ impl HostSeams {
let Some(StorageSource::Url(url)) = self.storage.take() else {
return Ok(());
};
+ self.storage_driver = Some(
+ openhuman_core::storage::StorageUrl::parse(&url)
+ .map_err(|_| String::from("invalid storage URL"))?
+ .driver()
+ .to_string(),
+ );
let backend =
openhuman_core::storage::block_on(
async move { openhuman_core::storage::open(&url).await },
@@ -205,8 +220,8 @@ impl HostSeams {
Some(StorageSource::Backend(backend)) => {
let previous = openhuman_core::storage::install(Arc::clone(&backend));
log::debug!(
- "[embed][seams] storage backend installed driver={} replaced={}",
- backend.driver(),
+ "[embed][seams] storage backend installed source_driver={:?} replaced={}",
+ self.storage_driver,
previous.is_some()
);
Some((backend, previous))