Skip to content

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

fix(build): suggest the full feature union, and stop a malformed error passing as a dispatch\n\nThree review findings, each confirmed against the source before acting.\n\n**build.rs — the suggested command dropped gates the caller already had.**\nFlagged independently by Codex and CodeRabbit. `skipped` mapped each target to\nits MISSING features and the `--features` line was built from that union, but\n`--features` is the complete set to activate, not a delta on the current one.\nWith `voice` already on, `raw_coverage_all` is missing only `inference`, so the\nwarning recommended `--features crash-reporting,inference,web3` — following it\ndrops `voice` and silently skips both voice targets again. The warning was\nhanding out a command that reproduces the failure it exists to prevent.\n\n`skipped` now carries `(missing, required)`: the diagnostic still names what is\nmissing, and the remediation is the union of every skipped target's FULL\n`required-features`.\n\nVerified by driving build.rs standalone against the real manifest, and\nrevert-checked:\n CARGO_FEATURE_VOICE=1, reverted -> `--features crash-reporting,inference,web3`\n CARGO_FEATURE_VOICE=1, fixed -> `--features crash-reporting,inference,voice,web3`\n\n**assert_rpc_completed — `unwrap_or_default()` re-opened the vacuous pass.**\nA missing, null or non-string `error.message` became `""`, which satisfies the\ncheck and lets a malformed error-only response count as a completed dispatch —\nthe same shape this helper was rewritten to remove. It now requires a string\nmessage and fails loudly when there is none.\n\n**assert_rpc_completed — `contains` was the wrong test.**\n`dispatch.rs:96` builds the string as `format!("{UNKNOWN_METHOD_PREFIX}{method}")`,\nso the marker is always at byte zero; `dispatch.rs:151` reads it back with\n`strip_prefix` for the same reason. `contains` would also reject a REGISTERED\nmethod whose own validation error quoted the phrase later, turning a reachable\nsurface into a false failure. Now `starts_with`.\n\nBoth helper changes tighten the assertion; neither relaxes one.\n

M3gA-Mind5f65b342a2ed
diff --git a/build.rs b/build.rs
index f7c5b2e5ae..c4382d3550 100644
--- a/build.rs
+++ b/build.rs
@@ -121,7 +121,11 @@ fn warn_about_silently_skipped_test_targets(manifest_dir: &Path) {
return;
};
- let mut skipped: BTreeMap<String, Vec<String>> = BTreeMap::new();
+ // Per target: what is missing NOW (the diagnostic) and what the target
+ // requires IN FULL (the remediation). They differ whenever a caller has
+ // some of the gates already, and conflating them is what made the
+ // suggested command wrong — see the `all` union below.
+ let mut skipped: BTreeMap<String, (Vec<String>, Vec<String>)> = BTreeMap::new();
for (target, required) in gated_test_targets(&manifest) {
let missing: Vec<String> = required
.iter()
@@ -136,7 +140,7 @@ fn warn_about_silently_skipped_test_targets(manifest_dir: &Path) {
.cloned()
.collect();
if !missing.is_empty() {
- skipped.insert(target, missing);
+ skipped.insert(target, (missing, required));
}
}
if skipped.is_empty() {
@@ -145,13 +149,21 @@ fn warn_about_silently_skipped_test_targets(manifest_dir: &Path) {
let detail = skipped
.iter()
- .map(|(target, missing)| format!("{target} (needs {})", missing.join(" + ")))
+ .map(|(target, (missing, _))| format!("{target} (needs {})", missing.join(" + ")))
.collect::<Vec<_>>()
.join(", ");
+ // The union of every skipped target's FULL `required-features`, not just
+ // the subset currently missing. `--features` is the complete set to
+ // activate, not a delta applied to the current one, so a command built from
+ // the missing subset drops the gates the caller already had: with `voice`
+ // on, `raw_coverage_all` is missing only `inference`, and
+ // `--features inference` would silently skip both voice targets again — the
+ // warning would be handing out a command that reproduces the exact failure
+ // it exists to prevent.
let all: Vec<&str> = {
let mut features: Vec<&str> = skipped
.values()
- .flat_map(|missing| missing.iter().map(String::as_str))
+ .flat_map(|(_, required)| required.iter().map(String::as_str))
.collect();
features.sort_unstable();
features.dedup();
diff --git a/tests/worker_c_modules_e2e.rs b/tests/worker_c_modules_e2e.rs
index bfbc410a0b..39dd431b23 100644
--- a/tests/worker_c_modules_e2e.rs
+++ b/tests/worker_c_modules_e2e.rs
@@ -245,12 +245,24 @@ fn assert_rpc_completed(value: &Value, context: &str) {
),
(None, None) => panic!("{context}: response carries neither result nor error: {value}"),
};
- let message = error
- .get("message")
- .and_then(Value::as_str)
- .unwrap_or_default();
+ // Not `unwrap_or_default()`: that turns a missing, null or non-string
+ // `message` into `""`, which then satisfies the check below and lets a
+ // malformed error-only response count as a completed dispatch — the same
+ // vacuous-pass shape this helper was rewritten to remove.
+ let Some(message) = error.get("message").and_then(Value::as_str) else {
+ panic!(
+ "{context}: error response carries no string `message`, so nothing can be \
+ concluded about whether the method dispatched: {value}"
+ );
+ };
+ // `starts_with`, not `contains`: `dispatch.rs:96` builds the string as
+ // `format!("{UNKNOWN_METHOD_PREFIX}{method}")`, so the marker is always at
+ // byte zero — `dispatch.rs:151` reads it back with `strip_prefix` for the
+ // same reason. `contains` would additionally reject a REGISTERED method
+ // whose own validation error quoted the phrase later in the message,
+ // turning a reachable surface into a false failure.
assert!(
- !message.contains(UNKNOWN_METHOD_PREFIX),
+ !message.starts_with(UNKNOWN_METHOD_PREFIX),
"{context}: the core does not serve this method, so the surface is NOT reachable \
— the registry entry is missing or its namespace was renamed. Got: {message}"
);