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: stabilize merged main validation
Steven Enamakeld2abc6ae3af7
diff --git a/app/scripts/e2e-web-session.sh b/app/scripts/e2e-web-session.shindex ff2bb22a97..99ae274fc8 100755--- a/app/scripts/e2e-web-session.sh+++ b/app/scripts/e2e-web-session.sh@@ -27,6 +27,7 @@ if [ ! -d "${OPENHUMAN_WORKSPACE}" ] || [[ "${OPENHUMAN_WORKSPACE}" == /tmp/* ]]fiexport OPENHUMAN_WORKSPACEexport OPENHUMAN_KEYRING_BACKEND="${OPENHUMAN_KEYRING_BACKEND:-file}"+export OPENHUMAN_KEYRING_MASTER_KEY="${OPENHUMAN_KEYRING_MASTER_KEY:-$(printf '55%.0s' $(seq 1 32))}"MOCK_PID=""CORE_PID=""diff --git a/crates/openhuman-core/src/agent/artifacts/migrate_tests.rs b/crates/openhuman-core/src/agent/artifacts/migrate_tests.rsindex e6edda1cd0..478c2208b2 100644--- a/crates/openhuman-core/src/agent/artifacts/migrate_tests.rs+++ b/crates/openhuman-core/src/agent/artifacts/migrate_tests.rs@@ -4,7 +4,8 @@ use tempfile::TempDir;use super::*;use crate::agent::artifacts::store::{- get_artifact, list_artifacts, read_artifact_args, read_artifact_bytes, save_artifact_args, save_artifact_meta,+ get_artifact, list_artifacts, read_artifact_args, read_artifact_bytes, save_artifact_args,+ save_artifact_meta,};use crate::agent::artifacts::types::ArtifactKind;diff --git a/crates/openhuman-core/src/config/ops_files_dir_tests.rs b/crates/openhuman-core/src/config/ops_files_dir_tests.rsindex d1ba54e0f1..c6b2769410 100644--- a/crates/openhuman-core/src/config/ops_files_dir_tests.rs+++ b/crates/openhuman-core/src/config/ops_files_dir_tests.rs@@ -147,6 +147,7 @@ async fn boot_migrates_legacy_files_into_the_chosen_folder() {tool_call_id: None,};save_artifact_meta(&cfg.workspace_dir, &meta).await.unwrap();+ std::fs::create_dir_all(cfg.workspace_dir.join("artifacts/legacy")).unwrap();std::fs::write(cfg.workspace_dir.join("artifacts/legacy/plan.docx"),b"plan",diff --git a/crates/openhuman-core/src/core/observability.rs b/crates/openhuman-core/src/core/observability.rsindex 5212c15199..9535242a01 100644--- a/crates/openhuman-core/src/core/observability.rs+++ b/crates/openhuman-core/src/core/observability.rs@@ -16,6 +16,12 @@use std::fmt::Display;+#[cfg(feature = "crash-reporting")]+#[path = "observability_release_tag.rs"]+mod release_tag;+#[cfg(feature = "crash-reporting")]+use release_tag::{parse_release_tag, parse_version};+#[path = "observability_availability.rs"]mod availability;use availability::log_module_unavailable;@@ -3093,7 +3099,7 @@ pub fn is_insufficient_credits_event(event: &sentry::protocol::Event<'_>) -> boo/// [`tinyinference_llm::failure::body_indicates_quota_exhausted`], so/// the emit-site guard and this `before_send` net can't drift. Shared with the/// event-level filter [`is_quota_exhausted_event`].-pub use tinyinference_llm::failure::body_indicates_quota_exhausted as is_quota_exhausted_message;+use tinyinference_llm::failure::body_indicates_quota_exhausted as is_quota_exhausted_message;/// Defense-in-depth `before_send` filter for provider **monthly-quota/// exhausted** events (TAURI-RUST-C9A): the user's third-party plan has spent@@ -3452,26 +3458,6 @@ pub fn is_stale_release_event(event: &sentry::protocol::Event<'_>) -> bool {})}-/// Parse a Sentry release tag like `"[email protected]"` or-/// `"[email protected]+abc123def456"` into `(major, minor)`.-#[cfg(feature = "crash-reporting")]-fn parse_release_tag(tag: &str) -> Option<(u32, u32)> {- // Strip the `openhuman@` prefix- let after_at = tag.split('@').nth(1)?;- // Get the version part before any `+` suffix- let version = after_at.split('+').next()?;- parse_version(version)-}--/// Parse a `"MAJOR.MINOR.PATCH"` version string into `(major, minor)`.-#[cfg(feature = "crash-reporting")]-fn parse_version(version: &str) -> Option<(u32, u32)> {- let mut parts = version.splitn(3, '.');- let major = parts.next()?.parse::<u32>().ok()?;- let minor = parts.next()?.parse::<u32>().ok()?;- Some((major, minor))-}-#[cfg(test)]#[path = "observability_tests.rs"]mod tests;diff --git a/crates/openhuman-core/src/core/observability_release_tag.rs b/crates/openhuman-core/src/core/observability_release_tag.rsnew file mode 100644index 0000000000..9fca678d41--- /dev/null+++ b/crates/openhuman-core/src/core/observability_release_tag.rs@@ -0,0 +1,15 @@+/// Parses a Sentry release tag like `"[email protected]"` or+/// `"[email protected]+abc123def456"` into `(major, minor)`.+pub(super) fn parse_release_tag(tag: &str) -> Option<(u32, u32)> {+ let after_at = tag.split('@').nth(1)?;+ let version = after_at.split('+').next()?;+ parse_version(version)+}++/// Parses a `"MAJOR.MINOR.PATCH"` version string into `(major, minor)`.+pub(super) fn parse_version(version: &str) -> Option<(u32, u32)> {+ let mut parts = version.splitn(3, '.');+ let major = parts.next()?.parse::<u32>().ok()?;+ let minor = parts.next()?.parse::<u32>().ok()?;+ Some((major, minor))+}diff --git a/crates/openhuman-core/src/integrations/composio/identity_store.rs b/crates/openhuman-core/src/integrations/composio/identity_store.rsindex 33edd37986..d372660c9c 100644--- a/crates/openhuman-core/src/integrations/composio/identity_store.rs+++ b/crates/openhuman-core/src/integrations/composio/identity_store.rs@@ -47,37 +47,41 @@ pub async fn persist_provider_profile(let written = rows.len();let (key_source, key_identifier) = (toolkit.clone(), identifier.clone());- file_store::update(config, IDENTITIES_FILE, move |identities: &mut Vec<ConnectedIdentity>| {- let index = match identities- .iter()- .position(|id| id.source == key_source && id.identifier == key_identifier)- {- Some(index) => index,- None => {- identities.push(ConnectedIdentity {- source: key_source.clone(),- identifier: key_identifier.clone(),- ..ConnectedIdentity::default()- });- identities.len() - 1- }- };- let entry = &mut identities[index];- for (kind, value) in rows.iter().cloned() {- let slot = match kind {- IdentityKind::DisplayName => &mut entry.display_name,- IdentityKind::Email => &mut entry.email,- IdentityKind::Handle => &mut entry.handle,- IdentityKind::Phone => &mut entry.phone,- IdentityKind::UserId => &mut entry.user_id,- IdentityKind::AvatarUrl => &mut entry.avatar_url,- IdentityKind::ProfileUrl => &mut entry.profile_url,+ file_store::update(+ config,+ IDENTITIES_FILE,+ move |identities: &mut Vec<ConnectedIdentity>| {+ let index = match identities+ .iter()+ .position(|id| id.source == key_source && id.identifier == key_identifier)+ {+ Some(index) => index,+ None => {+ identities.push(ConnectedIdentity {+ source: key_source.clone(),+ identifier: key_identifier.clone(),+ ..ConnectedIdentity::default()+ });+ identities.len() - 1+ }};- *slot = Some(value);- }- identities.sort_by(|a, b| (&a.source, &a.identifier).cmp(&(&b.source, &b.identifier)));- ((), true)- })+ let entry = &mut identities[index];+ for (kind, value) in rows.iter().cloned() {+ let slot = match kind {+ IdentityKind::DisplayName => &mut entry.display_name,+ IdentityKind::Email => &mut entry.email,+ IdentityKind::Handle => &mut entry.handle,+ IdentityKind::Phone => &mut entry.phone,+ IdentityKind::UserId => &mut entry.user_id,+ IdentityKind::AvatarUrl => &mut entry.avatar_url,+ IdentityKind::ProfileUrl => &mut entry.profile_url,+ };+ *slot = Some(value);+ }+ identities.sort_by(|a, b| (&a.source, &a.identifier).cmp(&(&b.source, &b.identifier)));+ ((), true)+ },+ ).await?;tracing::debug!(@@ -171,18 +175,22 @@ pub async fn delete_connected_identity_facets(let source = keys.next().unwrap_or_default();let identifier = keys.next().unwrap_or_default();- file_store::update(config, IDENTITIES_FILE, move |identities: &mut Vec<ConnectedIdentity>| {- let mut deleted = 0usize;- identities.retain(|id| {- if id.source == source && id.identifier == identifier {- deleted += field_count(id);- false- } else {- true- }- });- (deleted, deleted > 0)- })+ file_store::update(+ config,+ IDENTITIES_FILE,+ move |identities: &mut Vec<ConnectedIdentity>| {+ let mut deleted = 0usize;+ identities.retain(|id| {+ if id.source == source && id.identifier == identifier {+ deleted += field_count(id);+ false+ } else {+ true+ }+ });+ (deleted, deleted > 0)+ },+ ).await}diff --git a/crates/openhuman-core/src/integrations/composio/ops/scope_prefs.rs b/crates/openhuman-core/src/integrations/composio/ops/scope_prefs.rsindex f2ed283caa..0e366e078b 100644--- a/crates/openhuman-core/src/integrations/composio/ops/scope_prefs.rs+++ b/crates/openhuman-core/src/integrations/composio/ops/scope_prefs.rs@@ -90,11 +90,12 @@ async fn migrate_legacy(config: &Config) {}}if !rows.is_empty() {- let cleared = file_store::update(config, USER_SCOPES_FILE, |prefs: &mut LegacyScopeFile| {- prefs.clear();- ((), true)- })- .await;+ let cleared =+ file_store::update(config, USER_SCOPES_FILE, |prefs: &mut LegacyScopeFile| {+ prefs.clear();+ ((), true)+ })+ .await;if let Err(error) = cleared {tracing::warn!(%error, "{LOG} legacy pref file could not be emptied");return;diff --git a/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs b/crates/openhuman-core/src/media/generation/artifact_tool_tests.rsindex fc15401a30..fbd3ab8c0c 100644--- a/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs+++ b/crates/openhuman-core/src/media/generation/artifact_tool_tests.rs@@ -3,7 +3,7 @@ use serde_json::{json, Value};use tinytools::{PermissionLevel, Tool, ToolCategory, ToolContent, ToolResult};use super::MediaArtifactTool;-use crate::agent::artifacts::ArtifactKind;+use crate::agent::artifacts::{ArtifactKind, ArtifactStatus};/// A minimal stand-in for `GenerateImageTool` / `GenerateVideoTool`: writes/// a fixed number of files under `<action_dir>/generated-media/` and reports@@ -96,11 +96,16 @@ async fn files_a_single_generated_artifact() {// Original staged file is gone (moved).assert!(!staging.join("stub-0.png").exists());- // Artifact metadata + file both landed under the artifacts root.- let artifact_dir = workspace.join("artifacts").join(artifact_id);- assert!(artifact_dir.join("meta.json").exists());- let meta_raw = std::fs::read_to_string(artifact_dir.join("meta.json")).unwrap();- assert!(meta_raw.contains("\"image\""));+ // Metadata may live in the configured storage backend; resolve it through+ // the artifact store and verify the user-facing file it records.+ let meta = crate::agent::artifacts::store::get_artifact(&workspace, artifact_id)+ .await+ .expect("artifact metadata is persisted");+ assert_eq!(meta.kind, ArtifactKind::Image);+ assert_eq!(meta.status, ArtifactStatus::Ready);+ let file = meta.file.expect("artifact points at its visible file");+ assert!(std::path::Path::new(&file).exists(), "{file}");+ assert_eq!(std::fs::read(file).unwrap(), b"bytes-0");}#[tokio::test]@@ -130,11 +135,14 @@ async fn files_every_artifact_when_n_greater_than_one() {for entry in artifacts {let id = entry["artifact_id"].as_str().expect("artifact_id set");assert!(ids.insert(id.to_string()), "artifact ids must be unique");- assert!(workspace- .join("artifacts")- .join(id)- .join("meta.json")- .exists());+ let meta = crate::agent::artifacts::store::get_artifact(&workspace, id)+ .await+ .expect("artifact metadata is persisted");+ assert_eq!(meta.status, ArtifactStatus::Ready);+ assert!(meta+ .file+ .as_deref()+ .is_some_and(|file| std::path::Path::new(file).exists()));}}diff --git a/crates/openhuman-core/src/modules/storage_grants.rs b/crates/openhuman-core/src/modules/storage_grants.rsindex 75b7239f53..4c84a4df4b 100644--- a/crates/openhuman-core/src/modules/storage_grants.rs+++ b/crates/openhuman-core/src/modules/storage_grants.rs@@ -257,7 +257,18 @@ pub(crate) fn authorize(// bind when one is refused, so a grant without (say) blobs would leave the// whole module without storage. It reveals nothing of the data and every// other call on an ungranted object is still refused.- if !grant.has_object(object) && selector != "Capabilities" {+ if selector == "Capabilities" && !grant.has_object(object) {+ return match object {+ Object::Documents => Ok(Plan::Answer(serde_json::json!({ "capabilities": [] }))),+ Object::Blobs => Ok(Plan::Answer(serde_json::json!({+ "presigned_urls": false,+ "ttl": false,+ "max_key_len": 0,+ }))),+ Object::Streams | Object::Secrets => Err(Denied::Object),+ };+ }+ if !grant.has_object(object) {return Err(Denied::Object);}let write = is_write(object, selector);diff --git a/crates/openhuman-core/src/modules/storage_grants_tests.rs b/crates/openhuman-core/src/modules/storage_grants_tests.rsindex e22c185a9d..46af7129d7 100644--- a/crates/openhuman-core/src/modules/storage_grants_tests.rs+++ b/crates/openhuman-core/src/modules/storage_grants_tests.rs@@ -138,7 +138,14 @@ fn capabilities_are_answered_for_an_object_the_grant_does_not_hold() {writable: true,..StorageGrant::default()};- assert!(authorize(&documents_only, Object::Blobs, "Capabilities", &json!(null)).is_ok());+ assert_eq!(+ authorize(&documents_only, Object::Blobs, "Capabilities", &json!({})),+ Ok(Plan::Answer(json!({+ "presigned_urls": false,+ "ttl": false,+ "max_key_len": 0,+ })))+ );// Anything else on that object is still refused.assert_eq!(authorize(diff --git a/crates/openhuman-core/src/platform/cost/tracker_documents.rs b/crates/openhuman-core/src/platform/cost/tracker_documents.rsindex 0f12c457b1..6226e88e5b 100644--- a/crates/openhuman-core/src/platform/cost/tracker_documents.rs+++ b/crates/openhuman-core/src/platform/cost/tracker_documents.rs@@ -38,7 +38,11 @@ pub(super) fn current(workspace_dir: &std::path::Path) -> Result<CostDocs> {if let Some(docs) = TEST_OVERRIDE.with(|slot| slot.borrow().clone()) {return Ok(docs);}- Ok(CostDocs(Repo::current_for(workspace_dir, DOMAIN, collections)?))+ Ok(CostDocs(Repo::current_for(+ workspace_dir,+ DOMAIN,+ collections,+ )?))}/// Runs `f` with `docs` standing in for the installed backend, on this threaddiff --git a/crates/openhuman-core/src/platform/cost/tracker_tests.rs b/crates/openhuman-core/src/platform/cost/tracker_tests.rsindex 2b842ed9e7..295c550e52 100644--- a/crates/openhuman-core/src/platform/cost/tracker_tests.rs+++ b/crates/openhuman-core/src/platform/cost/tracker_tests.rs@@ -1,7 +1,7 @@use super::*;+use chrono::{Datelike, Duration};use std::fs::{self, OpenOptions};use std::io::Write;-use chrono::{Datelike, Duration};use tempfile::TempDir;fn enabled_config() -> CostConfig {diff --git a/crates/openhuman-core/src/profiles/recovery.rs b/crates/openhuman-core/src/profiles/recovery.rsindex d0fb08b9e1..ecc4dcae8f 100644--- a/crates/openhuman-core/src/profiles/recovery.rs+++ b/crates/openhuman-core/src/profiles/recovery.rs@@ -38,11 +38,13 @@ pub(crate) fn recover_session_store(id: &ProfileId, context: &Arc<CoreContext>)}let key = crate::core::runtime::session_key(&crate::core::runtime::Tenant::of(context));let now = chrono::Utc::now().to_rfc3339();- match provider- .for_agent(&key)- .turn_states- .mark_all_interrupted(&now)- {+ let recovered = CoreContext::sync_scope(Arc::clone(context), || {+ provider+ .for_agent(&key)+ .turn_states+ .mark_all_interrupted(&now)+ });+ match recovered {Ok(0) => {}Ok(turns) => {log::info!("[profiles] profile={id} recovered {turns} interrupted stored turn(s)");@@ -53,7 +55,9 @@ pub(crate) fn recover_session_store(id: &ProfileId, context: &Arc<CoreContext>)// Another replica may still be driving a run in a shared backend.return;}- match provider.run_ledger_for_agent(&key) {+ let ledger =+ CoreContext::sync_scope(Arc::clone(context), || provider.run_ledger_for_agent(&key));+ match ledger {Ok(Some(ledger)) => {let swept = crate::storage::block_on(async move {Ok(ledger.interrupt_orphaned_agent_runs().await)diff --git a/crates/openhuman-core/src/storage/import/mod.rs b/crates/openhuman-core/src/storage/import/mod.rsindex 2f76c75086..433662938e 100644--- a/crates/openhuman-core/src/storage/import/mod.rs+++ b/crates/openhuman-core/src/storage/import/mod.rs@@ -187,7 +187,8 @@ pub async fn run(config: &Config) -> Vec<Report> {return Vec::new();}let config = config.clone();- let joined = crate::core::runtime::spawn_blocking_scoped(move || run_all(&backend, &config)).await;+ let joined =+ crate::core::runtime::spawn_blocking_scoped(move || run_all(&backend, &config)).await;match joined {Ok(reports) => reports,Err(error) => {diff --git a/crates/openhuman-embed/src/cron_tests.rs b/crates/openhuman-embed/src/cron_tests.rsindex 85d79e8d79..41bcafafe3 100644--- a/crates/openhuman-embed/src/cron_tests.rs+++ b/crates/openhuman-embed/src/cron_tests.rs@@ -25,8 +25,6 @@ fn core_job(job_type: JobType, command: &str) -> CronJob {last_status: Some("ok".into()),last_output: None,origin: None,- claim_generation: 0,- policy: Default::default(),}}diff --git a/scripts/__tests__/module-build.test.mjs b/scripts/__tests__/module-build.test.mjsindex cd451b3f1d..f39e4a2987 100644--- a/scripts/__tests__/module-build.test.mjs+++ b/scripts/__tests__/module-build.test.mjs@@ -80,7 +80,7 @@ test("the operator-trust file maps the artifact name to the sha256 of its bytes"test("every registry record carries a SourceSpec whose manifest exists in its submodule", () => {const specs = parseSourceSpecs(readRegistry(DEFAULT_ROOT));- assert.equal(specs.size, 11);+ assert.equal(specs.size, 12);for (const spec of specs.values()) {assert.equal(spec.submodule, spec.id);const manifest = join(DEFAULT_ROOT, "vendor", spec.submodule, spec.manifest);diff --git a/scripts/ci/check-openhuman-rust-layout.mjs b/scripts/ci/check-openhuman-rust-layout.mjsindex 68d6852bbf..b186e9be08 100644--- a/scripts/ci/check-openhuman-rust-layout.mjs+++ b/scripts/ci/check-openhuman-rust-layout.mjs@@ -46,7 +46,7 @@ const LEGACY_LIMIT_ENTRIES = [["crates/openhuman-core/src/core/all_tests.rs", 1475],["crates/openhuman-core/src/core/events.rs", 1776],["crates/openhuman-core/src/core/events_tests.rs", 991],- ["crates/openhuman-core/src/core/observability.rs", 3477],+ ["crates/openhuman-core/src/core/observability.rs", 3463],];const LEGACY_LIMITS = new Map(LEGACY_LIMIT_ENTRIES);diff --git a/scripts/ci/ignored-test-baseline.json b/scripts/ci/ignored-test-baseline.jsonindex c0a597f19d..9c3fe7ac43 100644--- a/scripts/ci/ignored-test-baseline.json+++ b/scripts/ci/ignored-test-baseline.json@@ -1,7 +1,7 @@{"openhuman-app": 5,"openhuman-cli": 0,- "openhuman-core": 59,+ "openhuman-core": 55,"openhuman-embed": 0,"openhuman-modules-linked": 0,"openhuman-rpc": 0,diff --git a/scripts/ci/saas-ambient-baseline.json b/scripts/ci/saas-ambient-baseline.jsonindex db09000b6e..48fffce9a6 100644--- a/scripts/ci/saas-ambient-baseline.json+++ b/scripts/ci/saas-ambient-baseline.json@@ -153,20 +153,6 @@"text": "core_context: crate::core::runtime::CoreContext::current(),","occurrence": 1},- {- "rule": "bare-spawn",- "path": "crates/openhuman-core/src/channels/runtime/dispatch/helpers.rs",- "line": 27,- "text": "tokio::spawn(async move {",- "occurrence": 1- },- {- "rule": "bare-spawn",- "path": "crates/openhuman-core/src/channels/runtime/dispatch/helpers.rs",- "line": 46,- "text": "tokio::spawn(async move {",- "occurrence": 2- },{"rule": "bare-spawn","path": "crates/openhuman-core/src/channels/runtime/dispatch/processor/turn.rs",@@ -188,13 +174,6 @@"text": "let config = match Config::load_or_init().await {","occurrence": 1},- {- "rule": "bare-spawn",- "path": "crates/openhuman-core/src/channels/runtime/session.rs",- "line": 112,- "text": "tokio::spawn(async move {",- "occurrence": 1- },{"rule": "ambient-context","path": "crates/openhuman-core/src/channels/runtime/startup/callback.rs",@@ -569,14 +548,14 @@{"rule": "bare-spawn","path": "crates/openhuman-core/src/hooks/host.rs",- "line": 54,+ "line": 57,"text": "let loaded = tokio::task::spawn_blocking(move || {","occurrence": 1},{"rule": "bare-spawn","path": "crates/openhuman-core/src/inference/host_runtime/ops/agent_chat.rs",- "line": 469,+ "line": 518,"text": "tokio::spawn(async move { while rx.recv().await.is_some() {} });","occurrence": 1},@@ -685,34 +664,6 @@"text": "let on = crate::core::runtime::context::CoreContext::current()","occurrence": 1},- {- "rule": "ambient-config",- "path": "crates/openhuman-core/src/inference/tokenjuice/schemas.rs",- "line": 374,- "text": "let config = crate::config::Config::load_or_init()",- "occurrence": 1- },- {- "rule": "ambient-config",- "path": "crates/openhuman-core/src/inference/tokenjuice/schemas.rs",- "line": 394,- "text": "let mut config = crate::config::Config::load_or_init()",- "occurrence": 1- },- {- "rule": "ambient-config",- "path": "crates/openhuman-core/src/inference/tokenjuice/schemas.rs",- "line": 416,- "text": "let config = crate::config::Config::load_or_init()",- "occurrence": 2- },- {- "rule": "ambient-config",- "path": "crates/openhuman-core/src/inference/tokenjuice/schemas.rs",- "line": 434,- "text": "let config = crate::config::Config::load_or_init()",- "occurrence": 3- },{"rule": "bare-spawn","path": "crates/openhuman-core/src/integrations/composio/bus/config_changed_subscriber.rs",@@ -783,13 +734,6 @@"text": "tokio::spawn(async move {","occurrence": 1},- {- "rule": "ambient-config",- "path": "crates/openhuman-core/src/mcp/server/http.rs",- "line": 48,- "text": "let host_config = Config::load_or_init().await?;",- "occurrence": 1- },{"rule": "bare-spawn","path": "crates/openhuman-core/src/mcp/server/local.rs",@@ -797,24 +741,10 @@"text": "let handle = tokio::spawn(async move {","occurrence": 1},- {- "rule": "bare-spawn",- "path": "crates/openhuman-core/src/mcp/server/module.rs",- "line": 405,- "text": "task: tokio::spawn((self.callback_dispatch)(call)),",- "occurrence": 1- },- {- "rule": "ambient-config",- "path": "crates/openhuman-core/src/mcp/server/stdio.rs",- "line": 121,- "text": "let config = Config::load_or_init().await?;",- "occurrence": 1- },{"rule": "env-mutation","path": "crates/openhuman-core/src/mcp/server/stdio.rs",- "line": 163,+ "line": 165,"text": "std::env::set_var(\"RUST_LOG\", level);","occurrence": 1},@@ -933,7 +863,7 @@{"rule": "ambient-context","path": "crates/openhuman-core/src/sandbox/ops.rs",- "line": 116,+ "line": 108,"text": "let off = crate::core::runtime::context::CoreContext::current()","occurrence": 1},@@ -996,7 +926,7 @@{"rule": "home-dir","path": "crates/openhuman-core/src/skills/catalog/registry.rs",- "line": 58,+ "line": 56,"text": "Self::from_lookup(|name| std::env::var(name).ok(), dirs::home_dir())","occurrence": 1},@@ -1112,13 +1042,6 @@"text": "tokio::task::spawn_blocking(do_write);","occurrence": 1},- {- "rule": "bare-spawn",- "path": "crates/openhuman-core/src/storage/import/mod.rs",- "line": 190,- "text": "let joined = tokio::task::spawn_blocking(move || run_all(&backend, &config)).await;",- "occurrence": 1- },{"rule": "bare-spawn","path": "crates/openhuman-core/src/threads/ops/edit.rs",diff --git a/scripts/ci/storage-bypass-baseline.json b/scripts/ci/storage-bypass-baseline.jsonindex 03e9363762..b583a1b6c4 100644--- a/scripts/ci/storage-bypass-baseline.json+++ b/scripts/ci/storage-bypass-baseline.json@@ -9,7 +9,7 @@{"rule": "json-write","path": "crates/openhuman-core/src/agent/attachments/mod.rs",- "line": 287,+ "line": 288,"text": "let mut file = tokio::fs::OpenOptions::new()","occurrence": 1},diff --git a/scripts/test-rust-with-mock.sh b/scripts/test-rust-with-mock.shindex 033f523e59..f2a836163c 100755--- a/scripts/test-rust-with-mock.sh+++ b/scripts/test-rust-with-mock.sh@@ -329,6 +329,9 @@ run_full_suite() {run_in_process_modules "$@"elif [ "$target" = "json_rpc_e2e" ]; thenrun_json_rpc_e2e "$@"+ elif [ "$target" = "tinymcp_storage_smoke_e2e" ]; then+ OPENHUMAN_MODULE_PATH="$tinymcp_dir${OPENHUMAN_MODULE_PATH:+:$OPENHUMAN_MODULE_PATH}" \+ cargo_test --test "$target" -- "$@"elif [ "$target" = "mcp_registry_e2e" ]; then# The TinyMCP module owns process-level directory transitions; this# binary exercises several workspaces against that shared module object.@@ -384,6 +387,13 @@ elif [ "$#" -ge 2 ] && [ "$1" = "--test" ] && [ "$2" = "mcp_registry_e2e" ]; thefiOPENHUMAN_MODULE_PATH="$connectors_module_path" \cargo_test --test mcp_registry_e2e -- --ignored --test-threads=1 "$@"+elif [ "$#" -ge 2 ] && [ "$1" = "--test" ] && [ "$2" = "tinymcp_storage_smoke_e2e" ]; then+ shift 2+ if [ "${1:-}" = "--" ]; then+ shift+ fi+ OPENHUMAN_MODULE_PATH="$tinymcp_dir${OPENHUMAN_MODULE_PATH:+:$OPENHUMAN_MODULE_PATH}" \+ cargo_test --test tinymcp_storage_smoke_e2e -- "$@"elif [ "$#" -ge 2 ] && [ "$1" = "--test" ] && [ "$2" = "mcp_registry_multi_server" ]; thenshift 2if [ "${1:-}" = "--" ]; thendiff --git a/tests/embedded_server_shutdown_e2e.rs b/tests/embedded_server_shutdown_e2e.rsindex 62fa2f6c22..55f5c2cc98 100644--- a/tests/embedded_server_shutdown_e2e.rs+++ b/tests/embedded_server_shutdown_e2e.rs@@ -83,9 +83,26 @@ async fn shutdown_token_stops_listener() {rpc_token: None,};let builder = desktop_builder(&options);- let (ready_tx, _ready_rx) = tokio::sync::oneshot::channel();+ let (ready_tx, ready_rx) = tokio::sync::oneshot::channel();let server = tokio::spawn(serve_desktop(builder, server_token, ready_tx));+ let ready = match tokio::time::timeout(Duration::from_secs(30), ready_rx).await {+ Ok(Ok(ready)) => ready,+ Ok(Err(_)) => {+ let result = server.await.expect("embedded server task should not panic");+ panic!("embedded server ended before signaling readiness: {result:?}");+ }+ Err(_) => {+ server.abort();+ let _ = server.await;+ panic!("embedded server did not signal readiness within timeout");+ }+ };+ assert_eq!(+ ready.port, port,+ "embedded server selected an unexpected port"+ );+wait_until_port(port, true).await;shutdown_token.cancel();diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rsindex 3dd262dee6..c022b69410 100644--- a/tests/json_rpc_e2e.rs+++ b/tests/json_rpc_e2e.rs@@ -4413,7 +4413,7 @@ async fn json_rpc_web_chat_routing_cases_use_expected_backend_models_inner() {Some(&json!(true)));- let sse_event = tokio::time::timeout(Duration::from_secs(12), sse_task)+ let sse_event = tokio::time::timeout(Duration::from_secs(45), sse_task).await.unwrap_or_else(|_| panic!("timed out waiting for chat_done for case {model_override}")).expect("sse task join should succeed");@@ -4628,7 +4628,7 @@ async fn json_rpc_web_chat_custom_chat_provider_uses_stored_key_and_rebuilds_on_Some(&json!(true)));signal_accepted_web_chat_request_id(request_tx, accepted_result);- let sse_event = tokio::time::timeout(Duration::from_secs(12), sse_task)+ let sse_event = tokio::time::timeout(Duration::from_secs(45), sse_task).await.expect("timed out waiting for first custom-provider chat_done").expect("first custom-provider sse join");@@ -4692,7 +4692,7 @@ async fn json_rpc_web_chat_custom_chat_provider_uses_stored_key_and_rebuilds_on_Some(&json!(true)));signal_accepted_web_chat_request_id(request_tx, accepted_result);- let sse_event = tokio::time::timeout(Duration::from_secs(12), sse_task)+ let sse_event = tokio::time::timeout(Duration::from_secs(45), sse_task).await.expect("timed out waiting for second custom-provider chat_done").expect("second custom-provider sse join");@@ -4748,7 +4748,7 @@ async fn json_rpc_web_chat_custom_chat_provider_uses_stored_key_and_rebuilds_on_Some(&json!(true)));signal_accepted_web_chat_request_id(request_tx, accepted_result);- let sse_event = tokio::time::timeout(Duration::from_secs(12), sse_task)+ let sse_event = tokio::time::timeout(Duration::from_secs(45), sse_task).await.expect("timed out waiting for unaffected agentic chat_done").expect("unaffected agentic sse join");@@ -4803,7 +4803,7 @@ async fn json_rpc_web_chat_custom_chat_provider_uses_stored_key_and_rebuilds_on_Some(&json!(true)));signal_accepted_web_chat_request_id(request_tx, accepted_result);- let sse_event = tokio::time::timeout(Duration::from_secs(12), sse_task)+ let sse_event = tokio::time::timeout(Duration::from_secs(45), sse_task).await.expect("timed out waiting for managed chat_done").expect("managed sse join");@@ -5078,7 +5078,7 @@ async fn json_rpc_web_chat_custom_chat_provider_with_auth_none_omits_auth_header.and_then(|v| v.get("accepted")),Some(&json!(true)));- let sse_event = tokio::time::timeout(Duration::from_secs(12), sse_task)+ let sse_event = tokio::time::timeout(Duration::from_secs(45), sse_task).await.expect("timed out waiting for auth-none chat_done").expect("auth-none sse join");@@ -12037,7 +12037,7 @@ async fn json_rpc_channel_web_chat_with_speak_reply_invokes_reply_speech_inner()Some(&json!(true)));- let sse_event = tokio::time::timeout(Duration::from_secs(12), sse_task)+ let sse_event = tokio::time::timeout(Duration::from_secs(45), sse_task).await.expect("timed out waiting for chat_done with speak_reply=true").expect("sse task join should succeed");diff --git a/tests/media_generation_e2e.rs b/tests/media_generation_e2e.rsindex c57a84e793..7ce315a4f6 100644--- a/tests/media_generation_e2e.rs+++ b/tests/media_generation_e2e.rs@@ -180,11 +180,12 @@ async fn media_tools_deliver_images_and_videos_through_the_backend_proxy() {tinyhumans_boot::boot();let tmp = tempfile::tempdir().unwrap();let (api_url, backend) = start_backend().await;- let config = config(tmp.path(), &api_url);+ let mut config = config(tmp.path(), &api_url);let action_dir = tmp.path().join("projects");- // Deliverables land in the visible Files folder (#5505); only each- // artifact's `meta.json` stays in the hidden workspace store.+ // Deliverables land in the visible Files folder (#5505); metadata is read+ // through the artifact store because it may use the configured backend.let files_dir = tmp.path().join("Files");+ config.files_dir_override = Some(files_dir.clone());let generators = managed_generators(&config).expect("backend transport is installed");let tools = media_tools_from(@@ -248,7 +249,7 @@ async fn media_tools_deliver_images_and_videos_through_the_backend_proxy() {"the job must be polled through the empty `completed` states");- // ── artifacts on disk ────────────────────────────────────────────────+ // ── artifacts are persisted and their visible files resolve ──────────assert_eq!(std::fs::read_dir(action_dir.join("generated-media")).expect("generated-media staging directory")@@ -256,17 +257,20 @@ async fn media_tools_deliver_images_and_videos_through_the_backend_proxy() {0,"filed media must leave the staging directory");- for id in [&image_id, &video_id] {- let entries: Vec<String> =- std::fs::read_dir(config.workspace_dir.join("artifacts").join(id))- .expect("filed artifact record")- .map(|entry| entry.unwrap().file_name().to_string_lossy().into_owned())- .collect();- assert_eq!(- entries,- vec!["meta.json".to_string()],- "only the record stays hidden"+ for (id, kind) in [(&image_id, "image"), (&video_id, "video")] {+ let record = openhuman_core::agent::artifacts::ops::ai_get_artifact(&config, id)+ .await+ .expect("filed artifact record")+ .value;+ assert_eq!(record["kind"], kind);+ assert_eq!(record["status"], "ready");+ let path = std::path::Path::new(+ record["absolute_path"]+ .as_str()+ .expect("resolved artifact path"),);+ assert!(path.starts_with(&files_dir), "{path:?}");+ assert!(path.is_file(), "{path:?}");}let mut saved: Vec<(String, Vec<u8>)> = std::fs::read_dir(&files_dir).expect("visible files folder")diff --git a/tests/saas_isolation/generators.rs b/tests/saas_isolation/generators.rsindex 598b54cc30..2793ef2092 100644--- a/tests/saas_isolation/generators.rs+++ b/tests/saas_isolation/generators.rs@@ -105,20 +105,6 @@ pub const GENERATORS: &[(&str, Generator)] = &["openhuman.threads_todos_get",|w, a| json!({ "thread_id": w.thread_for(a, false) }),),- ("openhuman.subagent_cancel", |w, a| {- json!({- "taskId": format!("sub-{}", w.next_id()),- "reason": w.canary(a),- })- }),- ("openhuman.subagent_steer", |w, a| {- let mode = ["steer", "collect"][w.rng.below(2)];- json!({- "taskId": format!("sub-{}", w.next_id()),- "message": w.canary(a),- "mode": mode,- })- }),("openhuman.threads_generate_title",|w, a| json!({ "thread_id": w.thread_for(a, true), "assistant_message": w.canary(a) }),diff --git a/tests/saas_mode/cluster.rs b/tests/saas_mode/cluster.rsindex 098bb974b2..68edbf392d 100644--- a/tests/saas_mode/cluster.rs+++ b/tests/saas_mode/cluster.rs@@ -114,6 +114,12 @@ fn one_core_at_a_time(storage_url: Option<&str>) {Duration::from_secs(30),|| call(&one, "alice", "core.ping", json!({})).0 == 200,);+ wait_until(+ "core 1 to recover alice's interrupted turn",+ &one,+ Duration::from_secs(30),+ || turn_state(&one, "alice", "t-kill").as_deref() == Some("interrupted"),+ );assert_eq!(turn_state(&one, "alice", "t-kill").as_deref(),Some("interrupted"),diff --git a/tests/saas_mode/node.rs b/tests/saas_mode/node.rsindex f199601117..0edf83be6e 100644--- a/tests/saas_mode/node.rs+++ b/tests/saas_mode/node.rs@@ -148,7 +148,7 @@ pub fn start_node_logging(pub fn client() -> reqwest::blocking::Client {reqwest::blocking::Client::builder()- .timeout(Duration::from_secs(10))+ .timeout(Duration::from_secs(45)).build().unwrap()}@@ -163,7 +163,13 @@ pub fn call(node: &Node, user: &str, method: &str, params: Value) -> (u16, Optio.header(USER_SIG_HEADER, sign(BEARER, user, now())).json(&json!({ "jsonrpc": "2.0", "id": 1, "method": method, "params": params })).send()- .expect("POST /rpc");+ .unwrap_or_else(|error| {+ panic!(+ "POST /rpc method={method} profile={user}: {error}\ncore {} log:\n{}",+ node.name,+ node.log_tail()+ )+ });let status = response.status().as_u16();let owner = response.headers()diff --git a/tests/tinymcp_storage_smoke_e2e.rs b/tests/tinymcp_storage_smoke_e2e.rsindex 8036576a9b..082b67414d 100644--- a/tests/tinymcp_storage_smoke_e2e.rs+++ b/tests/tinymcp_storage_smoke_e2e.rs@@ -164,7 +164,6 @@ fn files(dir: &Path) -> Vec<String> {}#[test]-#[ignore = "requires a TinyMCP library: stage the release (scripts/test-rust-e2e.sh) or node scripts/modules/build.mjs tinymcp"]fn a_server_added_through_the_released_module_survives_a_restart_in_the_storage_backend() {let artifact = openhuman_core::modules::local_artifact("tinymcp").expect("build or stage tinymcp (OPENHUMAN_MODULE_SOURCE_DIR / OPENHUMAN_MODULE_PATH)");