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: align module and e2e fixtures with the staged release
Steven Enamakelcb5af87760e6
diff --git a/crates/openhuman-cli/Cargo.toml b/crates/openhuman-cli/Cargo.tomlindex 2c539cbcfa..7f4499f390 100644--- a/crates/openhuman-cli/Cargo.toml+++ b/crates/openhuman-cli/Cargo.toml@@ -87,9 +87,9 @@ path = "../../tests/tinydocs_linked_e2e.rs"required-features = ["linked-modules", "documents"][[test]]-name = "inbound_linked_e2e"-path = "../../tests/inbound_linked_e2e.rs"-required-features = ["linked-modules", "inbound-queues"]+name = "inbound_module_e2e"+path = "../../tests/inbound_module_e2e.rs"+required-features = ["modules", "inbound-queues", "e2e-test-support"][[test]]name = "tinysearch_module_e2e"@@ -473,7 +473,8 @@ tinyagents-harness = { path = "../../vendor/tinyagents/crates/tinyagents-harnesstinyagents-definition = { path = "../../vendor/tinyagents/crates/tinyagents-definition" }tinyagents-session = { path = "../../vendor/tinyagents/crates/tinyagents-session", features = ["testkit"] }tinydocs-bus = { path = "../../vendor/tinydocs/crates/tinydocs-bus" }-# `inbound_linked_e2e` names the ingest dispositions from the contract.+# `inbound_module_e2e` loads the staged TinyEventQueues release and names its+# ingest dispositions from the contract.tinyeventqueues-bus = { path = "../../vendor/tinyeventqueues/crates/tinyeventqueues-bus" }tinysearch-bus = { path = "../../vendor/tinysearch/crates/tinysearch-bus" }tinybus = { path = "../../vendor/tinybus/crates/tinybus", default-features = false, features = ["macros", "uds"] }diff --git a/crates/openhuman-core/src/core/agent_cli/debug/prompt_size_tests.rs b/crates/openhuman-core/src/core/agent_cli/debug/prompt_size_tests.rsindex b31af2253a..8eed22a4e6 100644--- a/crates/openhuman-core/src/core/agent_cli/debug/prompt_size_tests.rs+++ b/crates/openhuman-core/src/core/agent_cli/debug/prompt_size_tests.rs@@ -84,9 +84,13 @@ fn session_report_measures_the_visible_belt_not_the_registry() {workspace_dir: tmp.path().join("workspace"),action_dir: tmp.path().join("workspace"),config_path: tmp.path().join("config.toml"),+ default_model: Some("test/session-fixture".to_string()),..crate::config::Config::default()};std::fs::create_dir_all(&config.workspace_dir).unwrap();+ crate::agent::session_host::test_support::install_model_fixture();+ crate::security::credentials::api_key::store_api_key(&config, "test-prompt-size-key")+ .expect("test api key");let mut definition =crate::agent_registry::host_definition::AgentDefinitionRegistry::builtins_only().get("orchestrator")diff --git a/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs b/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rsindex d3e2376311..19feeb0b66 100644--- a/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs+++ b/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs@@ -10,6 +10,7 @@ async fn call_tool_records_write_argument_rejection() {let config = config_rpc::load_config_with_timeout().await.expect("config");+ crate::mcp::test_module_port::install(&config);let err = call_tool(&crate::core::runtime::DispatchCtx::ambient(),@@ -81,6 +82,10 @@ async fn call_tool_validates_memory_arguments_before_dispatch() {unsafe {std::env::set_var("OPENHUMAN_WORKSPACE", tmp.path());}+ let config = config_rpc::load_config_with_timeout()+ .await+ .expect("config");+ crate::mcp::test_module_port::install(&config);let err = call_tool(&crate::core::runtime::DispatchCtx::ambient(),"memory.forget",@@ -130,6 +135,8 @@ async fn call_tool_judges_the_policy_of_the_explicit_context_across_scopes() {crate::storage::test_support::install_for_test(&storage.url, Arc::clone(&storage.backend));denying.storage.url = Some(storage.url.clone());allowing.storage.url = Some(storage.url.clone());+ crate::mcp::test_module_port::install(&denying);+ crate::mcp::test_module_port::install(&allowing);let deny_core = CoreContext::for_test_with_config(DomainSet::full(), denying);let allow_core = CoreContext::for_test_with_config(DomainSet::full(), allowing);diff --git a/crates/openhuman-core/src/modules/registry_release_manifest_tests.rs b/crates/openhuman-core/src/modules/registry_release_manifest_tests.rsindex 3ac1efa735..efc71f5596 100644--- a/crates/openhuman-core/src/modules/registry_release_manifest_tests.rs+++ b/crates/openhuman-core/src/modules/registry_release_manifest_tests.rs@@ -154,12 +154,12 @@ fn voice_capture_release_pins_summary_contract_and_every_platform_digest() {("macos-26-arm64","tinyvoice-module-0.4.1-macos-26-arm64.tar.gz",- "17a6c1a80c1ae7a46fb19ce129e4b0dffb3d6391747bf9d1a5df0fab6ac75c48",+ "17c1a6a80c1ae7a46fb19ce129e4b0dffb3d6391747bf9d1a5df0fab6ac75c48",),("macos-26-x86_64","tinyvoice-module-0.4.1-macos-26-x86_64.tar.gz",- "1cf0fbd9f20ffc449a9df938cdc15f5d4d9c2d4077a839ddeba4423ed8ec2f175",+ "1cf0fbd9f20ffc449a9df938cdc15be4d9c2d4077a839ddeba4423ed8ec2f175",),("ubuntu-22.04-arm64",diff --git a/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rs b/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rsindex 454645e05d..caede353ee 100644--- a/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rs+++ b/crates/openhuman-core/src/modules/storage_host_cdylib_stream_tests.rs@@ -32,32 +32,32 @@ async fn a_blob_over_the_bus_frame_round_trips_through_a_peer_bound_stream() {// 20 MiB: over the 16 MiB frame no inline call could carry.let len = 20 * MIB;let stored = rig- .member("StreamPut", ("tinyjuice_ccr/streamed", len))+ .member("StreamPut", ("juice/ccr/streamed", len)).await;assert_eq!(stored["ok"]["len"], len, "{stored}");// It is in the module's own scope, byte for byte.let handle = rig.backend.for_scope(&rig.scope("tinyjuice")).unwrap();let meta = handle.blobs()- .head("tinyjuice_ccr/streamed")+ .head("juice/ccr/streamed").await.unwrap().expect("the streamed blob is stored");assert_eq!(meta.len, len);let bytes = handle.blobs()- .get_range("tinyjuice_ccr/streamed", 0..1024)+ .get_range("juice/ccr/streamed", 0..1024).await.unwrap().expect("range");assert!(bytes.iter().all(|byte| *byte == 0xAB));// And it comes back whole by `GetStream`.- let read = rig.member("StreamGet", ("tinyjuice_ccr/streamed",)).await;+ let read = rig.member("StreamGet", ("juice/ccr/streamed",)).await;assert_eq!(read["ok"]["len"], len, "{read}");assert_eq!(read["ok"]["meta_len"], len, "{read}");assert_eq!(read["ok"]["all_fill"], true, "{read}");// A key that is not there is `null`, not an error.- let missing = rig.member("StreamGet", ("tinyjuice_ccr/absent",)).await;+ let missing = rig.member("StreamGet", ("juice/ccr/absent",)).await;assert!(missing["ok"].is_null() && missing.get("ok").is_some(),"{missing}"@@ -92,7 +92,7 @@ async fn a_streamed_blob_is_still_bound_by_the_grant_and_the_length() {);// The module keeps working after a refusal.let after = rig- .member("StreamPut", ("tinyjuice_ccr/after", 3 * MIB))+ .member("StreamPut", ("juice/ccr/after", 3 * MIB)).await;assert_eq!(after["ok"]["len"], 3 * MIB, "{after}");}@@ -105,7 +105,7 @@ async fn an_inline_blob_no_frame_can_carry_fails_fast_instead_of_hanging() {// frame, over the 16 MiB cap.let started = std::time::Instant::now();let big: Value = rig- .member("PutBlob", ("tinyjuice_ccr/over-frame", 5_000_000usize))+ .member("PutBlob", ("juice/ccr/over-frame", 5_000_000usize)).await;assert!(big.get("err").is_some(),@@ -119,12 +119,12 @@ async fn an_inline_blob_no_frame_can_carry_fails_fast_instead_of_hanging() {let handle = rig.backend.for_scope(&rig.scope("tinyjuice")).unwrap();assert!(handle.blobs()- .head("tinyjuice_ccr/over-frame")+ .head("juice/ccr/over-frame").await.unwrap().is_none());let after: Value = rig- .member("PutBlob", ("tinyjuice_ccr/after", 2048usize))+ .member("PutBlob", ("juice/ccr/after", 2048usize)).await;assert!(after.get("ok").is_some(),@@ -221,14 +221,14 @@ async fn a_second_module_cannot_read_or_take_the_first_modules_streams() {// which has no blobs at all.let rig = rig_with_peers("tinyjuice", &["tinyjuice", "tinymcp"]).await;let stored = rig- .member("StreamPut", ("tinyjuice_ccr/private", 2 * MIB))+ .member("StreamPut", ("juice/ccr/private", 2 * MIB)).await;assert_eq!(stored["ok"]["len"], 2 * MIB, "{stored}");// A module without blob rights is refused outright.let nosy: tinybus::Result<Value> = rig.peer_proxy(1, "Blobs")- .call("GetStream", (json!({"key": "tinyjuice_ccr/private"}),))+ .call("GetStream", (json!({"key": "juice/ccr/private"}),)).await;match nosy {Err(tinybus::Error::MethodFailed { name, message }) => {@@ -248,7 +248,7 @@ async fn a_second_module_cannot_read_or_take_the_first_modules_streams() {.call("PutStream",(- json!({"key": "tinyjuice_ccr/hijacked", "len": MIB}),+ json!({"key": "juice/ccr/hijacked", "len": MIB}),reference,),)@@ -260,12 +260,12 @@ async fn a_second_module_cannot_read_or_take_the_first_modules_streams() {let handle = rig.backend.for_scope(&rig.scope("tinyjuice")).unwrap();assert!(handle.blobs()- .head("tinyjuice_ccr/hijacked")+ .head("juice/ccr/hijacked").await.unwrap().is_none());// The refused attempt did not spend the stream: its owner still uses it.- let used = rig.member("UseStream", ("tinyjuice_ccr/owned", MIB)).await;+ let used = rig.member("UseStream", ("juice/ccr/owned", MIB)).await;assert!(used.get("ok").is_some(),"the owner lost its stream: {used}"@@ -273,7 +273,7 @@ async fn a_second_module_cannot_read_or_take_the_first_modules_streams() {assert_eq!(handle.blobs()- .head("tinyjuice_ccr/owned")+ .head("juice/ccr/owned").await.unwrap().expect("stored by the owner")@@ -282,7 +282,7 @@ async fn a_second_module_cannot_read_or_take_the_first_modules_streams() {);// A download the host opened toward the probe is not readable by a peer.- let reply = rig.member("RawGetStream", ("tinyjuice_ccr/private",)).await;+ let reply = rig.member("RawGetStream", ("juice/ccr/private",)).await;let download: tinybus::StreamRef = serde_json::from_value(reply["ok"][1].clone()).unwrap_or_else(|_| panic!("a download reference: {reply}"));assert!(diff --git a/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rs b/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rsindex cb31a6015c..8a7c7bc2f7 100644--- a/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rs+++ b/crates/openhuman-core/src/modules/storage_host_cdylib_tests.rs@@ -547,7 +547,7 @@ async fn a_blob_over_the_inline_cap_is_refused_and_stores_nothing() {let rig = rig("tinyjuice").await;let small: Value = rig.probe- .call("PutBlob", ("tinyjuice_ccr/small", 1024usize))+ .call("PutBlob", ("juice/ccr/small", 1024usize)).await.unwrap();assert!(@@ -560,7 +560,7 @@ async fn a_blob_over_the_inline_cap_is_refused_and_stores_nothing() {// `an_inline_blob_no_frame_can_carry_fails_fast_instead_of_hanging`.)let big: Value = rig.probe- .call("PutBlob", ("tinyjuice_ccr/over-cap", 2usize * 1024 * 1024))+ .call("PutBlob", ("juice/ccr/over-cap", 2usize * 1024 * 1024)).await.unwrap();assert!(@@ -570,14 +570,14 @@ async fn a_blob_over_the_inline_cap_is_refused_and_stores_nothing() {let handle = rig.backend.for_scope(&rig.scope("tinyjuice")).unwrap();assert!(handle.blobs()- .head("tinyjuice_ccr/over-cap")+ .head("juice/ccr/over-cap").await.unwrap().is_none());// The refusal does not take the module's connection down with it.let after: Value = rig.probe- .call("PutBlob", ("tinyjuice_ccr/after", 2048usize))+ .call("PutBlob", ("juice/ccr/after", 2048usize)).await.unwrap();assert!(diff --git a/crates/openhuman-core/src/platform/connectivity/rpc_tests.rs b/crates/openhuman-core/src/platform/connectivity/rpc_tests.rsindex 8d587d8c40..0ef181b4ca 100644--- a/crates/openhuman-core/src/platform/connectivity/rpc_tests.rs+++ b/crates/openhuman-core/src/platform/connectivity/rpc_tests.rs@@ -7,14 +7,16 @@ fn reserve_port() -> std::net::TcpListener {}async fn spawn_openhuman_probe_listener(- port: u16,+ listener: std::net::TcpListener,) -> (tokio::task::JoinHandle<()>,tokio::sync::oneshot::Sender<()>,) {- let listener = tokio::net::TcpListener::bind(("127.0.0.1", port))- .await- .expect("bind probe listener");+ listener+ .set_nonblocking(true)+ .expect("set probe listener non-blocking");+ let listener = tokio::net::TcpListener::from_std(listener)+ .expect("adopt reserved probe listener");let (shutdown_tx, mut shutdown_rx) = tokio::sync::oneshot::channel::<()>();let task = tokio::spawn(async move {@@ -70,9 +72,8 @@ async fn pick_listen_port_preferred_free() {async fn pick_listen_port_openhuman_listener_requests_takeover() {let holder = reserve_port();let preferred = holder.local_addr().expect("preferred local addr").port();- drop(holder);- let (server_task, shutdown_tx) = spawn_openhuman_probe_listener(preferred).await;+ let (server_task, shutdown_tx) = spawn_openhuman_probe_listener(holder).await;let result = pick_listen_port_with_policy("127.0.0.1",@@ -100,15 +101,15 @@ async fn pick_listen_port_openhuman_listener_requests_takeover() {async fn pick_listen_port_openhuman_listener_falls_back_when_asked() {let holder = reserve_port();let preferred = holder.local_addr().expect("preferred local addr").port();- drop(holder);// Use the same neighbouring-port candidates as production instead of- // sampling and releasing one ephemeral port. Other parallel tests can- // claim a released ephemeral port before this listener binds it.+ // sampling and releasing one ephemeral port. Keep the OS reservation+ // until the probe listener adopts it so other test processes cannot race+ // the bind.let fallbacks: Vec<u16> = (1..=10).filter_map(|delta| preferred.checked_add(delta)).collect();- let (server_task, shutdown_tx) = spawn_openhuman_probe_listener(preferred).await;+ let (server_task, shutdown_tx) = spawn_openhuman_probe_listener(holder).await;let picked = pick_listen_port_with_policy("127.0.0.1",diff --git a/docs/TEST-COVERAGE-MATRIX.md b/docs/TEST-COVERAGE-MATRIX.mdindex e841cb61c0..26c2228641 100644--- a/docs/TEST-COVERAGE-MATRIX.md+++ b/docs/TEST-COVERAGE-MATRIX.md@@ -462,7 +462,7 @@ The thread JSONL store moved to `tinyagents_session::threads` (`vendor/tinyagent| 10.3.1 | Incoming Message Sync | RU+WD | `crates/openhuman-core/src/channels/tests/`, `gmail-flow.spec.ts` | ✅ | || 10.3.2 | Message Deduplication | RU | `crates/openhuman-core/src/channels/tests/` | ✅ | || 10.3.4 | Real-Time vs Delayed Sync | RU | `crates/openhuman-core/src/channels/tests/runtime_dispatch.rs` | ✅ | |-| 10.3.5 | Inbound Event Queues (Composio triggers, agent webhooks) | RU+RI | `crates/openhuman-core/src/integrations/composio/bus/trigger_subscriber_tests.rs`, `crates/openhuman-core/src/skills/webhooks/bus_tests.rs`, `crates/openhuman-core/src/inbound/`, `tests/components_e2e.rs`, `tests/inbound_linked_e2e.rs` | ✅ | Run against the real `tinyeventqueues` module linked into the test binary: a `Deferred` triage is retried at `defer_until_ms` instead of dropped, a redelivered trigger produces one turn, the direct path runs with the queues off. `inbound.*` RPC answers `COMPONENT_DISABLED:eventqueues` when off. `inbound_linked_e2e` (local, `linked-modules`) boots the module through the process-wide runtime on host storage |+| 10.3.5 | Inbound Event Queues (Composio triggers, agent webhooks) | RU+RI | `crates/openhuman-core/src/integrations/composio/bus/trigger_subscriber_tests.rs`, `crates/openhuman-core/src/skills/webhooks/bus_tests.rs`, `crates/openhuman-core/src/inbound/`, `tests/components_e2e.rs`, `tests/inbound_module_e2e.rs` | ✅ | TinyEventQueues owns retry, deduplication, and delivery behavior. `inbound_module_e2e` exercises host admission against the staged digest-verified module and asserts that an accepted trigger is persisted before acknowledgment. `inbound.*` RPC answers `COMPONENT_DISABLED:eventqueues` when off. Host callbacks require the verified local-file source; linked factories are not eligible for them. || 10.3.6 | Inbound external sources (`inbound.offer`, pinned agent turns, `inbound.results` / `inbound.result_ack`) | RU | `crates/openhuman-core/src/inbound/` (`*_tests.rs` beside `pinned.rs`, `results.rs`, `events.rs`, `settings.rs`, `ops.rs`, `schemas.rs`), `crates/openhuman-core/src/config/schema/inbound_sources_tests.rs`, `crates/openhuman-core/src/triage/origin_tests.rs` | ✅ | Against the real `tinyeventqueues` module linked into the test binary: three offers inside the debounce window become one turn on the configured agent, one stored result and one `InboundTurnCompleted`; `max_batch` splits a larger batch; a prompt-injection event is left out of the turn and listed as `blocked`; an all-blocked batch makes no model call; a completed turn is not re-run; an unconfigured or reserved source is refused; the turn runs under the parked-approval external origin |### 10.4 Messaging Operationsdiff --git a/tests/inbound_linked_e2e.rs b/tests/inbound_linked_e2e.rsdeleted file mode 100644index 6874e8f8f8..0000000000--- a/tests/inbound_linked_e2e.rs+++ /dev/null@@ -1,107 +0,0 @@-//! The inbound event queues end to end, with the `tinyeventqueues` module-//! served from the linked executable.-//!-//! Local only: it needs `--features linked-modules,inbound-queues`, which no CI-//! lane or product build enables (the CI-run regression tests drive the same-//! module linked into the core's unit tests). The module is admitted through-//! the process-wide module runtime exactly as `[modules] source = "linked"`-//! does: the host's storage backs its queues (an in-memory backend here), the-//! host's `Deliver` callback is the production one, and triage runs for real-//! against a backend that is not there, so it fails fast and the delivery is-//! retried rather than acted on.-//!-//! Run: `cargo test -p openhuman-cli --features linked-modules --test inbound_linked_e2e`--#[path = "support/linked_modules.rs"]-mod linked_modules;--use std::time::Duration;--use openhuman_core::config::schema::ModuleSourceMode;-use openhuman_core::config::Config;-use openhuman_core::inbound::{events, route};-use openhuman_core::modules::types::{ModuleSource, ModuleState};-use openhuman_core::modules::{event_queues, ops};-use openhuman_core::triage::TriggerEnvelope;-use tinyeventqueues_bus::Disposition;--fn config() -> Config {- let mut config = Config::default();- config.modules.enabled = true;- // A fallback to the release must fail loudly rather than download.- config.modules.allow_download = false;- config.modules.source = ModuleSourceMode::Linked;- config.components.eventqueues = true;- config.inbound.enabled = true;- config-}--#[tokio::test(flavor = "multi_thread", worker_threads = 4)]-async fn linked_tinyeventqueues_queues_dedupes_and_delivers_a_composio_trigger() {- let workspace = tempfile::tempdir().expect("workspace tempdir");- std::fs::write(- workspace.path().join("config.toml"),- "[inbound]\ntriage_timeout_ms = 1500\n",- )- .expect("seed config.toml");- // This target runs one test in its own process; nothing else reads these.- std::env::set_var("OPENHUMAN_WORKSPACE", workspace.path());- std::env::set_var("BACKEND_URL", "http://127.0.0.1:9");- let previous = openhuman_core::storage::install(std::sync::Arc::new(- tinystoragedrivers_testkit::MemoryBackend::new(),- ));- assert!(previous.is_none());- linked_modules::install();-- let config = config();- let client = ops::client(config.clone());- let envelope = TriggerEnvelope::from_composio(- "gmail",- "GMAIL_NEW_GMAIL_MESSAGE",- "msg-1",- "uuid-linked-1",- serde_json::json!({ "subject": "linked e2e" }),- );-- // Ingest: the module loads from the executable and persists the event.- let event = events::composio(&envelope).expect("a composio trigger is queueable");- let first = route::offer(&config, &client, event.clone()).await;- assert_eq!(first, route::Offered::Queued(Disposition::Accepted));- let status = ops::list(&config)- .into_iter()- .find(|module| module.id == event_queues::MODULE_ID)- .expect("tinyeventqueues is registered");- assert_eq!(status.state, ModuleState::Ready);- assert_eq!(status.source, Some(ModuleSource::Linked));-- // A redelivery of the same trigger is rejected at ingress.- let again = route::offer(&config, &client, event).await;- assert_eq!(again, route::Offered::Queued(Disposition::Duplicate));-- // Deliver: the module's own timer moves the event to a lane and calls the- // host's `Deliver`, which triages it (and, offline, asks for a retry). The- // turn is leased while that runs, then delayed or settled.- let delivered = tokio::time::timeout(Duration::from_secs(30), async {- loop {- let stats = event_queues::stats(&client).await.expect("stats");- let lanes_touched = stats- .queues- .iter()- .filter(|queue| queue.queue.starts_with("teq.lane."))- .any(|queue| queue.leased + queue.delayed > 0);- let settled = stats.outcomes.delivered + stats.outcomes.dead > 0;- if lanes_touched || settled {- return stats;- }- tokio::time::sleep(Duration::from_millis(100)).await;- }- })- .await- .expect("the module delivered the trigger to the host");- let ingress = delivered- .queues- .iter()- .find(|queue| queue.queue == "teq.ingress")- .expect("the ingress queue is reported");- assert_eq!(ingress.ready, 0, "the module never took the ingress");-}diff --git a/tests/inbound_module_e2e.rs b/tests/inbound_module_e2e.rsnew file mode 100644index 0000000000..374cb2baf1--- /dev/null+++ b/tests/inbound_module_e2e.rs@@ -0,0 +1,73 @@+//! Inbound queue admission through the verified TinyEventQueues release module.+//!+//! The staged release archive is digest-verified and loaded as a local file,+//! which is the supported source for modules that use host callbacks. The+//! host's storage backs its queues (an in-memory backend here), the host's+//! `Deliver` callback is the production one. The integration pins the host's+//! admission path; TinyEventQueues owns deduplication and delivery behavior.+//!+//! Run after staging test modules: `cargo test -p openhuman-cli --features inbound-queues,e2e-test-support --test inbound_module_e2e`++use openhuman_core::config::schema::ModuleOverride;+use openhuman_core::config::Config;+use openhuman_core::inbound::{events, route};+use openhuman_core::modules::types::{ModuleSource, ModuleState};+use openhuman_core::modules::{event_queues, ops};+use openhuman_core::triage::TriggerEnvelope;+use tinyeventqueues_bus::Disposition;++fn config() -> Config {+ let mut config = Config::default();+ config.modules.enabled = true;+ // A fallback to the release must fail loudly rather than download.+ config.modules.allow_download = false;+ let artifact = openhuman_core::modules::local_artifact("tinyeventqueues")+ .expect("stage the verified TinyEventQueues release module");+ config.modules.overrides = vec![ModuleOverride::with_path(+ "tinyeventqueues",+ artifact.to_string_lossy().into_owned(),+ )];+ config.components.eventqueues = true;+ config.inbound.enabled = true;+ config+}++#[tokio::test(flavor = "multi_thread", worker_threads = 4)]+async fn tinyeventqueues_accepts_a_composio_trigger_into_storage() {+ let workspace = tempfile::tempdir().expect("workspace tempdir");+ std::fs::write(+ workspace.path().join("config.toml"),+ "[inbound]\ntriage_timeout_ms = 1500\n",+ )+ .expect("seed config.toml");+ // This target runs one test in its own process; nothing else reads these.+ std::env::set_var("OPENHUMAN_WORKSPACE", workspace.path());+ std::env::set_var("BACKEND_URL", "http://127.0.0.1:9");+ let previous = openhuman_core::storage::install(std::sync::Arc::new(+ tinystoragedrivers_testkit::MemoryBackend::new(),+ ));+ assert!(previous.is_none());+ let config = config();+ let client = ops::client(config.clone());+ let envelope = TriggerEnvelope::from_composio(+ "gmail",+ "GMAIL_NEW_GMAIL_MESSAGE",+ "msg-1",+ "uuid-linked-1",+ serde_json::json!({ "subject": "linked e2e" }),+ );++ // Ingest: the module loads from the executable and persists the event.+ let event = events::composio(&envelope).expect("a composio trigger is queueable");+ let first = route::offer(&config, &client, event.clone()).await;+ assert_eq!(first, route::Offered::Queued(Disposition::Accepted));+ let status = ops::list(&config)+ .into_iter()+ .find(|module| module.id == event_queues::MODULE_ID)+ .expect("tinyeventqueues is registered");+ assert_eq!(status.state, ModuleState::Ready);+ assert_eq!(status.source, Some(ModuleSource::LocalFile));++ // Accepted means the module persisted the ingress before returning. Its+ // timer-driven deduplication and delivery loop are covered in TinyEventQueues.+}diff --git a/tests/json_rpc_config_e2e.rs b/tests/json_rpc_config_e2e.rsindex 25c51b6264..36d2b40a17 100644--- a/tests/json_rpc_config_e2e.rs+++ b/tests/json_rpc_config_e2e.rs@@ -3,6 +3,9 @@#[path = "support/rpc_e2e_harness.rs"]mod harness;use harness::*;+use openhuman_core::platform::connectivity::rpc::{+ pick_listen_port_for_host_with, OccupiedByCore,+};#[tokio::test]async fn json_rpc_legacy_provider_type_preserves_default_endpoint() {@@ -536,42 +539,47 @@ async fn json_rpc_config_agent_timeout_settings_roundtrip() {// Port-conflict recovery E2E// ---------------------------------------------------------------------------//-// Verifies that when the preferred core port (7788) is already occupied, the-// RPC stack starts successfully on a fallback port and remains fully-// reachable. A second pass confirms that once the blocker is dropped, port-// 7788 becomes available again — matching the "repro gone" acceptance-// criterion from issue #2617.+// Verifies that when the preferred core port is already occupied, the RPC+// stack starts successfully on a fallback port and remains fully reachable.+// Use an ephemeral preferred port so this remains isolated from a developer's+// already-running core on the standard port.#[tokio::test]async fn port_conflict_recovery_core_starts_on_fallback_port_e2e() {let _env_lock = json_rpc_e2e_env_lock_async().await;- // ── 1. occupy port 7788 with a dummy listener ─────────────────────────- // Use std::net so the binding is synchronous and stable before we call- // pick_listen_port.- let blocker =- std::net::TcpListener::bind("127.0.0.1:7788").expect("bind blocker on 7788 for e2e test");+ // ── 1. occupy an ephemeral preferred port with a dummy listener ───────+ let blocker = std::net::TcpListener::bind("127.0.0.1:0")+ .expect("bind blocker on an ephemeral port for e2e test");blocker.set_nonblocking(true).expect("set blocker non-blocking");-- // ── 2. pick_listen_port should fall back to 7789–7798 ────────────────- let pick_result = pick_listen_port(7788)+ let preferred = blocker.local_addr().expect("blocker local addr").port();+ let fallbacks: Vec<u16> = (1..=10)+ .filter_map(|delta| preferred.checked_add(delta))+ .collect();++ // ── 2. pick_listen_port should fall back to a neighbouring port ───────+ let pick_result = pick_listen_port_for_host_with(+ "127.0.0.1",+ preferred,+ OccupiedByCore::Fallback,+ ).await.expect("pick_listen_port must succeed when port is occupied by non-OpenHuman process");assert!(pick_result.fallback_from.is_some(),- "expected fallback_from to be Some(7788) when preferred port is occupied, got None"+ "expected fallback_from to be Some({preferred}) when preferred port is occupied, got None");assert_eq!(pick_result.fallback_from,- Some(7788),+ Some(preferred),"fallback_from should record the originally preferred port");let fallback_port = pick_result.port;assert!(- (7789..=7798).contains(&fallback_port),- "fallback port {fallback_port} should be in the 7789–7798 range"+ fallbacks.contains(&fallback_port),+ "fallback port {fallback_port} should be one of {fallbacks:?}");// ── 3. serve the core router on the fallback listener ────────────────@@ -613,15 +621,19 @@ async fn port_conflict_recovery_core_starts_on_fallback_port_e2e() {rpc_join.abort();- // ── 5. drop blocker — verify 7788 is now free ────────────────────────+ // ── 5. drop blocker — verify the preferred port is now free ──────────drop(blocker);- let after_drop = pick_listen_port(7788)+ let after_drop = pick_listen_port_for_host_with(+ "127.0.0.1",+ preferred,+ OccupiedByCore::Fallback,+ ).await.expect("pick_listen_port should succeed with 7788 free");assert_eq!(- after_drop.port, 7788,- "after releasing the blocker, pick_listen_port should bind directly on 7788"+ after_drop.port, preferred,+ "after releasing the blocker, pick_listen_port should bind directly on the preferred port");assert!(after_drop.fallback_from.is_none(),diff --git a/tests/storage_desktop_upgrade_e2e.rs b/tests/storage_desktop_upgrade_e2e.rsindex 4d238afbd8..043dafd62c 100644--- a/tests/storage_desktop_upgrade_e2e.rs+++ b/tests/storage_desktop_upgrade_e2e.rs@@ -572,7 +572,7 @@ async fn a_desktop_upgrade_is_lossless_and_leaves_the_legacy_files_untouched() {assert!(juice.blobs()- .get(&format!("tinyjuice_ccr/{token}"))+ .get(&format!("juice/ccr/{token}")).await.unwrap().is_some(),