Skip to content

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

test: remove redundant test coverage across core modules

Steven Enamakelb4bb09243bb3
diff --git a/crates/openhuman-core/src/agent/tinyagents/verify_before_finish_tests.rs b/crates/openhuman-core/src/agent/tinyagents/verify_before_finish_tests.rs
index a76228e651..2bc5dcda6d 100644
--- a/crates/openhuman-core/src/agent/tinyagents/verify_before_finish_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/verify_before_finish_tests.rs
@@ -268,27 +268,6 @@ async fn subagent_turn_is_not_checked() {
const BUDGET_ROUNDS: usize = 7;
const BUDGET_CALLS: usize = 12;
-/// tinyagents#301: once the wrap-up has announced a budget notice the check
-/// stays quiet. This only holds when `install` is handed the SAME `Arc` that is
-/// installed as the wrap-up middleware, which is what the harness assembly does.
-#[tokio::test]
-async fn a_linked_wrap_up_budget_notice_silences_the_check() {
- // 7 tool rounds + the draft = 8 calls of a budget of 12: the 0.5 notice
- // fires on the 6th call, before the draft, and leaves room for a check.
- let rounds = BUDGET_ROUNDS;
- let (checks, text) = drive_with(
- rounds,
- "lookup",
- false,
- Some("orchestrator"),
- WrapUp::Linked,
- BUDGET_CALLS,
- )
- .await;
- assert_eq!(checks, 0, "a budget notice said finish; no re-verify turn");
- assert_eq!(text, "draft");
-}
-
#[tokio::test]
async fn an_unlinked_wrap_up_does_not_silence_the_check() {
let (checks, _) = drive_with(
diff --git a/crates/openhuman-core/src/channels/runtime/supervision_tests.rs b/crates/openhuman-core/src/channels/runtime/supervision_tests.rs
index 37facf80f2..da61ab1ca9 100644
--- a/crates/openhuman-core/src/channels/runtime/supervision_tests.rs
+++ b/crates/openhuman-core/src/channels/runtime/supervision_tests.rs
@@ -20,19 +20,12 @@ fn supervision_discord_gateway_reqwest_failure_classifies_as_expected() {
#[test]
fn jitter_millis_is_bounded_by_backoff_and_max() {
- // Sub-second backoff windows scale with the backoff; large ones clamp.
+ // The pinned tinychannels runtime tests do not assert this helper's bounds.
for _ in 0..256 {
- assert!(
- jitter_millis(1) < 1_000,
- "1s backoff jitters within [0,1000)"
- );
- assert!(
- jitter_millis(60) < MAX_JITTER_MS,
- "large backoff jitter must clamp to MAX_JITTER_MS"
- );
+ assert!(jitter_millis(1) < 1_000);
+ assert!(jitter_millis(60) < MAX_JITTER_MS);
}
- // Degenerate window: no room to sample, must not panic on `0..0`.
- assert_eq!(jitter_millis(0), 0, "zero backoff yields zero jitter");
+ assert_eq!(jitter_millis(0), 0);
}
/// Fake channel whose `listen()` returns `Ok(())` immediately — mirroring
diff --git a/crates/openhuman-core/src/platform/cost/catalog_tests.rs b/crates/openhuman-core/src/platform/cost/catalog_tests.rs
index 6e9eaa6de7..22122f44b2 100644
--- a/crates/openhuman-core/src/platform/cost/catalog_tests.rs
+++ b/crates/openhuman-core/src/platform/cost/catalog_tests.rs
@@ -12,38 +12,6 @@ fn default_registry_entries_are_fully_populated() {
}
}
-#[test]
-fn tinyagents_snapshot_contains_all_known_rows() {
- let snapshot = tinyagents_catalog_snapshot();
- assert_eq!(snapshot.schema_version, 1);
- assert_eq!(snapshot.currency, "USD");
- assert_eq!(snapshot.unit, "token");
- // Unified snapshot is a superset (crate seed + OpenHuman overlay), so it
- // is at least as large as the OpenHuman table and carries every
- // OpenHuman row with its authoritative pricing/window.
- assert!(snapshot.models.len() >= KNOWN_MODEL_PRICING.len());
- for price in KNOWN_MODEL_PRICING {
- let entry = snapshot
- .models
- .iter()
- .find(|m| m.provider == price.provider && m.model_id == price.model_id)
- .unwrap_or_else(|| panic!("missing {} in unified snapshot", price.model_id));
- assert_eq!(
- entry.max_input_tokens,
- Some(u64::from(price.context_window))
- );
- assert_eq!(
- entry.pricing.input_per_token,
- Some(price.input_per_mtok_usd / 1_000_000.0)
- );
- }
- // OpenHuman provenance is recorded alongside any crate-seed sources.
- assert!(snapshot
- .sources
- .iter()
- .any(|s| s.name == TINYAGENTS_CATALOG_SOURCE));
-}
-
#[test]
fn unified_catalog_overlays_local_models() {
let local = vec![LocalCatalogModel {
diff --git a/crates/openhuman-core/src/triage/decision_tests.rs b/crates/openhuman-core/src/triage/decision_tests.rs
index 399a2d97ce..24f0f16291 100644
--- a/crates/openhuman-core/src/triage/decision_tests.rs
+++ b/crates/openhuman-core/src/triage/decision_tests.rs
@@ -1,45 +1,5 @@
use super::*;
-// ── full parse_triage_decision ──────────────────────────────────────
-
-#[test]
-fn parses_clean_fenced_drop() {
- let reply =
- "Here's my verdict:\n```json\n{\"action\":\"drop\",\"reason\":\"duplicate event\"}\n```\n";
- let d = parse_triage_decision(reply).unwrap();
- assert_eq!(d.action, TriageAction::Drop);
- assert_eq!(d.reason, "duplicate event");
- assert!(d.target_agent.is_none());
- assert!(d.prompt.is_none());
-}
-
-#[test]
-fn parses_unfenced_json_with_prose_before() {
- let reply = "I think this one needs human attention.\n\n{\"action\":\"escalate\",\"target_agent\":\"orchestrator\",\"prompt\":\"read the email and draft a reply\",\"reason\":\"complex request\"}";
- let d = parse_triage_decision(reply).unwrap();
- assert_eq!(d.action, TriageAction::Escalate);
- assert_eq!(d.target_agent.as_deref(), Some("orchestrator"));
- assert_eq!(
- d.prompt.as_deref(),
- Some("read the email and draft a reply")
- );
-}
-
-#[test]
-fn parses_react_with_trailing_comma() {
- let reply = "```\n{\n \"action\": \"react\",\n \"target_agent\": \"trigger_reactor\",\n \"prompt\": \"send ack\",\n \"reason\": \"one-step ack needed\",\n}\n```";
- let d = parse_triage_decision(reply).unwrap();
- assert_eq!(d.action, TriageAction::React);
- assert_eq!(d.target_agent.as_deref(), Some("trigger_reactor"));
-}
-
-#[test]
-fn parses_uppercase_action_field() {
- let reply = "{\"action\":\"DROP\",\"reason\":\"noise\"}";
- let d = parse_triage_decision(reply).unwrap();
- assert_eq!(d.action, TriageAction::Drop);
-}
-
#[test]
fn rejects_escalate_without_target_agent() {
let reply = "{\"action\":\"escalate\",\"reason\":\"complex\"}";
@@ -57,28 +17,6 @@ fn rejects_react_without_prompt() {
assert!(matches!(err, ParseError::MissingTarget { action: "react" }));
}
-#[test]
-fn rejects_reply_with_no_json_at_all() {
- let reply = "I don't feel like answering today";
- let err = parse_triage_decision(reply).unwrap_err();
- assert!(matches!(err, ParseError::NoJsonObject));
-}
-
-#[test]
-fn rejects_non_parseable_json() {
- let reply = "{\"action\": not_a_string}";
- let err = parse_triage_decision(reply).unwrap_err();
- assert!(matches!(err, ParseError::InvalidJson(_)));
-}
-
-#[test]
-fn prefers_last_fenced_block() {
- let reply = "```json\n{\"action\":\"escalate\",\"target_agent\":\"orchestrator\",\"prompt\":\"first\",\"reason\":\"a\"}\n```\nactually scratch that:\n```json\n{\"action\":\"drop\",\"reason\":\"never mind\"}\n```";
- let d = parse_triage_decision(reply).unwrap();
- assert_eq!(d.action, TriageAction::Drop);
- assert_eq!(d.reason, "never mind");
-}
-
#[test]
fn owner_relaxed_json_recovery_preserves_action_normalization() {
let reply = "{action: \"DROP\", reason: \"recovered\",}";
diff --git a/crates/openhuman-core/src/web3/wallet/ops_tests.rs b/crates/openhuman-core/src/web3/wallet/ops_tests.rs
index bab4e62071..ab96fbdf76 100644
--- a/crates/openhuman-core/src/web3/wallet/ops_tests.rs
+++ b/crates/openhuman-core/src/web3/wallet/ops_tests.rs
@@ -46,26 +46,6 @@ fn validate_setup_rejects_duplicate_chain() {
.contains("exactly one 'evm'"));
}
-#[test]
-fn validate_setup_rejects_invalid_word_count() {
- let mut params = sample_params();
- params.mnemonic_word_count = 13;
- assert!(validate_setup(&params)
- .expect_err("invalid word count should fail")
- .contains("unsupported mnemonic word count"));
-}
-
-#[test]
-fn word_count_validation_follows_the_wallet_contract() {
- for count in tinywallet_bus::MNEMONIC_WORD_COUNTS {
- let mut params = sample_params();
- params.mnemonic_word_count = count;
- assert!(validate_setup(&params).is_ok(), "{count} words accepted");
- }
- let message = supported_word_counts();
- assert_eq!(message, "12, 15, 18, 21, 24");
-}
-
#[tokio::test]
async fn generate_recovery_phrase_rejects_unsupported_word_count_before_the_module() {
let error = generate_recovery_phrase(&DispatchCtx::process_default(), 13)
diff --git a/tests/tinysearch_module_e2e.rs b/tests/tinysearch_module_e2e.rs
index 76c9620e93..af05da7b4b 100644
--- a/tests/tinysearch_module_e2e.rs
+++ b/tests/tinysearch_module_e2e.rs
@@ -1,8 +1,8 @@
//! Real TinySearch module admission and wire contract, isolated from other runtimes.
-use tinysearch_bus::{names, ExecuteToolRequest, ExecuteToolResponse, ListToolsResponse};
+use tinysearch_bus::SearchConfig;
#[tokio::test]
-async fn pinned_search_module_serves_host_contract_and_rejects_disabled_execution() {
+async fn pinned_search_module_is_admitted_with_the_registered_release() {
use tinybus::{broker::Broker, module::ModuleHost, transport::memory::MemoryBus};
let file = openhuman_core::modules::local_artifact("tinysearch").expect(
"build tinysearch with scripts/modules/build.mjs and set OPENHUMAN_MODULE_SOURCE_DIR",
@@ -11,7 +11,7 @@ async fn pinned_search_module_serves_host_contract_and_rejects_disabled_executio
let broker = Broker::new();
let broker_task = broker.spawn(bus.clone());
let host = ModuleHost::new(broker);
- let config = tinysearch_bus::SearchConfig {
+ let config = SearchConfig {
enabled: false,
..Default::default()
};
@@ -22,41 +22,6 @@ async fn pinned_search_module_serves_host_contract_and_rejects_disabled_executio
// The registry pin is the single statement of which release is shipped.
let pinned = openhuman_core::modules::registry::find("tinysearch").expect("registered");
assert_eq!(info.version, pinned.version);
- let client = tinybus::Connection::connect(bus.connect().await.unwrap())
- .await
- .unwrap();
- tokio::time::timeout(std::time::Duration::from_secs(5), async {
- while !client
- .list_names()
- .await
- .unwrap()
- .iter()
- .any(|name| name.as_str() == names::INTERFACE)
- {
- tokio::task::yield_now().await;
- }
- })
- .await
- .expect("module claims its contract interface");
- let proxy = client
- .proxy(names::INTERFACE, names::OBJECT_PATH, names::INTERFACE)
- .unwrap();
- let tools: ListToolsResponse = proxy.call(names::methods::LIST_TOOLS, ()).await.unwrap();
- assert!(tools.tools.is_empty());
- let failure = proxy
- .call::<ExecuteToolResponse>(
- names::methods::EXECUTE_TOOL,
- (ExecuteToolRequest {
- name: "web_answer_tool".into(),
- arguments: serde_json::json!({ "query": "q" }),
- },),
- )
- .await
- .expect_err("disabled module refuses execution without contacting providers");
- assert!(
- failure.to_string().contains("search is disabled"),
- "{failure}"
- );
host.shutdown(std::time::Duration::from_secs(5)).await;
broker_task.abort();
}