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
test(channels): load the staged module releases in the native Telegram E2E
M3gA-Mindf8b6a20f513e
diff --git a/scripts/__tests__/test-module-installation.test.mjs b/scripts/__tests__/test-module-installation.test.mjsindex 3482ed0afc..e4d0e187b3 100644--- a/scripts/__tests__/test-module-installation.test.mjs+++ b/scripts/__tests__/test-module-installation.test.mjs@@ -174,6 +174,22 @@ test("CI exports the staged TinyChannels library for its runtime suite", () => {);});+test("CI exports the staged TinyVoice library without putting it on the search path", () => {+ const source = readFileSync(installer, "utf8");+ assert.match(+ source,+ /echo "OPENHUMAN_VOICE_TEST_ARTIFACT=\$\{tinyvoice_artifact\}"/,+ "the native Telegram voice-note E2E loads the verified TinyVoice artifact by file",+ );+ const searchPath = source.match(/^for id in ([^;]+); do$/m);+ assert.ok(searchPath, "the installer lists its search-path modules");+ assert.doesNotMatch(+ searchPath[1],+ /\btinyvoice\b/,+ "staging TinyVoice must not make every other suite load it",+ );+});+test("MCP registry Rust integration tests run serially", () => {const source = readFileSync(localRustRunner, "utf8");assert.match(@@ -311,6 +327,7 @@ for (const id of ["tinychannels","tinymcp","tinyhosts",+ "tinyvoice",]) {test(`native ${id} regressions receive their pinned release fixture`, () => {const assets = resolveTestModuleAssets(diff --git a/scripts/ci/self-hosted/install-test-modules.sh b/scripts/ci/self-hosted/install-test-modules.shindex 5532fb1eae..1daffe2d08 100755--- a/scripts/ci/self-hosted/install-test-modules.sh+++ b/scripts/ci/self-hosted/install-test-modules.sh@@ -79,10 +79,19 @@ if [ -z "${tinychannels_artifact}" ]; thenecho "::error::the tinychannels release holds no module library" >&2exit 1fi+# TinyVoice stays off the search path so no other suite starts loading it;+# the native Telegram voice-note E2E loads it by file.+tinyvoice_artifact="$(find "${dest}/tinyvoice" -maxdepth 2 -type f \+ \( -name libtinyvoice_module.so -o -name libtinyvoice_module.dylib -o -name tinyvoice_module.dll \) | head -n 1)"+if [ -z "${tinyvoice_artifact}" ]; then+ echo "::error::the tinyvoice release holds no module library" >&2+ exit 1+fi{echo "OPENHUMAN_MODULE_PATH=${module_dirs}${OPENHUMAN_MODULE_PATH:+:$OPENHUMAN_MODULE_PATH}"echo "OPENHUMAN_TINYMCP_TEST_MODULE=${tinymcp_artifact}"echo "OPENHUMAN_CHANNELS_TEST_ARTIFACT=${tinychannels_artifact}"+ echo "OPENHUMAN_VOICE_TEST_ARTIFACT=${tinyvoice_artifact}"echo "OPENHUMAN_TEST_MODULES_STAGED=1"} > "${env_file}"log "wrote ${env_file}"diff --git a/scripts/ci/self-hosted/test-module-assets.mjs b/scripts/ci/self-hosted/test-module-assets.mjsindex 2d1014074d..47a8538027 100644--- a/scripts/ci/self-hosted/test-module-assets.mjs+++ b/scripts/ci/self-hosted/test-module-assets.mjs@@ -29,6 +29,7 @@ export const TEST_MODULE_IDS = ["tinyhosts","tinyconnectors","tinyflows",+ "tinyvoice",];/** Concatenate registry.rs and its `registry/records_*.rs` fragments. */diff --git a/scripts/modules/stage-local-modules.sh b/scripts/modules/stage-local-modules.shindex dd999e802c..44b8fa319f 100644--- a/scripts/modules/stage-local-modules.sh+++ b/scripts/modules/stage-local-modules.sh@@ -36,6 +36,19 @@ stage_release_module() {printf '%s\n' "$dir"}+# stage_release_artifact <id> <host-platform> <ext>; prints the staged module+# library itself, for tests that load a module by file rather than through+# OPENHUMAN_MODULE_PATH.+stage_release_artifact() {+ local id="$1" dir+ dir="$(stage_release_module "$id" "$2" "$3")"+ if [ "$3" = "dll" ]; then+ printf '%s\n' "$dir/${id}_module.dll"+ else+ printf '%s\n' "$dir/lib${id}_module.$3"+ fi+}+# stage_source_modules <id>... : build from the pinned submodules into the# default out dir (target/module-sources/<id>/). The runners put the directories# they want on OPENHUMAN_MODULE_PATH themselves, so a module is visible only todiff --git a/scripts/test-rust-e2e.sh b/scripts/test-rust-e2e.shindex 2bf0e477bc..508ce63795 100755--- a/scripts/test-rust-e2e.sh+++ b/scripts/test-rust-e2e.sh@@ -236,6 +236,17 @@ elsedonefi+# The native Telegram E2E loads TinyChannels and TinyVoice by file. The CI+# installer exports both; stage the same pinned releases when it has not.+if [ -z "${OPENHUMAN_CHANNELS_TEST_ARTIFACT:-}" ]; then+ OPENHUMAN_CHANNELS_TEST_ARTIFACT="$(stage_release_artifact tinychannels "$module_platform" "$module_ext")"+ export OPENHUMAN_CHANNELS_TEST_ARTIFACT+fi+if [ -z "${OPENHUMAN_VOICE_TEST_ARTIFACT:-}" ]; then+ OPENHUMAN_VOICE_TEST_ARTIFACT="$(stage_release_artifact tinyvoice "$module_platform" "$module_ext")"+ export OPENHUMAN_VOICE_TEST_ARTIFACT+fi+# Module-backed Composio coverage must use a staged artifact as well. Without# it the core resolves TinyConnectors through release metadata at run time,# turning an otherwise hermetic mock-backend suite into a network dependencydiff --git a/scripts/test-rust-with-mock.sh b/scripts/test-rust-with-mock.shindex 61cb16b6ba..cb27860ec3 100755--- a/scripts/test-rust-with-mock.sh+++ b/scripts/test-rust-with-mock.sh@@ -183,6 +183,12 @@ elsefiexport OPENHUMAN_CHANNELS_TEST_ARTIFACT="$tinychannels_artifact"+# The native Telegram voice-note E2E loads the released TinyVoice by file, as+# the CI installer exports it. It stays off OPENHUMAN_MODULE_PATH so no other+# suite starts loading it.+OPENHUMAN_VOICE_TEST_ARTIFACT="$(stage_release_artifact tinyvoice "$wallet_platform" "$module_ext")"+export OPENHUMAN_VOICE_TEST_ARTIFACT+# The MCP registry E2E targets exercise real TinyMCP lifecycle calls through# the host's module adapter, so they load the released, checksum-pinned module# just as the self-hosted CI installer does (source mode builds it instead).diff --git a/tests/native_channel_session_restart_e2e.rs b/tests/native_channel_session_restart_e2e.rsindex f10904d86e..16ae57c49b 100644--- a/tests/native_channel_session_restart_e2e.rs+++ b/tests/native_channel_session_restart_e2e.rs@@ -5,9 +5,11 @@//! new update for the same Telegram conversation. The second model request//! must contain the first user's message from the session transcript.//!-//! Both Telegram and inference are loopback mocks. This target loads a locally-//! compiled TinyChannels module so it exercises the native Telegram listener-//! through the production TinyBus artifact path.+//! Both Telegram and inference are loopback mocks. This target loads a real+//! TinyChannels (and, for voice, TinyVoice) module so it exercises the native+//! Telegram listener through the production TinyBus artifact path: the+//! registry-pinned release the test runner staged, or a local build (see+//! [`TestModules`]).use std::collections::VecDeque;use std::fs::File;@@ -409,11 +411,65 @@ fn media_update(json!({ "update_id": update_id, "message": message })}-fn write_config(home: &Path, workspace: &Path, inference: &str) {+/// Where the child core loads TinyChannels (and TinyVoice) from.+///+/// CI stages the registry-pinned, digest-verified releases and names them in+/// `OPENHUMAN_CHANNELS_TEST_ARTIFACT` / `OPENHUMAN_VOICE_TEST_ARTIFACT`+/// (`scripts/ci/self-hosted/install-test-modules.sh`); the child loads those+/// files through `[[modules.overrides]]`. A developer can instead point+/// `OPENHUMAN_TEST_MODULE_SOURCE_DIR` at `scripts/modules/build.mjs` output,+/// which takes precedence. The directory must not sit under a symlink: TinyBus+/// refuses a module path with a non-directory ancestor.+enum TestModules {+ Source(std::path::PathBuf),+ Release(Vec<(&'static str, std::path::PathBuf)>),+}++fn test_modules(voice: bool) -> TestModules {+ let ids: &[&'static str] = if voice {+ &["tinychannels", "tinyvoice"]+ } else {+ &["tinychannels"]+ };+ if let Some(dir) = std::env::var_os("OPENHUMAN_TEST_MODULE_SOURCE_DIR") {+ let dir = std::path::PathBuf::from(dir);+ for id in ids {+ assert!(+ dir.join(id).join("modules.toml").is_file(),+ "compiled {id} descriptor missing from {}",+ dir.display()+ );+ }+ return TestModules::Source(dir);+ }+ let artifacts = ids+ .iter()+ .map(|&id| {+ let var = match id {+ "tinyvoice" => "OPENHUMAN_VOICE_TEST_ARTIFACT",+ _ => "OPENHUMAN_CHANNELS_TEST_ARTIFACT",+ };+ let path = std::env::var_os(var)+ .map(std::path::PathBuf::from)+ .unwrap_or_else(|| {+ panic!(+ "set {var} to the staged {id} release \+ (scripts/ci/self-hosted/install-test-modules.sh), or \+ OPENHUMAN_TEST_MODULE_SOURCE_DIR to scripts/modules/build.mjs output"+ )+ });+ assert!(path.is_file(), "{var} names no file: {}", path.display());+ (id, path)+ })+ .collect();+ TestModules::Release(artifacts)+}++fn write_config(home: &Path, workspace: &Path, inference: &str, modules: &TestModules) {let openhuman_dir = home.join(".openhuman");std::fs::create_dir_all(&openhuman_dir).expect("create OpenHuman config dir");std::fs::create_dir_all(workspace).expect("create workspace");- let config = format!(+ let mut config = format!(r#"default_model = "openai:gpt-4o"chat_provider = "openai:gpt-4o"api_url = "{inference}"@@ -448,6 +504,14 @@ auth_style = "none"default_model = "gpt-4o""#);+ if let TestModules::Release(artifacts) = modules {+ for (id, path) in artifacts {+ let path = toml::Value::String(path.display().to_string());+ config.push_str(&format!(+ "\n[[modules.overrides]]\nid = \"{id}\"\npath = {path}\n"+ ));+ }+ }std::fs::write(openhuman_dir.join("config.toml"), &config).expect("write config");let parsed: openhuman_core::config::Config =toml::from_str(&config).expect("mock config matches the core schema");@@ -495,7 +559,7 @@ fn start_core(workspace: &Path,telegram: &str,inference: &str,- module_source_dir: &Path,+ modules: &TestModules,log_path: &Path,voice_enabled: bool,) -> (CoreProcess, String) {@@ -506,7 +570,24 @@ fn start_core(.port();let stdout = File::create(log_path).expect("create core log");let stderr = stdout.try_clone().expect("clone core log handle");- let child = Command::new(env!("CARGO_BIN_EXE_openhuman-core"))+ let mut command = Command::new(env!("CARGO_BIN_EXE_openhuman-core"));+ // A per-module source env var beats the config overrides; keep it out.+ command+ .env_remove("OPENHUMAN_MODULE_SOURCE_TINYCHANNELS")+ .env_remove("OPENHUMAN_MODULE_SOURCE_TINYVOICE");+ match modules {+ TestModules::Source(dir) => {+ command+ .env("OPENHUMAN_MODULE_SOURCE", "source")+ .env("OPENHUMAN_MODULE_SOURCE_DIR", dir);+ }+ TestModules::Release(_) => {+ command+ .env("OPENHUMAN_MODULE_SOURCE", "release")+ .env_remove("OPENHUMAN_MODULE_SOURCE_DIR");+ }+ }+ let child = command.args(["serve", "--port", &port.to_string()]).current_dir(home).env("HOME", home)@@ -524,8 +605,6 @@ fn start_core(.env("OPENHUMAN_AUTO_UPDATE_ENABLED", "false").env("OPENHUMAN_TELEGRAM_BOT_API_BASE", telegram).env("OPENHUMAN_COMPONENT_CHANNELS", "1")- .env("OPENHUMAN_MODULE_SOURCE", "source")- .env("OPENHUMAN_MODULE_SOURCE_DIR", module_source_dir).env("OPENHUMAN_STORAGE_URL",format!("sqlite:{}", workspace.join("sessions.db").display()),@@ -917,19 +996,10 @@ async fn native_telegram_session_resumes_after_the_core_process_restarts() {let workspace = home.join("workspace");let logs = home.join("logs");std::fs::create_dir_all(&logs).expect("create logs");- let module_source_dir = std::env::var_os("OPENHUMAN_TEST_MODULE_SOURCE_DIR")- .map(std::path::PathBuf::from)- .expect("build TinyChannels and set OPENHUMAN_TEST_MODULE_SOURCE_DIR");- assert!(- module_source_dir- .join("tinychannels/modules.toml")- .is_file(),- "compiled TinyChannels source descriptor is missing from {}",- module_source_dir.display()- );+ let modules = test_modules(false);let mocks = start_mock_servers().await;- write_config(&home, &workspace, &mocks.inference);+ write_config(&home, &workspace, &mocks.inference, &modules);// The first listener instance consumes one real native Telegram update.let (mut first, first_rpc) = start_core(@@ -937,7 +1007,7 @@ async fn native_telegram_session_resumes_after_the_core_process_restarts() {&workspace,&mocks.telegram,&mocks.inference,- &module_source_dir,+ &modules,&logs.join("first.log"),false,);@@ -1027,7 +1097,7 @@ async fn native_telegram_session_resumes_after_the_core_process_restarts() {&workspace,&mocks.telegram,&mocks.inference,- &module_source_dir,+ &modules,&logs.join("second.log"),false,);@@ -1088,21 +1158,16 @@ async fn native_telegram_typed_media_reaches_the_model_without_provider_paths()let workspace = home.join("workspace");let logs = home.join("logs");std::fs::create_dir_all(&logs).expect("create logs");- let module_source_dir = std::env::var_os("OPENHUMAN_TEST_MODULE_SOURCE_DIR")- .map(std::path::PathBuf::from)- .expect("build TinyChannels and set OPENHUMAN_TEST_MODULE_SOURCE_DIR");- assert!(module_source_dir- .join("tinychannels/modules.toml")- .is_file());+ let modules = test_modules(false);let mocks = start_mock_servers().await;- write_config(&home, &workspace, &mocks.inference);+ write_config(&home, &workspace, &mocks.inference, &modules);let (mut core, core_rpc) = start_core(&home,&workspace,&mocks.telegram,&mocks.inference,- &module_source_dir,+ &modules,&logs.join("typed-media.log"),false,);@@ -1206,7 +1271,7 @@ async fn native_telegram_typed_media_reaches_the_model_without_provider_paths()&workspace,&mocks.telegram,&mocks.inference,- &module_source_dir,+ &modules,&logs.join("typed-media-restarted.log"),false,);@@ -1247,28 +1312,16 @@ async fn telegram_voice_note_runs_scoped_stt_agent_and_mirror_tts_through_modulelet workspace = home.join("workspace");let logs = home.join("logs");std::fs::create_dir_all(&logs).expect("create logs");- let module_source_dir = std::env::var_os("OPENHUMAN_TEST_MODULE_SOURCE_DIR")- .map(std::path::PathBuf::from)- .expect("build TinyChannels and TinyVoice and set OPENHUMAN_TEST_MODULE_SOURCE_DIR");- for module in ["tinychannels", "tinyvoice"] {- assert!(- module_source_dir- .join(module)- .join("modules.toml")- .is_file(),- "compiled {module} descriptor missing from {}",- module_source_dir.display()- );- }+ let modules = test_modules(true);let mocks = start_mock_servers().await;- write_config(&home, &workspace, &mocks.inference);+ write_config(&home, &workspace, &mocks.inference, &modules);let (mut core, rpc) = start_core(&home,&workspace,&mocks.telegram,&mocks.inference,- &module_source_dir,+ &modules,&logs.join("voice.log"),true,);