Skip to content

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

fix: preserve gated tests and classified errors\n\n

Steven Enamakel455e41051bac
diff --git a/.github/workflows/ci-lite.yml b/.github/workflows/ci-lite.yml
index 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 pipefail
EXPECTED=$(cat <<'EOF'
+ core/all.rs
core/all_tests.rs
core/cli_tests.rs
core/dispatch.rs
+ core/jsonrpc.rs
core/jsonrpc_tests.rs
core/legacy_aliases.rs
core/runtime/services.rs
+ embed/harness/builder.rs
+ embed/harness/builder_tests.rs
openhuman/agent/harness/builtin_definitions_tests.rs
openhuman/agent/harness/definition_tests.rs
+ openhuman/agent/harness/mod.rs
openhuman/agent/harness/session/session_tests_part_01_tests.rs
openhuman/agent/harness/subagent_runner/tool_prep_tests.rs
+ openhuman/agent/registry/agents/loader.rs
openhuman/agent/registry/agents/loader_tests_part_01_tests.rs
openhuman/agent/registry/agents/loader_tests_part_02_tests.rs
openhuman/agent/registry/agents/loader_tests_part_03_tests.rs
openhuman/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.rs
openhuman/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.rs
openhuman/tools/ops_tests.rs
openhuman/tools/ops_tests_part_01_tests.rs
openhuman/tools/ops_tests_part_03_tests.rs
@@ -633,13 +649,14 @@ jobs:
openhuman/tools/registry/ops_tests.rs
openhuman/tools/registry/schemas_tests.rs
openhuman/voice/compile_status_tests.rs
+ openhuman/web3/mod.rs
+ openhuman/web3/stub.rs
openhuman/web3/wallet/stub.rs
- embed/harness/builder_tests.rs
+ openhuman/web3/x402/stub.rs
tui/runner.rs
EOF
)
- 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"); then
echo "::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 1
diff --git a/scripts/ci/list-feature-gated-rust-tests.mjs b/scripts/ci/list-feature-gated-rust-tests.mjs
new file mode 100644
index 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.rs
index 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 @@ where
Request: 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.rs
index 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 a
diff --git a/src/openhuman/integrations/composio/ops/execute.rs b/src/openhuman/integrations/composio/ops/execute.rs
index 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.rs
index 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]