Skip to content

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

Merge upstream/main into storage-wiring

Steven Enamakel84ffa942dccc
diff --cc crates/openhuman-embed/src/lib.rs
index 0a890efd7e,6a55a35e48..59894cd3ad
--- a/crates/openhuman-embed/src/lib.rs
+++ b/crates/openhuman-embed/src/lib.rs
@@@ -171,11 -171,8 +171,11 @@@ pub mod seams
pub use openhuman_core::agent::hooks::{PostTurnHook, ToolHook};
pub use openhuman_core::agent::hooks::{ToolHookContext, ToolHookDecision, TurnContext};
pub use openhuman_core::core::all::{ControllerExtension, DomainGroup};
- pub use openhuman_core::core::server_launcher::{ServeRequest, ServerLauncher};
+ pub use openhuman_core::core::server_launcher::{HostBoot, ServeRequest, ServerLauncher};
pub use openhuman_core::security::SecurityPolicy;
+ pub use openhuman_core::storage::StorageBackend;
+
+ pub use crate::runtime::StorageSource;
}
/// The session store port: what a host implements to keep every agent's
diff --cc crates/openhuman-embed/src/runtime/run.rs
index ae335dcffd,4f7384ca16..a8fe57151e
--- a/crates/openhuman-embed/src/runtime/run.rs
+++ b/crates/openhuman-embed/src/runtime/run.rs
@@@ -52,16 -112,40 +112,41 @@@ impl RuntimeBuilder
each subcommand installs the policy its config describes"
);
}
- let mut host_seams = std::mem::take(&mut self.seams);
- host_seams
- .open_storage_blocking()
- .map_err(|error| anyhow::Error::new(RuntimeError::Invalid(error)))?;
- let seams = host_seams
- .install()
- .map_err(|error| anyhow::Error::new(RuntimeError::Invalid(error)))?;
- seams.persist();
+ let globals = CliGlobals {
+ transport: self.backend_transport.clone(),
+ memory_engine: self.memory_engine.clone(),
+ session_store: self.session_store.clone(),
+ seams: std::mem::take(&mut self.seams),
+ };
+ (self, globals)
+ }
+
+ /// Take back the builder [`run_from_args`](Self::run_from_args) handed
+ /// the core, for a [`ServerLauncher`](crate::seams::ServerLauncher) to
+ /// boot from. `None` when the request carries none (the launcher then
+ /// uses its own preset) or it was already taken.
+ pub fn from_host_boot(boot: &HostBoot) -> Option<RuntimeBuilder> {
+ boot.take::<RuntimeBuilder>()
+ }
+ }
- openhuman_core::run_core_from_args(args)
+ impl CliGlobals {
- fn install(self) -> Result<(), String> {
++ fn install(mut self) -> Result<(), String> {
+ if let Some(transport) = self.transport {
+ openhuman_core::backend::install_backend_transport(transport);
+ log::debug!("[embed][cli] backend transport installed (process global)");
+ }
+ if let Some(engine) = self.memory_engine {
+ openhuman_core::memory::engine::install_host_engine(engine);
+ }
+ if let Some(provider) = self.session_store {
+ let _previous = openhuman_core::agent::session_store::install(provider);
+ log::debug!("[embed][cli] session store installed (process lifetime)");
+ }
++ self.seams.open_storage_blocking()?;
+ let seams = self.seams.install()?;
+ seams.persist();
+ Ok(())
}
}