The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(ci): keep a stateless runtime's storage in memory
M3gA-Mind2f17ff05a7f8
diff --git a/crates/openhuman-embed/src/harness/workspace.rs b/crates/openhuman-embed/src/harness/workspace.rsindex 6240b9e4bc..dbe7223995 100644--- a/crates/openhuman-embed/src/harness/workspace.rs+++ b/crates/openhuman-embed/src/harness/workspace.rs@@ -33,7 +33,10 @@ pub enum Workspace {/// No durable state on disk: every agent's transcripts, journal, goals and/// todos go through the runtime's session store/// ([`RuntimeBuilder::session_store`](crate::RuntimeBuilder::session_store)),- /// which is required.+ /// which is required. Without a host storage backend+ /// ([`RuntimeBuilder::storage`](crate::RuntimeBuilder::storage) or+ /// `[storage] url`), the core's other documents (run status, cron jobs,+ /// flows) are kept in memory and lost with the runtime.////// For a cloud host serving many users from one process, where a pod can/// be replaced at any moment. A private scratch directory still backs thediff --git a/crates/openhuman-embed/src/runtime/build.rs b/crates/openhuman-embed/src/runtime/build.rsindex c184154069..c39d9d555a 100644--- a/crates/openhuman-embed/src/runtime/build.rs+++ b/crates/openhuman-embed/src/runtime/build.rs@@ -171,6 +171,14 @@ impl RuntimeBuilder {}}}+ // A stateless workspace keeps nothing durable on disk: with no host+ // backend, the documents the core keeps beside the session store (run+ // status, cron, flows) go to memory instead of the workspace-default+ // SQLite under `<workspace>/storage`. Installed process-wide like any+ // storage seam, and removed with the runtime.+ if host_seams.storage.is_none() && matches!(self.workspace, Workspace::Stateless) {+ host_seams.storage = Some(super::StorageSource::Url("memory".into()));+ }validate_storage_feature(host_seams.storage.as_ref())?;host_seams.open_storage()diff --git a/crates/openhuman-embed/tests/session_store.rs b/crates/openhuman-embed/tests/session_store.rsindex 404fa7a157..4662f88ba8 100644--- a/crates/openhuman-embed/tests/session_store.rs+++ b/crates/openhuman-embed/tests/session_store.rs@@ -1,8 +1,9 @@//! End-to-end proof that a host session store owns every conversation.//!//! A stateless runtime with an [`InMemorySessionStores`] runs two agents-//! against a `wiremock` provider. Their transcripts, journal and run status-//! must land in the store, each agent's apart from the other's; a reopened+//! against a `wiremock` provider. Their transcripts and journal must land in+//! the store, and their run status in the runtime's in-memory storage, each+//! agent's apart from the other's; a reopened//! agent must resume its thread *from the store*; and nothing durable may be//! written under the runtime's scratch workspace.//!@@ -14,15 +15,13 @@ use std::collections::HashSet;use std::sync::Arc;use common::{chat_requests, offline_config, provider, runtime, stub_backend};-use openhuman_embed::session_store::{session_store_conformance, Store};+use openhuman_core::storage::DocumentStoreExt as _;+use openhuman_embed::session_store::session_store_conformance;use openhuman_embed::{Access, AgentSpec, InMemorySessionStores, Provider, Runtime, RuntimeError,SessionStoreProvider, Workspace,};-/// Run status records, as the journal writes them.-const STATUS_NS: &str = "run_status";-/// Every path under `root`, relative to it.fn files_under(root: &std::path::Path) -> Vec<String> {let mut found = Vec::new();@@ -153,13 +152,22 @@ fn a_stateless_runtime_keeps_every_conversation_in_its_session_store() {.is_none(),"another agent cannot reach asha's thread");- // The turn journal's run status went to the agent's own store.- let runs = asha_stores- .kv- .list(STATUS_NS)+ // The turn journal's run status went to the agent's own scope of+ // the runtime's storage, which a stateless runtime keeps in memory.+ let storage = openhuman_core::storage::installed()+ .expect("a stateless runtime installs a storage backend");+ assert_eq!(storage.driver(), "memory");+ let runs = storage+ .for_scope(&openhuman_core::storage::scope_for_agent("asha"))+ .expect("asha's storage scope")+ .documents()+ .query_all(+ tinyagents_harness::observability::DriverStatusStore::DEFAULT_COLLECTION,+ &Default::default(),+ ).await.expect("status records list");- assert!(!runs.is_empty(), "asha's runs are recorded in her store");+ assert!(!runs.is_empty(), "asha's runs are recorded in her scope");// Nothing durable reached the scratch workspace.let written: Vec<_> = files_under(&scratch)