Skip to content

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

test(raw_coverage): pin inference controllers via all_registered_controllers

Steven Enamakelb0a7e019969b
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 7bcfee5260..200dacd1b7 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
@@ -1,4 +1,5 @@
-//! Controller-boundary E2E coverage for the six `inference.*` local controllers.
+//! Controller-boundary E2E coverage for the four local runtime controllers and
+//! the two agent-owned inference chat controllers.
//!
//! # Why this suite exists alongside the others
//!
@@ -18,7 +19,7 @@
//! `rpc_method_name()` (`crates/openhuman-core/src/core/all.rs:1069`) is the contract; this is the
//! only place it is pinned.
//!
-//! 2. **The controller boundary itself for the four that had none**:
+//! 2. **The controller boundary itself for the controllers that had none**:
//! `agent_chat_simple`, `transcribe`, `transcribe_bytes` and `tts`. The handlers deserialize params, load the ambient
//! config, and trim string inputs before delegating
//! (`crates/openhuman-core/src/inference/local/schemas.rs:309-395`). None of that is
@@ -51,7 +52,7 @@ use std::path::{Path, PathBuf};
use std::sync::OnceLock;
use openhuman_core::config::Config;
-use openhuman_core::core::all::RegisteredController;
+use openhuman_core::core::all::{all_registered_controllers, RegisteredController};
use openhuman_core::inference::host_runtime::all_local_inference_registered_controllers;
use serde_json::{json, Value};
use tempfile::{tempdir, TempDir};
@@ -150,9 +151,8 @@ fn write_stub_piper(dir: &Path, name: &str, transcript: &Path) -> PathBuf {
)
}
-/// The six controllers `all_registered_controllers` builds
-/// (`crates/openhuman-core/src/inference/local/schemas.rs:92-138`), paired with the wire
-/// method name each one must dispatch under.
+/// The four local runtime and two agent-owned chat controllers, paired with
+/// the wire method name each one must dispatch under.
const EXPECTED_WIRE_METHODS: &[(&str, &str)] = &[
("agent_chat", "openhuman.inference_agent_chat"),
("agent_chat_simple", "openhuman.inference_agent_chat_simple"),
@@ -170,7 +170,15 @@ const EXPECTED_WIRE_METHODS: &[(&str, &str)] = &[
/// break every caller.
#[test]
fn local_inference_controllers_pin_their_registered_wire_method_names() {
- let controllers = all_local_inference_registered_controllers();
+ let controllers: Vec<_> = all_registered_controllers()
+ .into_iter()
+ .filter(|controller| {
+ controller.schema.namespace == "inference"
+ && EXPECTED_WIRE_METHODS
+ .iter()
+ .any(|(function, _)| controller.schema.function == *function)
+ })
+ .collect();
assert_eq!(
controllers.len(),
@@ -433,7 +441,7 @@ async fn inference_agent_chat_simple_controller_covers_params_and_prompt_guard()
config.save().await.expect("save config");
let _workspace = EnvVarGuard::set("OPENHUMAN_WORKSPACE", tmp.path().join(".openhuman"));
- let controllers = all_local_inference_registered_controllers();
+ let controllers = all_registered_controllers();
let chat_simple = controller(&controllers, "agent_chat_simple");
let missing = call(chat_simple, json!({}))