Skip to content

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

merge main into memory-v2

Steven Enamakela305cee5637a
diff --cc .github/workflows/ci-full.yml
index 2b60e04f75,8b5b113212..a6fa2babc4
--- a/.github/workflows/ci-full.yml
+++ b/.github/workflows/ci-full.yml
@@@ -136,14 -138,22 +136,14 @@@ jobs
juice_dir="$module_root/tinyjuice"
connectors_dir="$module_root/tinyconnectors"
search_dir="$module_root/tinysearch"
- memory_archive="$memory_dir/tinymemory-module-${memory_version}-ubuntu-22.04-x86_64.tar.gz"
- juice_archive="$juice_dir/tinyjuice-module-0.5.1-ubuntu-22.04-x86_64.tar.gz"
- rm -rf "$memory_dir" "$juice_dir" "$connectors_dir"
- mkdir -p "$memory_dir" "$juice_dir" "$connectors_dir" "$search_dir"
- curl --fail --location --silent --show-error --retry 4 --retry-delay 2 \
- "https://github.com/tinyhumansai/tinymemory/releases/download/v${memory_version}/$(basename "$memory_archive")" \
- --output "$memory_archive"
+ juice_archive="$juice_dir/tinyjuice-module-0.5.0-ubuntu-22.04-x86_64.tar.gz"
+ rm -rf "$juice_dir" "$connectors_dir"
+ mkdir -p "$juice_dir" "$connectors_dir" "$search_dir"
curl --fail --location --silent --show-error --retry 4 --retry-delay 2 \
- "https://github.com/tinyhumansai/tinyjuice/releases/download/v0.5.0/$(basename "$juice_archive")" \
+ "https://github.com/tinyhumansai/tinyjuice/releases/download/v0.5.1/$(basename "$juice_archive")" \
--output "$juice_archive"
- echo "${memory_sha256} $memory_archive" \
- | sha256sum --check
- echo "27e5ffe19ea712b1abb52c5d88fd20979c7106daef2dfe03e6d1fac782936da6 $juice_archive" \
+ echo "94c8998c830d9454560c00055187198a598eefaf5be51bcecdcd194a66f3b388 $juice_archive" \
| sha256sum --check
- tar --no-same-owner -xzf "$memory_archive" -C "$memory_dir"
tar --no-same-owner -xzf "$juice_archive" -C "$juice_dir"
bash scripts/ci-cancel-aware.sh cargo build --release \
--manifest-path vendor/tinyconnectors/crates/tinyconnectors/Cargo.toml
@@@ -325,14 -344,21 +330,14 @@@
juice_dir="$module_root/tinyjuice"
connectors_dir="$module_root/tinyconnectors"
search_dir="$module_root/tinysearch"
- memory_archive="$memory_dir/tinymemory-module-${memory_version}-ubuntu-22.04-x86_64.tar.gz"
- juice_archive="$juice_dir/tinyjuice-module-0.5.1-ubuntu-22.04-x86_64.tar.gz"
- rm -rf "$memory_dir" "$juice_dir" "$connectors_dir"
- mkdir -p "$memory_dir" "$juice_dir" "$connectors_dir" "$search_dir"
- curl --fail --location --silent --show-error --retry 4 --retry-delay 2 \
- "https://github.com/tinyhumansai/tinymemory/releases/download/v${memory_version}/$(basename "$memory_archive")" \
- --output "$memory_archive"
+ juice_archive="$juice_dir/tinyjuice-module-0.5.0-ubuntu-22.04-x86_64.tar.gz"
+ rm -rf "$juice_dir" "$connectors_dir"
+ mkdir -p "$juice_dir" "$connectors_dir" "$search_dir"
curl --fail --location --silent --show-error --retry 4 --retry-delay 2 \
- "https://github.com/tinyhumansai/tinyjuice/releases/download/v0.5.0/$(basename "$juice_archive")" \
+ "https://github.com/tinyhumansai/tinyjuice/releases/download/v0.5.1/$(basename "$juice_archive")" \
--output "$juice_archive"
- echo "${memory_sha256} $memory_archive" | sha256sum --check
- echo "27e5ffe19ea712b1abb52c5d88fd20979c7106daef2dfe03e6d1fac782936da6 $juice_archive" \
+ echo "94c8998c830d9454560c00055187198a598eefaf5be51bcecdcd194a66f3b388 $juice_archive" \
| sha256sum --check
- tar --no-same-owner -xzf "$memory_archive" -C "$memory_dir"
tar --no-same-owner -xzf "$juice_archive" -C "$juice_dir"
bash scripts/ci-cancel-aware.sh cargo build --release \
--manifest-path vendor/tinyconnectors/crates/tinyconnectors/Cargo.toml
diff --cc .github/workflows/e2e-playwright.yml
index a24e4f7eda,ef7ff06e44..687762c101
--- a/.github/workflows/e2e-playwright.yml
+++ b/.github/workflows/e2e-playwright.yml
@@@ -68,17 -68,26 +68,17 @@@ jobs
# tinybus validates every directory ancestor. GitHub mounts the
# checkout as the host runner uid while this container runs as root,
# so keep native fixtures in a root-owned, ephemeral tree.
- memory_version="1.22.4"
- memory_sha256="52b364047b1a7aaf287d5bb17840fcda20547286f3db98211bfe1d9962518ee9"
module_root="/opt/openhuman-test-modules/${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
- memory_dir="$module_root/tinymemory"
juice_dir="$module_root/tinyjuice"
connectors_dir="$module_root/tinyconnectors"
- memory_archive="$memory_dir/tinymemory-module-${memory_version}-ubuntu-22.04-x86_64.tar.gz"
- juice_archive="$juice_dir/tinyjuice-module-0.5.1-ubuntu-22.04-x86_64.tar.gz"
- rm -rf "$memory_dir" "$juice_dir" "$connectors_dir"
- mkdir -p "$memory_dir" "$juice_dir" "$connectors_dir"
- curl --fail --location --silent --show-error --retry 4 --retry-delay 2 \
- "https://github.com/tinyhumansai/tinymemory/releases/download/v${memory_version}/$(basename "$memory_archive")" \
- --output "$memory_archive"
+ juice_archive="$juice_dir/tinyjuice-module-0.5.0-ubuntu-22.04-x86_64.tar.gz"
+ rm -rf "$juice_dir" "$connectors_dir"
+ mkdir -p "$juice_dir" "$connectors_dir"
curl --fail --location --silent --show-error --retry 4 --retry-delay 2 \
- "https://github.com/tinyhumansai/tinyjuice/releases/download/v0.5.0/$(basename "$juice_archive")" \
+ "https://github.com/tinyhumansai/tinyjuice/releases/download/v0.5.1/$(basename "$juice_archive")" \
--output "$juice_archive"
- echo "${memory_sha256} $memory_archive" | sha256sum --check
- echo "27e5ffe19ea712b1abb52c5d88fd20979c7106daef2dfe03e6d1fac782936da6 $juice_archive" \
+ echo "94c8998c830d9454560c00055187198a598eefaf5be51bcecdcd194a66f3b388 $juice_archive" \
| sha256sum --check
- tar --no-same-owner -xzf "$memory_archive" -C "$memory_dir"
tar --no-same-owner -xzf "$juice_archive" -C "$juice_dir"
bash scripts/ci-cancel-aware.sh cargo build --release \
--manifest-path vendor/tinyconnectors/crates/tinyconnectors/Cargo.toml
diff --cc Cargo.lock
index 16f16478a1,8b22aa2e00..a166be4eba
--- a/Cargo.lock
+++ b/Cargo.lock
@@@ -7207,9 -7181,24 +7144,9 @@@ dependencies =
"walkdir",
]
-[[package]]
-name = "tinymemory-tools"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "async-trait",
- "chrono",
- "log",
- "serde",
- "serde_json",
- "tinyinference-embeddings",
- "tinymemory-api",
- "tinytools",
-]
-
[[package]]
name = "tinyruntime-bus"
- version = "0.2.9"
+ version = "0.2.11"
dependencies = [
"serde",
"serde_json",
diff --cc crates/openhuman-app/Cargo.lock
index b5e1c9fac6,6407769c99..02b695f2e7
--- a/crates/openhuman-app/Cargo.lock
+++ b/crates/openhuman-app/Cargo.lock
@@@ -7847,9 -7838,24 +7792,9 @@@ dependencies =
"walkdir",
]
-[[package]]
-name = "tinymemory-tools"
-version = "0.1.0"
-dependencies = [
- "anyhow",
- "async-trait",
- "chrono",
- "log",
- "serde",
- "serde_json",
- "tinyinference-embeddings",
- "tinymemory-api",
- "tinytools",
-]
-
[[package]]
name = "tinyruntime-bus"
- version = "0.2.9"
+ version = "0.2.11"
dependencies = [
"serde",
"serde_json",
diff --cc crates/openhuman-core/src/agent/session_host/builder/builder_build.rs
index a91a15677a,19694f5613..b438dbf953
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_build.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_build.rs
@@@ -142,9 -142,12 +142,12 @@@ impl SessionHostBuilder
// that is still empty — see the matching strip there.
let discovery_opted_in =
visible_names.remove(crate::tools::implementations::meta::TOOL_SEARCH_NAME);
- let discovery_enabled = belt_is_wildcard || discovery_opted_in;
+ let discovery_enabled = (belt_is_wildcard || discovery_opted_in)
+ && !self
+ .withheld_tool_names
+ .contains(crate::tools::implementations::meta::TOOL_SEARCH_NAME);
// A wildcard belt was seeded from the whole registry, so its durable
- // `Hidden` members (collapsed `memory_*` / `todo_*`) leave here too.
+ // `Hidden` members (collapsed `todo_*`) leave here too.
// A named belt never listed them.
let mut deferred_names = if belt_is_wildcard {
crate::tools::implementations::meta::strip_deferred_from_visible(
diff --cc crates/openhuman-core/src/agent/session_host/builder/factory.rs
index 2f788123a9,a27ab436ed..631cb47174
--- a/crates/openhuman-core/src/agent/session_host/builder/factory.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/factory.rs
@@@ -785,7 -987,10 +784,8 @@@ impl OpenHumanSessionHost
.tools(tools)
.synthesized_tools(delegation_tools)
.visible_tool_names(visible)
+ .withheld_tool_names(withheld_tool_names)
.deferred_tools(target_def.map_or_else(Vec::new, |d| d.deferred_tools.clone()))
- .memory(memory)
- .auto_recall(Some(auto_recall))
.tool_dispatcher(tool_dispatcher)
.prompt_builder(prompt_builder)
.config(effective_agent_config)
diff --cc crates/openhuman-core/src/agent/session_host/builder/setters.rs
index 53844d4220,819a584d98..4604f18bb5
--- a/crates/openhuman-core/src/agent/session_host/builder/setters.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/setters.rs
@@@ -14,8 -16,11 +14,9 @@@ impl SessionHostBuilder
tools: None,
synthesized_tools: None,
visible_tool_names: None,
+ withheld_tool_names: std::collections::HashSet::new(),
deferred_tools: Vec::new(),
subagent_tool_ceiling_names: None,
- memory: None,
- auto_recall: None,
prompt_builder: None,
tool_dispatcher: None,
config: None,
diff --cc crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
index 5e7d886634,ce451c8653..02ff2e98c8
--- a/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_adapter_tests.rs
@@@ -566,7 -567,9 +566,8 @@@ async fn production_turn_path_wires_an_
let mut host = crate::agent::SessionHostBuilder::new()
.chat_model(model)
.tools(Vec::new())
+ .workspace_dir(workspace.path().to_path_buf())
.action_dir(action_dir.path().to_path_buf())
- .memory(crate::memory::test_support::noop_memory())
.tool_dispatcher(Box::new(tinytools_agent::dialect::XmlDialect))
.workspace_descriptor(Some(
tinytools::WorkspaceDescriptor::new(turn_root.path().to_path_buf())
@@@ -610,7 -615,9 +613,8 @@@ async fn artifact_store_stays_in_the_wo
let mut host = crate::agent::SessionHostBuilder::new()
.chat_model(model)
.tools(Vec::new())
+ .workspace_dir(workspace.path().to_path_buf())
.action_dir(action_dir.path().to_path_buf())
- .memory(crate::memory::test_support::noop_memory())
.tool_dispatcher(Box::new(tinytools_agent::dialect::XmlDialect))
.build()
.expect("session build");
diff --cc crates/openhuman-core/src/config/ops_loader_and_search_tests.rs
index 4513c44b94,57efb726f7..a7af7d4715
--- a/crates/openhuman-core/src/config/ops_loader_and_search_tests.rs
+++ b/crates/openhuman-core/src/config/ops_loader_and_search_tests.rs
@@@ -390,9 -390,67 +390,9 @@@ fn workspace_onboarding_flag_exists_tru
std::fs::create_dir_all(&ws).unwrap();
std::fs::write(ws.join("onboarding.done"), "").unwrap();
let res = workspace_onboarding_flag_exists(ws, "onboarding.done").expect("flag check ok");
- assert_eq!(res.value, true);
+ assert!(res.value);
}
-#[tokio::test]
-async fn apply_memory_sync_settings_stores_interval_and_view() {
- let tmp = tempdir().unwrap();
- let mut cfg = tmp_config(&tmp);
-
- // Pick the 4h preset.
- let patch = MemorySyncSettingsPatch {
- sync_interval_secs: Some(14_400),
- };
- let outcome = apply_memory_sync_settings(&mut cfg, patch)
- .await
- .expect("apply");
- assert_eq!(cfg.memory_sync_interval_secs, Some(14_400));
- assert_eq!(outcome.value["sync_interval_secs"], 14_400);
- assert_eq!(outcome.value["selected_secs"], 14_400);
- assert_eq!(outcome.value["is_manual"], false);
- assert_eq!(outcome.value["is_default"], false);
-}
-
-#[tokio::test]
-async fn apply_memory_sync_settings_manual_only() {
- let tmp = tempdir().unwrap();
- let mut cfg = tmp_config(&tmp);
-
- let patch = MemorySyncSettingsPatch {
- sync_interval_secs: Some(0),
- };
- let outcome = apply_memory_sync_settings(&mut cfg, patch)
- .await
- .expect("apply");
- assert_eq!(cfg.memory_sync_interval_secs, Some(0));
- assert_eq!(outcome.value["is_manual"], true);
- assert_eq!(outcome.value["sync_interval_secs"], 0);
-}
-
-#[tokio::test]
-async fn apply_memory_sync_settings_reset_to_default() {
- let tmp = tempdir().unwrap();
- let mut cfg = tmp_config(&tmp);
- cfg.memory_sync_interval_secs = Some(43_200);
-
- // Omitted field → None → reset to default.
- let patch = MemorySyncSettingsPatch {
- sync_interval_secs: None,
- };
- let outcome = apply_memory_sync_settings(&mut cfg, patch)
- .await
- .expect("apply");
- assert_eq!(cfg.memory_sync_interval_secs, None);
- assert_eq!(outcome.value["is_default"], true);
- assert!(outcome.value["sync_interval_secs"].is_null());
- // The UI still gets a concrete cadence to highlight (the 24h default).
- assert_eq!(
- outcome.value["selected_secs"],
- crate::config::DEFAULT_MEMORY_SYNC_INTERVAL_SECS
- );
-}
-
#[tokio::test]
async fn apply_model_settings_updates_fields_and_persists_snapshot() {
let tmp = tempdir().unwrap();
diff --cc crates/openhuman-core/src/core/all_tests.rs
index f3c6e83588,3f00e51a8a..3182849be6
--- a/crates/openhuman-core/src/core/all_tests.rs
+++ b/crates/openhuman-core/src/core/all_tests.rs
@@@ -197,10 -199,14 +197,10 @@@ fn all_controller_schemas_matches_regis
// Take one registry snapshot: extensions may register concurrently between
// two public lookups, so comparing separate snapshots is racy.
let view = registry_view();
- let caps = crate::core::runtime::context::CoreContext::current_memory_capabilities();
- let visible: Vec<_> = view
- .iter()
- .filter(|g| group_allowed(g.group) && capability_allowed_in(caps, g.capability))
- .collect();
- let schemas: Vec<_> = visible.iter().map(|g| &g.controller.schema).collect();
+ let visible: Vec<_> = view.iter().filter(|g| group_allowed(g.group)).collect();
+ let schemas = visible.iter().map(|g| &g.controller.schema).count();
let controllers = visible.len();
- assert_eq!(schemas, controllers);
+ assert_eq!(schemas.len(), controllers);
}
/// With the `voice` feature on (the default), the voice + audio_toolkit
diff --cc crates/openhuman-core/src/integrations/composio/bus_tests.rs
index 9f61eef10e,d2b37e5407..1f6aea1505
--- a/crates/openhuman-core/src/integrations/composio/bus_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/bus_tests.rs
@@@ -1,14 -1,72 +1,13 @@@
-//! Unit tests for the composio connection-created event handler's gating.
+//! Unit tests for the Composio bus subscribers.
-use super::connection_created_subscriber::toolkit_is_memory_source_registrable;
+use super::connection_created_subscriber::WaitError;
+use super::trigger_subscriber::{triage_disabled, TRIAGE_DISABLED_ENV};
use super::*;
use crate::core::events::DomainEvent;
-use crate::memory::sync::composio::bus::connection_created_subscriber::WaitError;
-use crate::memory::sync::composio::bus::trigger_subscriber::triage_disabled;
-use crate::memory::sync::composio::bus::trigger_subscriber::TRIAGE_DISABLED_ENV;
use serde_json::json;
- use std::sync::Mutex;
use tinybus::EventHandler;
-/// #4957 regression, in the half that is still this host's.
-///
-/// The rule the original test locked — which toolkits have a native pipeline —
-/// is the driver's now (`MemorySourceSync::is_toolkit_syncable`,
-/// tinymemory#106), and it is tested there against the same offenders this one
-/// named: `is_composio_toolkit_syncable("googlecalendar")` is false and
-/// `" Gmail "` is true, so the normalisation is pinned upstream too. Asserting
-/// the list again here would need a loaded module and would only re-check the
-/// driver's answer.
-///
-/// What stays host-side is the **direction the host fails in**, and it is the
-/// half that caused #4957: a toolkit that is auto-registered but cannot sync
-/// reports ACTIVE and then fails forever, which is a silent lie. So when the
-/// driver cannot answer — no binding, no `SourceSync` family, or `Unsupported`
-/// — the host must treat the toolkit as *not* registrable rather than assume
-/// it is fine.
-///
-/// The cannot-answer driver is **installed**, not assumed. This note used to
-/// say "a unit test has no loaded module, so every answer here is the
-/// cannot-answer case" — that is not true: `binding::module_provider`'s
-/// `cfg(test)` arm loads `TINYMEMORY_TEST_MODULE`, which CI sets to the pinned
-/// module, so the test could reach the module's real `SourceSync` and pass
-/// while pinning nothing. It also used `Config::default()`, whose workspace is
-/// the developer's own `~/.openhuman`.
-///
-/// So bind `NullMemoryProvider` — which serves no `SourceSync` family — against
-/// a workspace this test owns. The cannot-answer branch is then the branch
-/// under test by construction, on any machine, with or without the module.
-#[tokio::test]
-async fn a_driver_that_cannot_answer_makes_a_toolkit_not_registrable() {
- let tmp = tempfile::TempDir::new().expect("tempdir");
- let mut config = crate::config::Config::default();
- config.workspace_dir = tmp.path().to_path_buf();
- crate::memory::binding::install_for_test(
- &config.workspace_dir,
- &config.subsystems.memory,
- std::sync::Arc::new(tinymemory_api::null::NullMemoryProvider::new()),
- );
-
- for toolkit in ["gmail", "slack", "github", "googlecalendar", ""] {
- assert!(
- !toolkit_is_memory_source_registrable(&config, toolkit).await,
- "with no module bound, '{toolkit}' must not be registrable — \
- registering a source that then fails every sync is #4957"
- );
- }
-}
-
-// ─── Subscriber wiring and trigger triage ───────────────────────────────────
-//
-// Relocated from `crates/openhuman-core/src/integrations/composio/bus_tests.rs`, which no
-// module ever declared — so these seventeen tests had never compiled or run.
-// They cannot live beside that file: `integrations/composio/bus.rs` is a
-// `pub use ...::bus::*` shim, and a glob re-export cannot carry the private
-// items these assert on (`TRIAGE_DISABLED_ENV`, the parser). They belong here,
-// against the module that actually defines them.
-
-static TRIAGE_ENV_GUARD: tokio::sync::Mutex<()> = tokio::sync::Mutex::const_new(());
+static TRIAGE_ENV_GUARD: Mutex<()> = Mutex::new(());
#[tokio::test]
async fn ignores_non_composio_events() {
diff --cc crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
index 9a2323d303,f5583ddf48..df120e81d7
--- a/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
+++ b/crates/openhuman-core/src/tools/ops_tests_execution_and_serde_tests.rs
@@@ -282,10 -312,10 +282,8 @@@ fn all_tools_registers_brave_engine_and
crate::config::SearchProviderSettings::direct(),
);
cfg.search.brave.api_key = Some("test-brave-key".into());
- cfg.learning.enabled = true;
- cfg.learning.tool_tracking_enabled = true;
- let _env_guard = crate::config::TEST_ENV_LOCK
- .lock()
- .unwrap_or_else(|e| e.into_inner());
+ let _env_guard = crate::config::TEST_ENV_LOCK.blocking_lock();
unsafe {
std::env::set_var(crate::tools::implementations::LSP_ENABLED_ENV, "1");
}
diff --cc crates/openhuman-core/src/web_chat/reply_persistence_tests.rs
index 37292a048d,4dc423d1f2..a01d984f4a
--- a/crates/openhuman-core/src/web_chat/reply_persistence_tests.rs
+++ b/crates/openhuman-core/src/web_chat/reply_persistence_tests.rs
@@@ -1,8 -1,8 +1,8 @@@
- use std::path::PathBuf;
+ use std::path::{Path, PathBuf};
use super::persist_delivered_reply;
-use crate::memory::agent::memory_loader::MemoryCitation;
-use crate::memory::conversations::{self, CreateConversationThread};
+use crate::memory::types::TurnCitation;
+use crate::threads::store::{self as conversations, CreateConversationThread};
fn temp_ws() -> PathBuf {
let dir = std::env::temp_dir().join(format!("web-chat-reply-{}", uuid::Uuid::new_v4()));
diff --cc scripts/ci/module-pin-exemptions.json
index fe985791c9,70631ff109..2898db97f6
--- a/scripts/ci/module-pin-exemptions.json
+++ b/scripts/ci/module-pin-exemptions.json
@@@ -12,34 -12,9 +12,19 @@@
"stopped being true fails the gate too — `expect` must still match."
],
"exemptions": [
- {
- "id": "tinycomputer",
- "expect": "v0.9.0-1-g8b73151a",
- "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released."
- },
- {
- "id": "tinysearch",
- "expect": "v0.3.4-2-g2a71ea9",
- "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released."
- },
- {
- "id": "tinydocs",
- "expect": "v0.1.19-3-g25290eb",
- "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released."
- },
{
"id": "tinywallet",
- "expect": "v0.7.3-2-gb539177",
+ "expect": "v0.7.2-2-g5b18a06",
+ "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released."
+ },
+ {
+ "id": "tinyjuice",
+ "expect": "v0.5.1-2-gb2f7172",
+ "reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released."
+ },
+ {
+ "id": "tinyvoice",
+ "expect": "v0.1.10-2-gb8594d5",
"reason": "Pin carries the legacy test-file rename commits (#6903) past the release tag; re-pin to the next release of this module once its rename PR is released."
},
{
diff --cc tests/in_process/agent_turn_overrides_e2e.rs
index 3612a70f78,2549aa4cf8..d7350fb2f4
--- a/tests/in_process/agent_turn_overrides_e2e.rs
+++ b/tests/in_process/agent_turn_overrides_e2e.rs
@@@ -25,8 -25,9 +25,8 @@@
//! positive here.
#![allow(clippy::await_holding_lock)]
- use crate::env_guard::env_lock;
+ use crate::env_guard::env_lock_async;
use crate::env_guard::EnvVarGuard;
-use crate::noop_memory;
use async_trait::async_trait;
use std::collections::VecDeque;
use std::path::PathBuf;
diff --cc tests/in_process/domain_modules_e2e.rs
index 796785a758,775a4944ac..8c33c22fd0
--- a/tests/in_process/domain_modules_e2e.rs
+++ b/tests/in_process/domain_modules_e2e.rs
@@@ -5,8 -5,9 +5,8 @@@
//! exercises cheap read/status handlers through HTTP. Mutating or networked
//! domain behavior remains covered by the focused `*_e2e.rs` suites.
- use crate::env_guard::env_lock;
+ use crate::env_guard::env_lock_async;
use crate::env_guard::EnvVarGuard;
-use crate::memory_module;
use crate::rpc_harness::serve_rpc;
use crate::rpc_harness::{ok, payload, rpc, schema, write_min_config};
@@@ -401,8 -423,10 +401,8 @@@ async fn config_agent_tools_and_threads
#[tokio::test]
async fn target_domain_read_paths_round_trip_through_json_rpc_transport() {
- let _lock = env_lock();
+ let _lock = env_lock_async().await;
let harness = setup().await;
- // The memory_* reads below reach the driver; wait out the module's load.
- memory_module::settle().await;
let calls = [
("openhuman.config_get_client_config", json!({})),
diff --cc tests/in_process/embeddings_rpc_e2e.rs
index 7cb0707e9d,d3f77ed963..49833cb50f
--- a/tests/in_process/embeddings_rpc_e2e.rs
+++ b/tests/in_process/embeddings_rpc_e2e.rs
@@@ -300,10 -342,11 +300,10 @@@ async fn embeddings_get_settings_return
#[tokio::test(flavor = "multi_thread")]
async fn embeddings_update_settings_switches_provider() {
- let _lock = env_lock();
+ let _lock = env_lock_async().await;
let (rpc_base, _tmp, _guards, _join) = setup_embeddings_test().await;
- // Switch to "none" (noop) which has 0 dimensions — dimension change from
- // the default requires confirm_wipe. We pass it so the update goes through.
+ // Switch to "none" (noop) which has 0 dimensions.
let update = post_json_rpc(
&rpc_base,
2,
diff --cc tests/json_rpc_e2e.rs
index 7a774ac9b2,61e2a2362b..c902c90aff
--- a/tests/json_rpc_e2e.rs
+++ b/tests/json_rpc_e2e.rs
@@@ -39,8 -42,9 +39,8 @@@ static JSON_RPC_AUTH_INIT: OnceLock<()
/// Serializes tests in this binary: `HOME` / `OPENHUMAN_WORKSPACE` / backend URL overrides are
/// process-global, so parallel tests would clobber each other and hit the wrong `config.toml` or
/// inherited `VITE_BACKEND_URL`.
- static JSON_RPC_E2E_ENV_LOCK: OnceLock<Mutex<()>> = OnceLock::new();
+ static JSON_RPC_E2E_ENV_LOCK: OnceLock<tokio::sync::Mutex<()>> = OnceLock::new();
static JSON_RPC_E2E_KEYRING_INIT: OnceLock<()> = OnceLock::new();
-static JSON_RPC_E2E_MEMORY_SEAMS_INIT: OnceLock<()> = OnceLock::new();
static CHAT_COMPLETION_MODELS: OnceLock<Mutex<Vec<String>>> = OnceLock::new();
static CHAT_COMPLETION_REQUESTS: OnceLock<Mutex<Vec<Value>>> = OnceLock::new();
@@@ -48,14 -52,59 +48,11 @@@ async fn json_rpc_e2e_env_lock_async()
JSON_RPC_E2E_KEYRING_INIT.get_or_init(|| unsafe {
std::env::set_var("OPENHUMAN_KEYRING_BACKEND", "file");
});
- let mutex = JSON_RPC_E2E_ENV_LOCK.get_or_init(|| Mutex::new(()));
- // Recover from poison so that a panic in one test does not cascade to all others.
- match mutex.lock() {
- Ok(guard) => guard,
- Err(poisoned) => poisoned.into_inner(),
- }
+ let mutex = JSON_RPC_E2E_ENV_LOCK.get_or_init(|| tokio::sync::Mutex::new(()));
+ // A tokio mutex is never poisoned, so a panic in one test cannot cascade to the others.
+ mutex.lock().await
}
-/// The one memory workspace every case in this binary shares.
-///
-/// The module host captures a workspace **once per process** — `set_modules_policy`
-/// ignores later calls, and the loaded artifact takes its `workspace_dir` at load
-/// time — while each case below gets its own `HOME`. Production never has that
-/// mismatch: boot publishes the runtime config, so the module and the RPC
-/// handlers name one object. This reproduces that arrangement by pointing both
-/// at a single path — the policy below is built from it, and the cases that mix
-/// contract-routed writes with direct-SQLite reads export it as
-/// `OPENHUMAN_WORKSPACE`, which `config::schema::load::env_overlay` honours.
-///
-/// The path ends in `workspace` on purpose: `resolve_config_dir_for_workspace`
-/// treats such a path as the workspace dir itself rather than appending another
-/// `workspace` segment, so the env var and this constant agree exactly.
-fn json_rpc_e2e_shared_workspace() -> &'static Path {
- static SHARED: OnceLock<PathBuf> = OnceLock::new();
- SHARED.get_or_init(|| {
- let tmp = tempdir().expect("shared memory workspace tempdir");
- let path = tmp.path().join("workspace");
- std::fs::create_dir_all(&path).expect("shared memory workspace dir");
- // Outlives every case in the binary; the OS reaps it with the tmpdir.
- std::mem::forget(tmp);
- path
- })
-}
-
-/// The transport-only JSON-RPC router deliberately does not construct a core
-/// runtime context. Install its memory seams once for this integration-test
-/// binary before any router can dispatch a memory-backed method.
-fn ensure_json_rpc_e2e_memory_seams() {
- JSON_RPC_E2E_MEMORY_SEAMS_INIT.get_or_init(|| {
- std::thread::Builder::new()
- .name("json-rpc-e2e-memory-seams".to_string())
- .stack_size(8 * 1024 * 1024)
- .spawn(|| {
- let config = Arc::new(openhuman_core::config::Config {
- workspace_dir: json_rpc_e2e_shared_workspace().to_path_buf(),
- ..openhuman_core::config::Config::default()
- });
- #[cfg(feature = "modules")]
- openhuman_core::modules::memory::set_modules_policy(config);
- })
- .expect("spawn json_rpc e2e memory seam installer")
- .join()
- .expect("json_rpc e2e memory seam installer panicked");
- });
-}
-
fn run_json_rpc_e2e_on_agent_stack<F, Fut>(name: &str, future_factory: F)
where
F: FnOnce() -> Fut + Send + 'static,
@@@ -1174,9 -1224,61 +1171,9 @@@ fn ensure_test_rpc_auth()
});
}
-#[tokio::test]
-async fn json_rpc_discovers_codex_and_claude_sessions_for_memory_ingestion() {
- let _env_lock = json_rpc_e2e_env_lock_async().await;
- let tmp = tempdir().expect("tempdir");
- let home = tmp.path();
- let _home_guard = EnvVarGuard::set_to_path("HOME", home);
- let _workspace_guard =
- EnvVarGuard::set_to_path("OPENHUMAN_WORKSPACE", json_rpc_e2e_shared_workspace());
- let _memory_driver_guard = EnvVarGuard::set("OPENHUMAN_MEMORY_DRIVER", "tinymemory");
- let _backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
- memory_module::settle().await;
- let claude_home = tmp.path().join("claude");
- let codex_home = tmp.path().join("codex");
- let claude_root = claude_home.join("projects/repo");
- let codex_root = codex_home.join("sessions/2026/07/14");
- std::fs::create_dir_all(&claude_root).expect("claude fixture root");
- std::fs::create_dir_all(&codex_root).expect("codex fixture root");
- std::fs::write(
- claude_root.join("session.jsonl"),
- "{\"type\":\"user\",\"timestamp\":\"2026-07-14T00:00:00Z\",\"message\":{\"content\":\"Prefer focused tests\"}}\n",
- )
- .expect("claude fixture");
- std::fs::write(
- codex_root.join("rollout-session.jsonl"),
- "{\"type\":\"response_item\",\"timestamp\":\"2026-07-14T00:00:00Z\",\"payload\":{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"Prefer small modules\"}]}}\n",
- )
- .expect("codex fixture");
-
- let _claude_guard = EnvVarGuard::set_to_path("CLAUDE_CONFIG_DIR", &claude_home);
- let _codex_guard = EnvVarGuard::set_to_path("CODEX_HOME", &codex_home);
- let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
- let rpc_base = format!("http://{rpc_addr}");
-
- let response = post_json_rpc(
- &rpc_base,
- 4_914_001,
- "openhuman.memory_sources_coding_session_status",
- json!({}),
- )
- .await;
- let result = peel_logs_envelope(assert_no_jsonrpc_error(
- &response,
- "memory_sources_coding_session_status",
- ));
- let sources = result["sources"].as_array().expect("sources array");
- assert_eq!(sources.len(), 2);
- assert!(sources.iter().all(|source| source["session_files"] == 1));
- assert!(sources.iter().all(|source| source["evidence_units"] == 1));
-
- rpc_join.abort();
-}
-
#[tokio::test]
async fn json_rpc_config_update_browser_settings_persists_backend() {
- let _env_lock = json_rpc_e2e_env_lock();
+ let _env_lock = json_rpc_e2e_env_lock_async().await;
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
let openhuman_home = home.join(".openhuman");
@@@ -3831,16 -3924,9 +3828,16 @@@ async fn json_rpc_agent_team_coordinati
rpc_join.abort();
}
-#[tokio::test]
-async fn json_rpc_memory_sync_and_learn() {
+#[test]
+fn json_rpc_web_chat_routing_cases_use_expected_backend_models() {
+ run_json_rpc_e2e_on_agent_stack(
+ "json_rpc_web_chat_routing_cases",
+ json_rpc_web_chat_routing_cases_use_expected_backend_models_inner,
+ );
+}
+
+async fn json_rpc_web_chat_routing_cases_use_expected_backend_models_inner() {
- let _env_lock = json_rpc_e2e_env_lock();
+ let _env_lock = json_rpc_e2e_env_lock_async().await;
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
let openhuman_home = home.join(".openhuman");
@@@ -3945,17 -4143,9 +3942,17 @@@
rpc_join.abort();
}
-#[tokio::test]
-async fn json_rpc_memory_tree_end_to_end() {
+#[test]
+fn json_rpc_web_chat_custom_chat_provider_uses_stored_key_and_rebuilds_on_route_change() {
+ run_json_rpc_e2e_on_agent_stack(
+ "json_rpc_web_chat_custom_provider_route_change",
+ json_rpc_web_chat_custom_chat_provider_uses_stored_key_and_rebuilds_on_route_change_inner,
+ );
+}
+
+async fn json_rpc_web_chat_custom_chat_provider_uses_stored_key_and_rebuilds_on_route_change_inner()
+{
- let _env_lock = json_rpc_e2e_env_lock();
+ let _env_lock = json_rpc_e2e_env_lock_async().await;
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
let openhuman_home = home.join(".openhuman");
@@@ -4213,8 -4452,8 +4210,8 @@@ fn json_rpc_web_chat_custom_chat_provid
);
}
-async fn json_rpc_web_chat_routing_cases_use_expected_backend_models_inner() {
+async fn json_rpc_web_chat_custom_chat_provider_with_auth_none_omits_auth_header_inner() {
- let _env_lock = json_rpc_e2e_env_lock();
+ let _env_lock = json_rpc_e2e_env_lock_async().await;
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
let openhuman_home = home.join(".openhuman");
@@@ -4358,70 -4695,139 +4355,70 @@@
Some("/chat/completions")
);
assert!(
- custom_request.get("authorization").and_then(Value::as_str)
- == Some("Bearer sk-custom-openai-key"),
- "custom provider call must use its stored credential"
+ auth_none_request.get("authorization").is_none()
+ || auth_none_request
+ .get("authorization")
+ .is_some_and(Value::is_null),
+ "auth_style=none must not emit Authorization: {:?}",
+ auth_none_request.get("authorization")
+ );
+ assert!(
+ auth_none_request.get("x_api_key").is_none()
+ || auth_none_request
+ .get("x_api_key")
+ .is_some_and(Value::is_null),
+ "auth_style=none must not emit x-api-key: {:?}",
+ auth_none_request.get("x_api_key")
);
- let update_again = post_json_rpc(
- &rpc_base,
- 6005,
- "openhuman.update_model_settings",
- json!({
- "chat_provider": "openai:gpt-4.1-nano"
- }),
- )
- .await;
- assert_no_jsonrpc_error(&update_again, "update_model_settings second");
+ mock_join.abort();
+ rpc_join.abort();
+}
- let events_url = format!("{}/events?client_id={}", rpc_base, client_id);
- let (sse_task, request_tx) = spawn_ready_terminal_web_chat_event_for_request(&events_url).await;
+#[tokio::test]
+async fn json_rpc_rejects_non_object_params_with_clear_error() {
- let _env_lock = json_rpc_e2e_env_lock();
++ let _env_lock = json_rpc_e2e_env_lock_async().await;
+ let tmp = tempdir().expect("tempdir");
+ let home = tmp.path();
+ let openhuman_home = home.join(".openhuman");
- let accepted = post_json_rpc(
+ let _home_guard = EnvVarGuard::set_to_path("HOME", home);
+ let _workspace_guard = EnvVarGuard::unset("OPENHUMAN_WORKSPACE");
+ let _backend_url_guard = EnvVarGuard::unset("BACKEND_URL");
+ let _vite_backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
+
+ let (mock_addr, mock_join) = serve_on_ephemeral(mock_upstream_router()).await;
+ let mock_origin = format!("http://{}", mock_addr);
+ write_min_config(&openhuman_home, &mock_origin);
+
+ let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
+ let rpc_base = format!("http://{}", rpc_addr);
+ tokio::time::sleep(Duration::from_millis(100)).await;
+
+ let invalid = post_json_rpc(
&rpc_base,
- 6006,
- "openhuman.channel_web_chat",
- json!({
- "client_id": client_id,
- "thread_id": thread_id,
- "message": "Route the next turn with the updated model"
- }),
+ 1001,
+ "openhuman.auth_get_state",
+ json!(["invalid", "params"]),
)
.await;
- let accepted_result = assert_no_jsonrpc_error(&accepted, "channel_web_chat second");
- assert_eq!(
- accepted_result
- .get("result")
- .and_then(|v| v.get("accepted")),
- 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)
- .await
- .expect("timed out waiting for second custom-provider chat_done")
- .expect("second custom-provider sse join");
- assert_eq!(
- sse_event.get("event").and_then(Value::as_str),
- Some("chat_done"),
- "unexpected second custom-provider terminal event: {sse_event}; request count={}",
- with_chat_completion_requests(|requests| requests.len())
- );
-
- let requests = wait_for_chat_completion_requests_len(2).await;
- let updated_request = requests
- .iter()
- .find(|request| request.get("model").and_then(Value::as_str) == Some("gpt-4.1-nano"))
- .unwrap_or_else(|| {
- panic!(
- "expected gpt-4.1-nano among {} provider calls",
- requests.len()
- )
- });
- assert_eq!(
- updated_request.get("model").and_then(Value::as_str),
- Some("gpt-4.1-nano"),
- "cached web-chat session should rebuild when chat_provider changes"
- );
- assert!(
- updated_request.get("authorization").and_then(Value::as_str)
- == Some("Bearer sk-custom-openai-key"),
- "updated provider call must use its stored credential"
- );
-
- let events_url = format!("{}/events?client_id={}", rpc_base, client_id);
- let (sse_task, request_tx) = spawn_ready_terminal_web_chat_event_for_request(&events_url).await;
-
- let accepted = post_json_rpc(
- &rpc_base,
- 6007,
- "openhuman.channel_web_chat",
- json!({
- "client_id": client_id,
- "thread_id": thread_id,
- "message": "This turn should stay on the backend agentic route",
- "model_override": "hint:agentic"
- }),
- )
- .await;
- let accepted_result =
- assert_no_jsonrpc_error(&accepted, "channel_web_chat unaffected agentic route");
- assert_eq!(
- accepted_result
- .get("result")
- .and_then(|v| v.get("accepted")),
- 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)
- .await
- .expect("timed out waiting for unaffected agentic chat_done")
- .expect("unaffected agentic sse join");
- assert_eq!(
- sse_event.get("event").and_then(Value::as_str),
- Some("chat_done"),
- "unexpected unaffected-agentic terminal event: {sse_event}; request count={}",
- with_chat_completion_requests(|requests| requests.len())
- );
-
- let agentic_request = wait_for_chat_completion_request_with_message(
- "This turn should stay on the backend agentic route",
- )
- .await;
- assert_eq!(
- agentic_request.get("path").and_then(Value::as_str),
- Some("/openai/v1/chat/completions"),
- "custom reasoning provider must not hijack unrelated backend routes"
- );
- assert_eq!(
- agentic_request.get("model").and_then(Value::as_str),
- Some("openrouter/deepseek/deepseek-v4-flash")
+ let err_message = invalid
+ .get("error")
+ .and_then(|e| e.get("message"))
+ .and_then(Value::as_str)
+ .unwrap_or("");
+ assert!(
+ !err_message.is_empty(),
+ "expected non-empty JSON-RPC error message: {invalid}"
);
mock_join.abort();
rpc_join.abort();
}
-#[test]
-fn json_rpc_web_chat_custom_chat_provider_with_auth_none_omits_auth_header() {
- run_json_rpc_e2e_on_agent_stack(
- "json_rpc_web_chat_custom_provider_auth_none",
- json_rpc_web_chat_custom_chat_provider_with_auth_none_omits_auth_header_inner,
- );
-}
-
-async fn json_rpc_web_chat_custom_chat_provider_with_auth_none_omits_auth_header_inner() {
+#[tokio::test]
+async fn json_rpc_removed_screen_intelligence_methods_are_not_found() {
- let _env_lock = json_rpc_e2e_env_lock();
+ let _env_lock = json_rpc_e2e_env_lock_async().await;
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
let openhuman_home = home.join(".openhuman");
@@@ -4453,8 -4992,8 +4450,8 @@@
}
#[tokio::test]
-async fn json_rpc_rejects_non_object_params_with_clear_error() {
+async fn json_rpc_app_state_snapshot_returns_runtime_shape() {
- let _env_lock = json_rpc_e2e_env_lock();
+ let _env_lock = json_rpc_e2e_env_lock_async().await;
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
let openhuman_home = home.join(".openhuman");
@@@ -10975,11 -11691,820 +10972,11 @@@ fn json_rpc_channel_web_chat_with_speak
run_json_rpc_e2e_on_agent_stack(
"json_rpc_speak_reply_e2e",
json_rpc_channel_web_chat_with_speak_reply_invokes_reply_speech_inner,
- );
-}
-
-async fn json_rpc_channel_web_chat_with_speak_reply_invokes_reply_speech_inner() {
- let _env_lock = json_rpc_e2e_env_lock_async().await;
- let tmp = tempdir().expect("tempdir");
- let home = tmp.path();
- let openhuman_home = home.join(".openhuman");
-
- let _home_guard = EnvVarGuard::set_to_path("HOME", home);
- let _workspace_guard = EnvVarGuard::unset("OPENHUMAN_WORKSPACE");
- let _backend_url_guard = EnvVarGuard::unset("BACKEND_URL");
- let _vite_backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
- // Activate the reply_speech test seam so synthesize_reply records and
- // short-circuits instead of calling the hosted backend.
- let _seam_guard = EnvVarGuard::set(openhuman_core::voice::reply_speech::TEST_SEAM_ENV, "1");
-
- openhuman_core::voice::reply_speech::test_seam::clear();
-
- let (mock_addr, mock_join) = serve_on_ephemeral(mock_upstream_router()).await;
- let mock_origin = format!("http://{}", mock_addr);
-
- write_min_config(&openhuman_home, &mock_origin);
- let user_scoped_dir = openhuman_home.join("users").join("e2e-user");
- write_min_config(&user_scoped_dir, &mock_origin);
-
- let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
- let rpc_base = format!("http://{}", rpc_addr);
- tokio::time::sleep(Duration::from_millis(100)).await;
-
- // Authenticate so the agent loop has a session token available.
- let store = post_json_rpc(
- &rpc_base,
- 9300,
- "openhuman.auth_store_session",
- json!({
- "token": "e2e-test-jwt",
- "user_id": "e2e-user"
- }),
- )
- .await;
- assert_no_jsonrpc_error(&store, "store_session");
-
- let client_id = "ptt-e2e-client";
- let thread_id = "ptt-e2e-thread";
- let events_url = format!("{}/events?client_id={}", rpc_base, client_id);
- let sse_task = tokio::spawn(async move { read_terminal_web_chat_event(&events_url).await });
-
- // PTT-style chat send: speak_reply=true, source=ptt, session_id=1.
- let web_chat = post_json_rpc(
- &rpc_base,
- 9301,
- "openhuman.channel_web_chat",
- json!({
- "client_id": client_id,
- "thread_id": thread_id,
- "message": "Hello from PTT",
- "model_override": "e2e-mock-model",
- "speak_reply": true,
- "source": "ptt",
- "session_id": 1,
- }),
- )
- .await;
- let web_chat_result = assert_no_jsonrpc_error(&web_chat, "channel_web_chat");
- assert_eq!(
- web_chat_result
- .get("result")
- .and_then(|v| v.get("accepted")),
- Some(&json!(true))
- );
-
- let sse_event = tokio::time::timeout(Duration::from_secs(12), sse_task)
- .await
- .expect("timed out waiting for chat_done with speak_reply=true")
- .expect("sse task join should succeed");
- assert_eq!(
- sse_event.get("event").and_then(Value::as_str),
- Some("chat_done"),
- "speak-reply chat must finish successfully; terminal event: {sse_event:?}"
- );
-
- // The bridge should have buffered the streamed assistant text and
- // routed it through synthesize_reply on TurnCompleted. Poll briefly
- // because the bridge task may finish slightly after chat_done.
- let mut observed: Vec<String> = Vec::new();
- for _ in 0..50 {
- observed = openhuman_core::voice::reply_speech::test_seam::observed();
- if !observed.is_empty() {
- break;
- }
- tokio::time::sleep(Duration::from_millis(20)).await;
- }
- assert!(
- !observed.is_empty(),
- "expected reply_speech::synthesize_reply to be invoked when speak_reply=true; observed={observed:?}"
- );
- assert!(
- observed.iter().any(|t| !t.trim().is_empty()),
- "expected at least one non-empty text passed to synthesize_reply; observed={observed:?}"
- );
- assert!(
- observed
- .iter()
- .any(|t| t.contains("Hello from e2e mock agent")),
- "expected the observed seam text to include the mock reply phrase; got {observed:?}"
- );
-
- mock_join.abort();
- rpc_join.abort();
-}
-
-// ── Model resolution and voice settings ─────────────────────────────────
-
-/// E2E: voice-server settings round-trip over JSON-RPC — Phase 2 always-on
-/// toggle + "Hey Tiny" wake word. Regression guard for the bug where the
-/// Settings toggle silently did nothing because `always_on_enabled` was absent
-/// from the `update_voice_server_settings` controller param schema (rejected as
-/// "unknown param 'always_on_enabled'" before reaching the handler).
-#[tokio::test]
-async fn json_rpc_voice_server_settings_roundtrip_always_on_and_wake_word() {
- let _env_lock = json_rpc_e2e_env_lock_async().await;
- let tmp = tempdir().expect("tempdir");
- let home = tmp.path();
- let openhuman_home = home.join(".openhuman");
-
- let _home_guard = EnvVarGuard::set_to_path("HOME", home);
- let _workspace_guard = EnvVarGuard::unset("OPENHUMAN_WORKSPACE");
- let _backend_url_guard = EnvVarGuard::unset("BACKEND_URL");
- let _vite_backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
-
- write_min_config(&openhuman_home, "http://127.0.0.1:9");
-
- let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
- let rpc_base = format!("http://{}", rpc_addr);
- tokio::time::sleep(Duration::from_millis(100)).await;
-
- // GET defaults — wake_word "Hey Tiny", always-on off.
- let initial = post_json_rpc(
- &rpc_base,
- 7401,
- "openhuman.config_get_voice_server_settings",
- json!({}),
- )
- .await;
- let initial_outer = assert_no_jsonrpc_error(&initial, "get_voice_server_settings initial");
- assert_eq!(
- initial_outer
- .get("result")
- .and_then(|r| r.get("always_on_enabled"))
- .and_then(Value::as_bool),
- Some(false),
- "default always_on_enabled should be false, envelope: {initial_outer}"
- );
- assert_eq!(
- initial_outer
- .get("result")
- .and_then(|r| r.get("wake_word"))
- .and_then(Value::as_str),
- Some("Hey Tiny"),
- "default wake_word should be 'Hey Tiny', envelope: {initial_outer}"
- );
-
- // UPDATE — change the wake word and pass `always_on_enabled` (the param that
- // used to be rejected). Kept false so the test never opens a real mic.
- let update = post_json_rpc(
- &rpc_base,
- 7402,
- "openhuman.config_update_voice_server_settings",
- json!({ "always_on_enabled": false, "wake_word": "Computer" }),
- )
- .await;
- assert_no_jsonrpc_error(
- &update,
- "update_voice_server_settings (always_on_enabled + wake_word)",
- );
-
- // GET again — wake word persisted, no error.
- let after = post_json_rpc(
- &rpc_base,
- 7403,
- "openhuman.config_get_voice_server_settings",
- json!({}),
- )
- .await;
- let after_outer = assert_no_jsonrpc_error(&after, "get_voice_server_settings after update");
- assert_eq!(
- after_outer
- .get("result")
- .and_then(|r| r.get("wake_word"))
- .and_then(Value::as_str),
- Some("Computer"),
- "wake_word should persist, envelope: {after_outer}"
- );
-
- rpc_join.abort();
-}
-
-/// Memory-sync schedule (#3302): get defaults → set a 4h cadence → confirm it
-/// persists → switch to Manual only → confirm the flag flips.
-#[tokio::test]
-async fn json_rpc_memory_sync_settings_roundtrip_interval_and_manual() {
- let _env_lock = json_rpc_e2e_env_lock_async().await;
- let tmp = tempdir().expect("tempdir");
- let home = tmp.path();
- let openhuman_home = home.join(".openhuman");
-
- let _home_guard = EnvVarGuard::set_to_path("HOME", home);
- let _workspace_guard = EnvVarGuard::unset("OPENHUMAN_WORKSPACE");
- let _backend_url_guard = EnvVarGuard::unset("BACKEND_URL");
- let _vite_backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
- // The global override would mask the persisted value; keep it unset here.
- let _interval_guard = EnvVarGuard::unset("OPENHUMAN_MEMORY_SYNC_INTERVAL_SECS");
-
- write_min_config(&openhuman_home, "http://127.0.0.1:9");
-
- let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
- let rpc_base = format!("http://{}", rpc_addr);
- tokio::time::sleep(Duration::from_millis(100)).await;
-
- // GET defaults — unset stored value, but a resolved 24h selected cadence.
- let initial = post_json_rpc(
- &rpc_base,
- 7501,
- "openhuman.config_get_memory_sync_settings",
- json!({}),
- )
- .await;
- let initial_outer = assert_no_jsonrpc_error(&initial, "get_memory_sync_settings initial");
- let initial_result = initial_outer.get("result").unwrap_or(initial_outer);
- assert!(
- initial_result.get("sync_interval_secs").map(Value::is_null) == Some(true),
- "default stored value should be null, envelope: {initial_outer}"
- );
- assert_eq!(
- initial_result.get("is_default").and_then(Value::as_bool),
- Some(true),
- "fresh config should report is_default=true, envelope: {initial_outer}"
- );
- assert_eq!(
- initial_result.get("selected_secs").and_then(Value::as_u64),
- Some(86_400),
- "selected cadence should resolve to the 24h default, envelope: {initial_outer}"
- );
-
- // UPDATE — pick the 4h preset.
- let update = post_json_rpc(
- &rpc_base,
- 7502,
- "openhuman.config_update_memory_sync_settings",
- json!({ "sync_interval_secs": 14400 }),
- )
- .await;
- let update_outer = assert_no_jsonrpc_error(&update, "update_memory_sync_settings 4h");
- let update_result = update_outer.get("result").unwrap_or(update_outer);
- assert_eq!(
- update_result
- .get("sync_interval_secs")
- .and_then(Value::as_u64),
- Some(14_400),
- "4h cadence should be stored, envelope: {update_outer}"
- );
- assert_eq!(
- update_result.get("is_manual").and_then(Value::as_bool),
- Some(false)
- );
-
- // GET again — the 4h cadence persists across the round-trip.
- let after = post_json_rpc(
- &rpc_base,
- 7503,
- "openhuman.config_get_memory_sync_settings",
- json!({}),
- )
- .await;
- let after_outer = assert_no_jsonrpc_error(&after, "get_memory_sync_settings after 4h");
- let after_result = after_outer.get("result").unwrap_or(after_outer);
- assert_eq!(
- after_result
- .get("sync_interval_secs")
- .and_then(Value::as_u64),
- Some(14_400),
- "4h cadence should persist, envelope: {after_outer}"
- );
-
- // UPDATE — switch to Manual only (0).
- let manual = post_json_rpc(
- &rpc_base,
- 7504,
- "openhuman.config_update_memory_sync_settings",
- json!({ "sync_interval_secs": 0 }),
- )
- .await;
- let manual_outer = assert_no_jsonrpc_error(&manual, "update_memory_sync_settings manual");
- let manual_result = manual_outer.get("result").unwrap_or(manual_outer);
- assert_eq!(
- manual_result.get("is_manual").and_then(Value::as_bool),
- Some(true),
- "0 should flip is_manual, envelope: {manual_outer}"
- );
-
- // GET once more — manual mode persisted (stored value 0, is_manual true).
- let manual_get = post_json_rpc(
- &rpc_base,
- 7505,
- "openhuman.config_get_memory_sync_settings",
- json!({}),
- )
- .await;
- let manual_get_outer = assert_no_jsonrpc_error(&manual_get, "get_memory_sync_settings manual");
- let manual_get_result = manual_get_outer.get("result").unwrap_or(manual_get_outer);
- assert_eq!(
- manual_get_result.get("is_manual").and_then(Value::as_bool),
- Some(true),
- "manual mode should persist across a GET, envelope: {manual_get_outer}"
- );
- assert_eq!(
- manual_get_result
- .get("sync_interval_secs")
- .and_then(Value::as_u64),
- Some(0),
- "manual stored value should be 0, envelope: {manual_get_outer}"
- );
-
- rpc_join.abort();
-}
-
-/// Ops / headless path (#3302): a fleet operator sets
-/// `OPENHUMAN_MEMORY_SYNC_INTERVAL_SECS` in the environment, and the running
-/// core surfaces that cadence through `config_get_memory_sync_settings` with no
-/// UI interaction. Verifies the env override flows all the way through the RPC.
-/// (The `0` = "Manual only" sentinel on the env path is covered at the parse
-/// layer by `env_overlay_memory_sync_interval_parses_and_honours_zero`.)
-#[tokio::test]
-async fn json_rpc_memory_sync_settings_env_override_is_reflected() {
- let _env_lock = json_rpc_e2e_env_lock_async().await;
- let tmp = tempdir().expect("tempdir");
- let home = tmp.path();
- let openhuman_home = home.join(".openhuman");
-
- let _home_guard = EnvVarGuard::set_to_path("HOME", home);
- let _workspace_guard = EnvVarGuard::unset("OPENHUMAN_WORKSPACE");
- let _backend_url_guard = EnvVarGuard::unset("BACKEND_URL");
- let _vite_backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
- // Operator sets an 8h cadence via the environment (not a UI write).
- let _interval_guard = EnvVarGuard::set("OPENHUMAN_MEMORY_SYNC_INTERVAL_SECS", "28800");
-
- write_min_config(&openhuman_home, "http://127.0.0.1:9");
-
- let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
- let rpc_base = format!("http://{}", rpc_addr);
- tokio::time::sleep(Duration::from_millis(100)).await;
-
- // GET reflects the env-provided cadence even though config.toml never set it.
- let resp = post_json_rpc(
- &rpc_base,
- 7601,
- "openhuman.config_get_memory_sync_settings",
- json!({}),
- )
- .await;
- let outer = assert_no_jsonrpc_error(&resp, "get_memory_sync_settings env-override");
- let result = outer.get("result").unwrap_or(outer);
- assert_eq!(
- result.get("sync_interval_secs").and_then(Value::as_u64),
- Some(28_800),
- "env override should surface via RPC, envelope: {outer}"
- );
- assert_eq!(
- result.get("selected_secs").and_then(Value::as_u64),
- Some(28_800),
- "selected cadence should match the env override, envelope: {outer}"
- );
- assert_eq!(
- result.get("is_default").and_then(Value::as_bool),
- Some(false),
- "an env-provided value is not the default, envelope: {outer}"
- );
-
- rpc_join.abort();
-}
-
-#[tokio::test]
-async fn json_rpc_memory_sources_conversation_crud() {
- let _env_lock = json_rpc_e2e_env_lock_async().await;
- let tmp = tempdir().expect("tempdir");
- let home = tmp.path();
- let _home_guard = EnvVarGuard::set_to_path("HOME", home);
- let _ws_guard = EnvVarGuard::set_to_path("OPENHUMAN_WORKSPACE", home);
- let _action_guard = EnvVarGuard::set_to_path("OPENHUMAN_ACTION_DIR", home);
- let _backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
-
- let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
- let rpc_base = format!("http://{rpc_addr}");
-
- // 1. Add a conversation source
- let add_resp = post_json_rpc(
- &rpc_base,
- 9501,
- "openhuman.memory_sources_add",
- json!({
- "kind": "conversation",
- "label": "Agent Conversations",
- "enabled": true
- }),
- )
- .await;
- let add_result = assert_no_jsonrpc_error(&add_resp, "memory_sources_add conversation");
- let source = add_result
- .get("source")
- .expect("add should return source object");
- let source_id = source
- .get("id")
- .and_then(Value::as_str)
- .expect("source must have id");
- assert_eq!(
- source.get("kind").and_then(Value::as_str),
- Some("conversation")
- );
- assert_eq!(
- source.get("label").and_then(Value::as_str),
- Some("Agent Conversations")
- );
- assert_eq!(source.get("enabled").and_then(Value::as_bool), Some(true));
-
- // 2. List sources — should contain our conversation source
- let list_resp =
- post_json_rpc(&rpc_base, 9502, "openhuman.memory_sources_list", json!({})).await;
- let list_result = assert_no_jsonrpc_error(&list_resp, "memory_sources_list");
- let sources = list_result
- .get("sources")
- .and_then(Value::as_array)
- .expect("list should return sources array");
- let conversation_sources: Vec<&Value> = sources
- .iter()
- .filter(|s| s.get("kind").and_then(Value::as_str) == Some("conversation"))
- .collect();
- assert_eq!(
- conversation_sources.len(),
- 1,
- "exactly one conversation source after add"
- );
-
- // 3. Get the source by id
- let get_resp = post_json_rpc(
- &rpc_base,
- 9503,
- "openhuman.memory_sources_get",
- json!({ "id": source_id }),
- )
- .await;
- let get_result = assert_no_jsonrpc_error(&get_resp, "memory_sources_get");
- assert_eq!(
- get_result
- .get("source")
- .and_then(|s| s.get("kind"))
- .and_then(Value::as_str),
- Some("conversation")
- );
-
- // 4. Update — disable the source
- let update_resp = post_json_rpc(
- &rpc_base,
- 9504,
- "openhuman.memory_sources_update",
- json!({ "id": source_id, "enabled": false }),
- )
- .await;
- let update_result = assert_no_jsonrpc_error(&update_resp, "memory_sources_update");
- assert_eq!(
- update_result
- .get("source")
- .and_then(|s| s.get("enabled"))
- .and_then(Value::as_bool),
- Some(false),
- "source should be disabled after update"
- );
-
- // 5. Remove the source
- let remove_resp = post_json_rpc(
- &rpc_base,
- 9505,
- "openhuman.memory_sources_remove",
- json!({ "id": source_id }),
- )
- .await;
- let remove_result = assert_no_jsonrpc_error(&remove_resp, "memory_sources_remove");
- assert_eq!(
- remove_result.get("removed").and_then(Value::as_bool),
- Some(true)
- );
-
- // 6. List again — empty
- let list2_resp =
- post_json_rpc(&rpc_base, 9506, "openhuman.memory_sources_list", json!({})).await;
- let list2_result = assert_no_jsonrpc_error(&list2_resp, "memory_sources_list after remove");
- let sources2 = list2_result
- .get("sources")
- .and_then(Value::as_array)
- .expect("list should return sources array");
- let conv_remaining: Vec<&Value> = sources2
- .iter()
- .filter(|s| s.get("kind").and_then(Value::as_str) == Some("conversation"))
- .collect();
- assert!(
- conv_remaining.is_empty(),
- "no conversation sources after remove"
- );
-
- rpc_join.abort();
-}
-
-/// Raw-archive coverage reconcile over JSON-RPC: a GitHub source whose raw
-/// archive holds files that no tree summary covers must be reported as
-/// pending by `openhuman.memory_sources_reconcile` (report-only mode).
-/// Regression for the silent divergence where thousands of raw files sat
-/// unsummarised with no way to see or repair it.
-#[tokio::test]
-async fn json_rpc_memory_sources_reconcile_reports_pending_raw_files() {
- let _env_lock = json_rpc_e2e_env_lock_async().await;
- let tmp = tempdir().expect("tempdir");
- let home = tmp.path();
- let _home_guard = EnvVarGuard::set_to_path("HOME", home);
- // `reconcile_rpc` resolves the bound driver (`as_source_sync`), so it reads
- // the module's store while the raw files below are planted on disk. Both
- // must name one workspace — see `json_rpc_e2e_shared_workspace`.
- let _ws_guard =
- EnvVarGuard::set_to_path("OPENHUMAN_WORKSPACE", json_rpc_e2e_shared_workspace());
- let _action_guard = EnvVarGuard::set_to_path("OPENHUMAN_ACTION_DIR", home);
- let _backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
- // reconcile reads the module's store; wait out the module's load first.
- memory_module::settle().await;
-
- let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
- let rpc_base = format!("http://{rpc_addr}");
-
- // 1. Register a GitHub repo source (no sync — we plant the archive).
- let add_resp = post_json_rpc(
- &rpc_base,
- 9601,
- "openhuman.memory_sources_add",
- json!({
- "kind": "github_repo",
- "label": "Repo",
- "enabled": true,
- "url": "https://github.com/owner/repo"
- }),
- )
- .await;
- let add_result = assert_no_jsonrpc_error(&add_resp, "memory_sources_add github_repo");
- let source_id = add_result
- .get("source")
- .and_then(|s| s.get("id"))
- .and_then(Value::as_str)
- .expect("source must have id")
- .to_string();
-
- // 2. Plant two uncovered raw archive files where a fetch would write
- // them: <workspace>/memory_tree/content/raw/github-com-owner-repo/.
- // `OPENHUMAN_WORKSPACE` is the shared workspace above, and its basename
- // is `workspace`, so `resolve_config_dir_for_workspace` returns it
- // unchanged rather than appending a second segment.
- let commits_dir = json_rpc_e2e_shared_workspace()
- .join("memory_tree")
- .join("content")
- .join("raw")
- .join("github-com-owner-repo")
- .join("commits");
- std::fs::create_dir_all(&commits_dir).expect("create raw commits dir");
- std::fs::write(commits_dir.join("1000_aaa.md"), "commit one").expect("write raw");
- std::fs::write(commits_dir.join("2000_bbb.md"), "commit two").expect("write raw");
-
- // 3. Report-only reconcile must surface both files as pending.
- let reconcile_resp = post_json_rpc(
- &rpc_base,
- 9602,
- "openhuman.memory_sources_reconcile",
- json!({ "source_id": source_id }),
- )
- .await;
- let reconcile_result = assert_no_jsonrpc_error(&reconcile_resp, "memory_sources_reconcile");
- let scopes = reconcile_result
- .get("scopes")
- .and_then(Value::as_array)
- .expect("reconcile should return scopes array");
- assert_eq!(scopes.len(), 1, "one scope for one github source");
- let scope = &scopes[0];
- assert_eq!(
- scope.get("tree_scope").and_then(Value::as_str),
- Some("github:owner/repo")
- );
- assert_eq!(
- scope.get("total_raw_files").and_then(Value::as_u64),
- Some(2)
- );
- assert_eq!(scope.get("covered").and_then(Value::as_u64), Some(0));
- assert_eq!(scope.get("pending").and_then(Value::as_u64), Some(2));
- assert_eq!(
- scope.get("started").and_then(Value::as_bool),
- Some(false),
- "report-only call must not start a reconcile"
- );
-
- rpc_join.abort();
-}
-
-// ── Memory sources: active-connection filtering over JSON-RPC ────────────────
-
-/// Mock Composio v3 `/connected_accounts`. Returns a single ACTIVE Gmail
-/// connection (`conn_active_gmail`); any other connection_id is, by omission,
-/// treated as inactive by the scan.
-fn mock_composio_connected_accounts_router() -> Router {
- async fn connected_accounts() -> Json<Value> {
- Json(json!({
- "items": [
- {
- "id": "conn_active_gmail",
- "status": "ACTIVE",
- "toolkit": "gmail",
- "created_at": "2026-01-01T00:00:00Z"
- }
- ]
- }))
- }
- Router::new().route("/connected_accounts", get(connected_accounts))
-}
-
-/// Write a minimal config that selects Composio **direct** mode with an inline
-/// API key, so `scan_active_sync_targets` resolves a direct client that hits the
-/// loopback mock pointed at by `OPENHUMAN_COMPOSIO_DIRECT_BASE_V3`.
-fn write_composio_direct_config(openhuman_dir: &Path, api_origin: &str) {
- let cfg = format!(
- r#"api_url = "{api_origin}"
-default_model = "e2e-mock-model"
-default_temperature = 0.7
-chat_onboarding_completed = true
-
-[secrets]
-encrypt = false
-
-[composio]
-mode = "direct"
-api_key = "ck_e2e_test"
-"#
- );
- fn write_config_file(config_dir: &Path, cfg: &str) {
- std::fs::create_dir_all(config_dir).expect("mkdir openhuman");
- std::fs::write(config_dir.join("config.toml"), cfg).expect("write config");
- }
- write_config_file(openhuman_dir, &cfg);
- if openhuman_dir
- .file_name()
- .is_some_and(|name| name == std::ffi::OsStr::new(".openhuman"))
- {
- write_config_file(&openhuman_dir.join("users").join("local"), &cfg);
- }
- let _: openhuman_core::config::Config =
- toml::from_str(&cfg).expect("config toml must match Config schema");
-}
-
-async fn add_composio_memory_source(
- rpc_base: &str,
- id: i64,
- label: &str,
- toolkit: &str,
- connection_id: &str,
-) {
- let add = post_json_rpc(
- rpc_base,
- id,
- "openhuman.memory_sources_add",
- json!({
- "kind": "composio",
- "label": label,
- "toolkit": toolkit,
- "connection_id": connection_id
- }),
- )
- .await;
- assert_no_jsonrpc_error(&add, "memory_sources_add (composio)");
-}
-
-async fn add_folder_memory_source(rpc_base: &str, id: i64, label: &str, path: &str) {
- let add = post_json_rpc(
- rpc_base,
- id,
- "openhuman.memory_sources_add",
- json!({ "kind": "folder", "label": label, "path": path }),
- )
- .await;
- assert_no_jsonrpc_error(&add, "memory_sources_add (folder)");
-}
-
-/// Extract the `sources` array from a `memory_sources_list` result, tolerating
-/// both the bare value and the `{ result, logs }` envelope shape.
-fn memory_sources_from_list(result: &Value) -> &Vec<Value> {
- result
- .get("result")
- .unwrap_or(result)
- .get("sources")
- .and_then(Value::as_array)
- .unwrap_or_else(|| panic!("memory_sources_list missing sources array: {result}"))
-}
-
-/// End-to-end: `memory_sources_list` hides Composio rows whose connection is no
-/// longer active and collapses identical same-`connection_id` duplicates, while
-/// always showing non-Composio sources — driven by a real active scan against a
-/// mock Composio `/connected_accounts` endpoint.
-#[tokio::test]
-async fn json_rpc_memory_sources_list_filters_to_active_connections() {
- let _env_lock = json_rpc_e2e_env_lock_async().await;
- let tmp = tempdir().expect("tempdir");
- let home = tmp.path();
- let openhuman_home = home.join(".openhuman");
-
- let _home_guard = EnvVarGuard::set_to_path("HOME", home);
- let _workspace_guard = EnvVarGuard::unset("OPENHUMAN_WORKSPACE");
- let _backend_url_guard = EnvVarGuard::unset("BACKEND_URL");
- let _vite_backend_guard = EnvVarGuard::unset("VITE_BACKEND_URL");
-
- // Mock Composio direct endpoint — only conn_active_gmail is ACTIVE.
- let (composio_addr, composio_join) =
- serve_on_ephemeral(mock_composio_connected_accounts_router()).await;
- let composio_base = format!("http://{composio_addr}");
- let _v2_guard = EnvVarGuard::set("OPENHUMAN_COMPOSIO_DIRECT_BASE_V2", &composio_base);
- let _v3_guard = EnvVarGuard::set("OPENHUMAN_COMPOSIO_DIRECT_BASE_V3", &composio_base);
-
- write_composio_direct_config(&openhuman_home, "http://127.0.0.1:1");
-
- let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
- let rpc_base = format!("http://{rpc_addr}");
-
- // Seed the registry: an active row, an identical duplicate of it (RC-B), a
- // stale row whose connection is no longer active (RC-A), and a folder.
- // memory_sources_add keys only on the generated src_ id, so the duplicate
- // and stale composio rows both persist into config.memory_sources.
- add_composio_memory_source(
- &rpc_base,
- 8801,
- "Gmail · active",
- "gmail",
- "conn_active_gmail",
- )
- .await;
- add_composio_memory_source(
- &rpc_base,
- 8802,
- "Gmail · active dup",
- "gmail",
- "conn_active_gmail",
- )
- .await;
- add_composio_memory_source(
- &rpc_base,
- 8803,
- "Gmail · stale",
- "gmail",
- "conn_stale_gmail",
- )
- .await;
- add_folder_memory_source(&rpc_base, 8804, "My notes", "/tmp/notes").await;
-
- // Probe the exact chain the filter depends on FIRST, so a broken scan
- // fails here with its real error instead of downstream as a silently
- // fail-open (unfiltered) listing.
- let probe = post_json_rpc(
- &rpc_base,
- 8899,
- "openhuman.composio_list_connections",
- json!({}),
- )
- .await;
- let probe_result = assert_no_jsonrpc_error(&probe, "composio_list_connections probe").clone();
- let probe_text = probe_result.to_string();
- assert!(
- probe_text.contains("conn_active_gmail"),
- "the connections probe must see the mock's active set; got {probe_text}"
- );
-
- let list = post_json_rpc(&rpc_base, 8805, "openhuman.memory_sources_list", json!({})).await;
- let result = assert_no_jsonrpc_error(&list, "memory_sources_list").clone();
- let sources = memory_sources_from_list(&result);
-
- // Only the active connection shows, exactly once (stale hidden, dupe collapsed).
- let composio_conn_ids: Vec<&str> = sources
- .iter()
- .filter(|s| s.get("kind").and_then(Value::as_str) == Some("composio"))
- .filter_map(|s| s.get("connection_id").and_then(Value::as_str))
- .collect();
- assert_eq!(
- composio_conn_ids,
- vec!["conn_active_gmail"],
- "only the active connection should list, exactly once; got sources={sources:?}"
- );
-
- // Non-Composio sources are always shown regardless of the active set.
- assert!(
- sources
- .iter()
- .any(|s| s.get("kind").and_then(Value::as_str) == Some("folder")),
- "folder source must always be listed; got sources={sources:?}"
- );
-
- rpc_join.abort();
- composio_join.abort();
+ );
}
-/// Safety: when the live Composio scan is unavailable (here the direct endpoint
-/// is unreachable), `memory_sources_list` must show **all** sources rather than
-/// hiding every Composio row — a transient outage must never read as "all
-/// inactive".
-#[tokio::test]
-async fn json_rpc_memory_sources_list_shows_all_when_scan_unavailable() {
+async fn json_rpc_channel_web_chat_with_speak_reply_invokes_reply_speech_inner() {
- let _env_lock = json_rpc_e2e_env_lock();
+ let _env_lock = json_rpc_e2e_env_lock_async().await;
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
let openhuman_home = home.join(".openhuman");
@@@ -11087,16 -12551,28 +11084,16 @@@
rpc_join.abort();
}
-/// Mock Composio v3 `/connected_accounts` returning **two** distinct ACTIVE
-/// Gmail connections — exercises multiple-account-per-toolkit support (#3443).
-fn mock_composio_two_gmail_accounts_router() -> Router {
- async fn connected_accounts() -> Json<Value> {
- Json(json!({
- "items": [
- { "id": "conn_gmail_one", "status": "ACTIVE", "toolkit": "gmail", "created_at": "2026-01-01T00:00:00Z" },
- { "id": "conn_gmail_two", "status": "ACTIVE", "toolkit": "gmail", "created_at": "2026-01-02T00:00:00Z" }
- ]
- }))
- }
- Router::new().route("/connected_accounts", get(connected_accounts))
-}
+// ── Model resolution and voice settings ─────────────────────────────────
-/// Regression for #3443 (multiple account connections per toolkit): two
-/// *distinct* active connections of the same toolkit (two Gmail accounts) must
-/// **both** be listed. Our filter keys on `connection_id`, never on toolkit, so
-/// it must not collapse them — while a third, stale Gmail connection (absent
-/// from the active scan) is still hidden.
+/// E2E: voice-server settings round-trip over JSON-RPC — Phase 2 always-on
+/// toggle + "Hey Tiny" wake word. Regression guard for the bug where the
+/// Settings toggle silently did nothing because `always_on_enabled` was absent
+/// from the `update_voice_server_settings` controller param schema (rejected as
+/// "unknown param 'always_on_enabled'" before reaching the handler).
#[tokio::test]
-async fn json_rpc_memory_sources_list_keeps_multiple_active_connections_per_toolkit() {
+async fn json_rpc_voice_server_settings_roundtrip_always_on_and_wake_word() {
- let _env_lock = json_rpc_e2e_env_lock();
+ let _env_lock = json_rpc_e2e_env_lock_async().await;
let tmp = tempdir().expect("tempdir");
let home = tmp.path();
let openhuman_home = home.join(".openhuman");
diff --cc tests/raw_coverage/composio_raw_coverage_e2e.rs
index ceaf978e7f,c1c86a2890..0bdc36dfa8
--- a/tests/raw_coverage/composio_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/composio_raw_coverage_e2e.rs
@@@ -204,14 -206,19 +206,14 @@@ fn composio_client_factory_modes_are_de
#[tokio::test]
async fn composio_controller_registry_and_scope_handlers_cover_validation_edges() {
let _env_lock = ENV_LOCK
- .get_or_init(|| Mutex::new(()))
+ .get_or_init(|| tokio::sync::Mutex::new(()))
.lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner());
+ .await;
crate::tinyhumans_boot::boot();
// The controller loads config through the process workspace resolver. Pin
- // this test to a null memory driver so its fail-closed assertion does not
- // depend on a developer's local config or attempt to load TinyMemory.
+ // the test to an isolated workspace so the scope store does not depend on
+ // a developer's local config.
let workspace = tempdir().expect("isolated workspace");
- std::fs::write(
- workspace.path().join("config.toml"),
- "[subsystems.memory]\ndriver = \"null\"\n",
- )
- .expect("write isolated memory config");
let _workspace = WorkspaceEnvGuard::set(workspace.path());
let schemas = all_composio_controller_schemas();
let registered = all_composio_registered_controllers();