The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix: preserve gated tests and classified errors
Steven Enamakel2dec20a0007b
diff --git a/.github/workflows/ci-lite.yml b/.github/workflows/ci-lite.ymlindex 9c7a684b97..1b6a0f4ec1 100644--- a/.github/workflows/ci-lite.yml+++ b/.github/workflows/ci-lite.yml@@ -156,6 +156,7 @@ jobs:- 'scripts/ci/assert-coverage-presence.sh'- 'scripts/ci/coverage-presence-allowlist.txt'- 'scripts/ci/check-openhuman-rust-layout.mjs'+ - 'scripts/ci/list-feature-gated-rust-tests.mjs'- 'Cargo.toml'- 'Cargo.lock'- 'build.rs'@@ -611,21 +612,36 @@ jobs:run: |set -euo pipefailEXPECTED=$(cat <<'EOF'+ core/all.rscore/all_tests.rscore/cli_tests.rscore/dispatch.rs+ core/jsonrpc.rscore/jsonrpc_tests.rscore/legacy_aliases.rscore/runtime/services.rs+ embed/harness/builder.rs+ embed/harness/builder_tests.rsopenhuman/agent/harness/builtin_definitions_tests.rsopenhuman/agent/harness/definition_tests.rs+ openhuman/agent/harness/mod.rsopenhuman/agent/harness/session/session_tests_part_01_tests.rsopenhuman/agent/harness/subagent_runner/tool_prep_tests.rs+ openhuman/agent/registry/agents/loader.rsopenhuman/agent/registry/agents/loader_tests_part_01_tests.rsopenhuman/agent/registry/agents/loader_tests_part_02_tests.rsopenhuman/agent/registry/agents/loader_tests_part_03_tests.rsopenhuman/config/migrations/retire_local_whisper_stt_tests.rs+ openhuman/flows/mod.rs+ openhuman/mcp/server/resources.rs+ openhuman/mcp/server/tools/mod.rs+ openhuman/memory/people/mod.rsopenhuman/memory/people/mod_contacts_gate_tests_tests.rs+ openhuman/platform/socket/event_handlers.rs+ openhuman/platform/socket/ops.rs+ openhuman/skills/mod.rs+ openhuman/tools/impl/network/http_request.rs+ openhuman/tools/ops.rsopenhuman/tools/ops_tests.rsopenhuman/tools/ops_tests_part_01_tests.rsopenhuman/tools/ops_tests_part_03_tests.rs@@ -633,13 +649,14 @@ jobs:openhuman/tools/registry/ops_tests.rsopenhuman/tools/registry/schemas_tests.rsopenhuman/voice/compile_status_tests.rs+ openhuman/web3/mod.rs+ openhuman/web3/stub.rsopenhuman/web3/wallet/stub.rs- embed/harness/builder_tests.rs+ openhuman/web3/x402/stub.rstui/runner.rsEOF)- ACTUAL=$(grep -rlE '#\[cfg\((not\()?feature = "(voice|media|web3|meet|mcp|skills|flows|channels|contacts)"|#\[cfg\((not\()?all\([^]]*feature = "contacts"' src --include='*.rs' \- | xargs grep -lE '#\[test\]|#\[tokio::test\]|fn .*_test' 2>/dev/null | sed 's|^src/||' | sort -u)+ ACTUAL=$(node scripts/ci/list-feature-gated-rust-tests.mjs | sort -u)if ! diff <(echo "$EXPECTED" | sed 's/^ *//' | sort -u) <(echo "$ACTUAL"); thenecho "::error::Gated-test file set changed. Update the EXPECTED allowlist in the rust-feature-gate-smoke lane, and extend the scoped 'cargo test' filter if the new module can carry an ungated-assert regression (see #5022)."exit 1diff --git a/scripts/ci/list-feature-gated-rust-tests.mjs b/scripts/ci/list-feature-gated-rust-tests.mjsnew file mode 100644index 0000000000..8a9e556f1e--- /dev/null+++ b/scripts/ci/list-feature-gated-rust-tests.mjs@@ -0,0 +1,41 @@+#!/usr/bin/env node++import fs from "node:fs";+import path from "node:path";++const ROOT = "src";+const FEATURE_GATE =+ /#\[cfg\((?:not\()?feature = "(?:voice|media|web3|meet|mcp|skills|flows|channels|contacts)"|#\[cfg\((?:not\()?all\([^\]]*feature = "contacts"/;+const TEST_MARKER = /#\[test\]|#\[tokio::test\]|fn .*_test/;+const PATH_MODULE =+ /#\[path\s*=\s*"([^"]+)"\]\s*(?:#\[[^\]]+\]\s*)*(?:pub(?:\([^)]*\))?\s+)?mod\s+\w+\s*;/g;++function rustFiles(directory) {+ return fs.readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {+ const file = path.join(directory, entry.name);+ if (entry.isDirectory()) return rustFiles(file);+ return entry.isFile() && entry.name.endsWith(".rs") ? [file] : [];+ });+}++function moduleContainsTest(file, seen = new Set()) {+ const absolute = path.resolve(file);+ if (seen.has(absolute) || !fs.existsSync(absolute)) return false;+ seen.add(absolute);++ const source = fs.readFileSync(absolute, "utf8");+ if (TEST_MARKER.test(source)) return true;++ for (const match of source.matchAll(PATH_MODULE)) {+ const child = path.resolve(path.dirname(absolute), match[1]);+ if (moduleContainsTest(child, seen)) return true;+ }+ return false;+}++for (const file of rustFiles(ROOT)) {+ const source = fs.readFileSync(file, "utf8");+ if (FEATURE_GATE.test(source) && moduleContainsTest(file)) {+ console.log(path.relative(ROOT, file).split(path.sep).join("/"));+ }+}diff --git a/src/openhuman/integrations/composio/module_client.rs b/src/openhuman/integrations/composio/module_client.rsindex dc67fca406..e941d0c1e4 100644--- a/src/openhuman/integrations/composio/module_client.rs+++ b/src/openhuman/integrations/composio/module_client.rs@@ -36,6 +36,20 @@ pub fn is_unsupported_by_route(error: &str) -> bool {error.contains("is not available over the") && error.contains("route")}+/// Keep the structured Composio classification at the start of the error.+///+/// TinyBus prefixes member failures (for example, `Execute: `), but the+/// frontend parser intentionally requires the classification at byte zero.+/// Other errors retain the member context unchanged.+fn normalize_error(error: String) -> String {+ const CLASSIFIED: &str = "[composio:error:";+ if let Some(start) = error.find(CLASSIFIED) {+ error[start..].to_string()+ } else {+ error+ }+}+/// The message a gates-off build answers every connector call with.#[cfg(not(feature = "modules"))]const WITHOUT_MODULES: &str =@@ -62,7 +76,9 @@ whereRequest: serde::Serialize + Send,Reply: serde::de::DeserializeOwned,{- crate::openhuman::modules::connectors::call(config, member, request).await+ crate::openhuman::modules::connectors::call(config, member, request)+ .await+ .map_err(normalize_error)}/// Call one member with an argument. Always fails without the `modules` feature.@@ -93,7 +109,9 @@ pub async fn call_bare<Reply: serde::de::DeserializeOwned>(config: &crate::openhuman::config::Config,member: &str,) -> Result<Reply, String> {- crate::openhuman::modules::connectors::call_bare(config, member).await+ crate::openhuman::modules::connectors::call_bare(config, member)+ .await+ .map_err(normalize_error)}/// Call a member that takes no arguments. Always fails without `modules`.diff --git a/src/openhuman/integrations/composio/module_client_tests.rs b/src/openhuman/integrations/composio/module_client_tests.rsindex 1526487a00..183a0e5241 100644--- a/src/openhuman/integrations/composio/module_client_tests.rs+++ b/src/openhuman/integrations/composio/module_client_tests.rs@@ -2,6 +2,24 @@use super::{is_unsupported_by_route, methods};+#[test]+fn classified_errors_start_with_the_frontend_marker() {+ assert_eq!(+ super::normalize_error(+ "Execute: [composio:error:rate_limited] Please retry later".to_string()+ ),+ "[composio:error:rate_limited] Please retry later"+ );+}++#[test]+fn unclassified_errors_keep_the_member_context() {+ assert_eq!(+ super::normalize_error("Execute: module unavailable".to_string()),+ "Execute: module unavailable"+ );+}+#[test]fn member_names_come_from_the_contract() {// Spelled through `tinyconnectors_bus` rather than as string literals, so adiff --git a/src/openhuman/integrations/composio/ops/execute.rs b/src/openhuman/integrations/composio/ops/execute.rsindex cbe27bcbcf..580ba760aa 100644--- a/src/openhuman/integrations/composio/ops/execute.rs+++ b/src/openhuman/integrations/composio/ops/execute.rs@@ -9,12 +9,8 @@ use super::error_utils::{report_composio_op_error, OpResult};/// The prefix the module puts on an error it has already classified.///-/// Matched with `contains` rather than `starts_with`: the bus prefixes a-/// member failure with the member's name, so a tag that used to lead the string-/// now sits inside it. A `starts_with` here would silently stop recognising-/// every classified error and re-wrap them all as unclassified, which is-/// exactly the information the UI uses to tell "reconnect your account" from-/// "the provider is down".+/// The domain module client removes TinyBus's member-name prefix so this stays+/// at byte zero, matching the frontend formatter's parsing contract.const CLASSIFIED: &str = "[composio:error:";/// Run one Composio action.@@ -82,7 +78,7 @@ pub async fn composio_execute(},);report_composio_op_error("execute", &anyhow::anyhow!("{e}"));- let is_classified = e.contains(CLASSIFIED);+ let is_classified = e.starts_with(CLASSIFIED);tracing::debug!(tool = %tool,elapsed_ms,diff --git a/src/openhuman/integrations/composio/ops_tests_part_02_tests.rs b/src/openhuman/integrations/composio/ops_tests_part_02_tests.rsindex 647028cf6e..bacfb22a59 100644--- a/src/openhuman/integrations/composio/ops_tests_part_02_tests.rs+++ b/src/openhuman/integrations/composio/ops_tests_part_02_tests.rs@@ -475,10 +475,8 @@ async fn composio_execute_via_mock_propagates_backend_error() {// preserves that prefix so the frontend formatter can parse the class.// For an unrecognised tool slug and a 502-shaped envelope the only// signal we get is the backend error text, so assert on its contents.- assert!(- err.contains("[composio:error:") && err.contains("rate limited"),- "got: {err}"- );+ assert!(err.starts_with("[composio:error:"), "got: {err}");+ assert!(err.contains("rate limited"), "got: {err}");}#[tokio::test]