Skip to content

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

test(inference): disable the runtime before the hosted-STT assertion\n\nCodeRabbit is right, and this is the third vacuous assertion reviewers have\nfound in my work on these two PRs — worth stating plainly rather than burying.\n\nThe test set `local_ai.runtime_enabled = true` at the top and never turned it\noff, then asserted that the hosted STT error does NOT contain "local ai is\ndisabled". With the runtime enabled that string could not appear whether or not\nthe gate existed, so the assertion proved nothing: a regression that gated\nhosted STT on the local runtime would have sailed through.\n\nNow the runtime is explicitly disabled and the config saved immediately before\nthe hosted call, which is the only state in which the assertion has teeth. The\ncomment says why, so the setup does not read as redundant and get removed.\n\nThe earlier part of the test keeps the runtime enabled on purpose — the\nunreadable-file and empty-file branches are local paths that need it.\n\nNot executed: the no-local-builds rule is in force, so this is reasoned from\nsource (`speech.rs:112-118` for the gate, `schemas.rs:340-352` for the handler)\nand verified only as far as `cargo fmt --check`. CI is the check.\n

M3gA-Mind24aa5331fe9b
diff --git a/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs b/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs
index a17f7ed301..2c4629c080 100644
--- a/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_local_controllers_rpc_raw_coverage_e2e.rs
@@ -438,6 +438,16 @@ async fn inference_transcribe_controllers_cover_params_trimming_and_local_reject
// is hosted now, so gating it on the local runtime would be a regression
// (the same assertion `inference_local_ops_piper_...:190` makes for the op,
// held here at the controller boundary).
+ //
+ // The runtime is turned OFF first, and that is what gives the assertion
+ // teeth: with it enabled, "local ai is disabled" could not appear whether
+ // or not the gate existed, so the check passed vacuously. Disabled, a
+ // regression that gated hosted STT on the local runtime WOULD produce that
+ // string and this would catch it.
+ let mut hosted_config = temp_config(&tmp);
+ hosted_config.local_ai.runtime_enabled = false;
+ hosted_config.save().await.expect("save config");
+
let hosted = call(
transcribe_bytes,
json!({ "audio_bytes": [1_u8, 2, 3], "extension": ".WEBM" }),