Skip to content

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

test: align voice contract and retired provisioning RPC regressions

Steven Enamakel31d91cdf7025
diff --git a/crates/openhuman-core/src/modules/voice_tests.rs b/crates/openhuman-core/src/modules/voice_tests.rs
index 31c3463288..7743e0c927 100644
--- a/crates/openhuman-core/src/modules/voice_tests.rs
+++ b/crates/openhuman-core/src/modules/voice_tests.rs
@@ -386,12 +386,9 @@ async fn every_entry_point_degrades_rather_than_hanging_when_the_module_is_gone(
#[test]
fn every_member_this_client_calls_is_one_the_contract_declares() {
- // The fifteen call sites in this module are written as `tinyvoice_bus`
- // constants, so a rename upstream is a compile error here rather than a
- // `MemberNotFound` at runtime. This pins the other direction: a member the
- // contract declares and this client never calls is either a gap in the
- // client or a member that should not be in the contract, and either way it
- // should be noticed here rather than discovered later.
+ // The host's outbound members must be dispatched by the module. The
+ // module also serves native recording operations that this client does
+ // not use; additional server capabilities do not invalidate a client.
use tinyvoice_bus::names::methods;
let called = [
methods::ROUTE,
@@ -408,18 +405,22 @@ fn every_member_this_client_calls_is_one_the_contract_declares() {
methods::ENCODE_WAV,
methods::ENCODE_WAV_PCM16,
methods::PREPARE_CAPTURE,
+ methods::RESERVE_CAPTURE,
+ methods::CAPTURE_START,
+ methods::CAPTURE_POLL,
+ methods::CAPTURE_STOP,
+ methods::CAPTURE_SHUTDOWN,
+ methods::HOTKEY_RESERVE,
+ methods::HOTKEY_START,
+ methods::HOTKEY_READ,
+ methods::HOTKEY_FEED,
+ methods::HOTKEY_STOP,
+ methods::HOTKEY_SHUTDOWN,
];
- // `Segment` is the one deliberate omission: it segments a complete energy
- // buffer in one call, and the always-on capture loop needs the stateful
- // `Vad*` session instead, because a segmenter is a state machine across
- // frames that arrive one at a time.
- for member in tinyvoice_bus::names::METHODS {
- if *member == methods::SEGMENT {
- continue;
- }
+ for member in called {
assert!(
- called.contains(member),
- "the contract declares `{member}`, which this client never calls"
+ tinyvoice_bus::names::METHODS.contains(&member),
+ "the host calls `{member}`, which the contract does not dispatch"
);
}
}
diff --git a/tests/json_rpc_e2e.rs b/tests/json_rpc_e2e.rs
index 028b6a9a9a..9e28d49c17 100644
--- a/tests/json_rpc_e2e.rs
+++ b/tests/json_rpc_e2e.rs
@@ -1610,47 +1610,31 @@ async fn json_rpc_tool_registry_lists_and_gets_entries() {
}
#[tokio::test]
-async fn json_rpc_harness_init_status_returns_snapshot_envelope() {
+async fn json_rpc_removed_harness_provisioning_is_unavailable() {
let _env_lock = json_rpc_e2e_env_lock_async().await;
let (rpc_addr, rpc_join) = serve_on_ephemeral(build_core_http_router(false)).await;
let rpc_base = format!("http://{rpc_addr}");
- // status is read-only — no provisioning is triggered, so it is safe in CI
- // (we deliberately do NOT call `openhuman.harness_init_run`, which would
- // attempt real Python/Node/spaCy downloads).
- let resp = post_json_rpc(
- &rpc_base,
- 44_711,
- "openhuman.harness_init_status",
- json!({}),
- )
- .await;
- let result = assert_no_jsonrpc_error(&resp, "harness_init_status");
-
- let snapshot = result
- .get("snapshot")
- .expect("harness_init_status should return a snapshot object");
- let overall = snapshot
- .get("overall")
- .and_then(Value::as_str)
- .expect("snapshot.overall should be a string");
- assert!(
- ["idle", "running", "done", "failed"].contains(&overall),
- "overall should be a known lifecycle state, got {overall}"
- );
- let steps = snapshot
- .get("steps")
- .and_then(Value::as_array)
- .expect("snapshot.steps should be an array");
- let ids: Vec<&str> = steps
- .iter()
- .filter_map(|s| s.get("id").and_then(Value::as_str))
- .collect();
- assert!(
- ids.contains(&"python_runtime") && ids.contains(&"node_runtime"),
- "snapshot should list the registered steps, got {ids:?}"
- );
-
+ // Runtime provisioning was removed; these legacy calls must not start
+ // Python/Node downloads or expose a stale provisioning snapshot.
+ for (id, method, params) in [
+ (44_711, "openhuman.harness_init_status", json!({})),
+ (44_712, "openhuman.harness_init_run", json!({})),
+ (44_713, "openhuman.harness_init_run", json!({ "force": true })),
+ ] {
+ let response = post_json_rpc(&rpc_base, id, method, params).await;
+ assert_eq!(
+ response.pointer("/error/code").and_then(Value::as_i64),
+ Some(-32000),
+ "removed RPC {method} must be unavailable: {response}"
+ );
+ let expected = format!("unknown method: {method}");
+ assert_eq!(
+ response.pointer("/error/message").and_then(Value::as_str),
+ Some(expected.as_str())
+ );
+ assert!(response.get("result").is_none(), "{response}");
+ }
rpc_join.abort();
}