Skip to content

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

Merge remote-tracking branch 'upstream/main' into test-to-green-20261022

Steven Enamakel19ef1cad6349
diff --cc crates/openhuman-core/src/agent/session_host/runtime_session/prompt_refresh_tests.rs
index 07760f4684,3bf0818f06..9d448de932
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/prompt_refresh_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/prompt_refresh_tests.rs
@@@ -27,8 -27,8 +27,9 @@@ fn host_with
let chat_model: Arc<dyn tinyinference_llm::model::ChatModel<()>> = model.clone();
let mut host = crate::agent::SessionHostBuilder::new()
.with_session_history_locator(Arc::clone(locator))
+ .model_name("test/session-fixture".to_string())
.chat_model(chat_model)
+ .model_name("test/session-fixture".to_string())
.tools(Vec::new())
.prompt_builder(prompt)
.workspace_dir(root.join("workspace"))
diff --cc crates/openhuman-core/src/inbound/settings_tests.rs
index 0c909e2fd2,5acf50908c..914c10073d
--- a/crates/openhuman-core/src/inbound/settings_tests.rs
+++ b/crates/openhuman-core/src/inbound/settings_tests.rs
@@@ -110,9 -110,13 +110,14 @@@ async fn the_module_config_is_what_the_
config.inbound.queues_path = Some(queues.path().to_path_buf());
let blob = module_config(&config);
+ // The module refuses to load without the bus name serving its storage.
+ assert_eq!(
+ blob["storage_callback"],
+ "ai.tinyhumans.tinystorage.Storage"
+ );
assert_eq!(blob["queues"]["queues"][0]["max_attempts"], 4);
assert_eq!(blob["pipeline"]["version"], 1);
+ assert!(blob.get("storage_callback").is_none());
let grant = queue_grant().unwrap();
assert_eq!(
grant
diff --cc crates/openhuman-core/src/storage/sessions/host_stores.rs
index f176f82a6a,a5634f16fa..74c686a999
--- a/crates/openhuman-core/src/storage/sessions/host_stores.rs
+++ b/crates/openhuman-core/src/storage/sessions/host_stores.rs
@@@ -69,12 -70,22 +70,25 @@@ pub fn provider_for_workspace(workspace
}
}
+ /// The provider selected by `context` for `workspace_dir`, else the workspace
+ /// fallback. This preserves agent-local host overrides when work carries an
+ /// explicit dispatch context rather than the ambient task context.
+ pub fn provider_for_workspace_in(
+ workspace_dir: &Path,
+ context: &crate::core::runtime::DispatchCtx,
+ ) -> Arc<dyn SessionStoreProvider> {
+ match super::installed_in(context) {
+ Some(installed) => installed,
+ None => fallback_provider(workspace_dir),
+ }
+ }
+
/// The provider over `workspace_dir`'s default backend, installed or not.
pub(super) fn fallback_provider(workspace_dir: &Path) -> Arc<dyn SessionStoreProvider> {
- if crate::core::runtime::is_saas() && crate::storage::installed().is_none() {
+ if crate::core::runtime::is_saas()
+ && crate::storage::installed().is_none()
+ && tenant_agent_key().is_none()
+ {
return refusing_provider(
"no host storage backend is installed for this SaaS session".to_owned(),
);
diff --cc crates/openhuman-core/src/storage/sessions/mod.rs
index 22f4a93d5a,8bb7c29f5f..df60339ead
--- a/crates/openhuman-core/src/storage/sessions/mod.rs
+++ b/crates/openhuman-core/src/storage/sessions/mod.rs
@@@ -18,25 -18,20 +18,26 @@@ use std::sync::{Arc, LazyLock, PoisonEr
use tinyagents_session::port::{AgentStores, SessionStoreProvider};
+ mod host_stores;
mod rebound;
mod tenant_router;
- mod workspace;
+ pub use host_stores::{
+ artifact_blobs_for, artifact_scoped_for_in, attachment_stash_for, current_documents_for,
+ default_turn_states_for, ledger_for, provider_for_workspace, provider_for_workspace_in,
+ release_workspace, release_workspace_defaults, require_ledger, session_scope, status_store_for,
+ stores_for, stores_or_ephemeral, turn_states_for, with_ledger, with_ledger_async,
+ WorkspaceSessionStores,
+ };
pub use rebound::{rebind_all, ReboundSessionStores, StoreRegistry};
pub use tenant_router::TenantSessionStores;
- pub use workspace::{
- artifact_blobs_for, attachment_stash_for, current_documents_for, default_turn_states_for,
- ledger_for, provider_for_workspace, release_workspace, release_workspace_defaults,
- require_ledger, session_scope, status_store_for, stores_for, stores_or_ephemeral,
- turn_states_for, with_ledger, with_ledger_async, WorkspaceSessionStores,
- };
+/// Drops cached stores for a profile after its lease is released. Existing
+/// handles retain their original fence; a later profile open gets fresh ones.
+pub fn release_profile(profile: &str) {
+ rebound::release_profile(profile);
+}
+
static PROVIDER: LazyLock<RwLock<Option<Arc<dyn SessionStoreProvider>>>> =
LazyLock::new(|| RwLock::new(None));
diff --cc crates/openhuman-core/src/storage/sessions/rebound.rs
index 532d773ad3,ebedd9083d..c9eedee5ed
--- a/crates/openhuman-core/src/storage/sessions/rebound.rs
+++ b/crates/openhuman-core/src/storage/sessions/rebound.rs
@@@ -146,15 -137,10 +149,15 @@@ impl ReboundSessionStores
/// Rebinds every live [`ReboundSessionStores`] of the process to `backend`;
/// returns how many.
- pub fn rebind_all(backend: &Arc<dyn StorageBackend>) -> usize {
- PROCESS.rebind(backend)
+ pub fn rebind_all(backend: &Arc<dyn StorageBackend>) -> Result<usize, StorageError> {
+ Ok(PROCESS.rebind(backend))
}
+/// Drops the cached provider for `profile` from every live process store.
+pub fn release_profile(profile: &str) {
+ PROCESS.release_profile(profile);
+}
+
impl SessionStoreProvider for ReboundSessionStores {
fn for_agent(&self, agent_id: &str) -> AgentStores {
self.current().for_agent(agent_id)