The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(tests): remove old error code tests and update tier config structs
Steven Enamakel75219615492c
diff --git a/crates/openhuman-core/src/inference/provider/http_error_tests.rs b/crates/openhuman-core/src/inference/provider/http_error_tests.rsindex c9307e7687..48e27feb22 100644--- a/crates/openhuman-core/src/inference/provider/http_error_tests.rs+++ b/crates/openhuman-core/src/inference/provider/http_error_tests.rs@@ -342,67 +342,6 @@ fn skips_sentry_report_for_transient_upstream_statuses() {}}-#[test]-fn backend_error_code_owned_gates_managed_errors_except_malformed_bad_request() {- const PROVIDER_LABEL: &str = "OpenHuman";-- // F2/F4: backend-owned / expected-user-state errorCodes must NOT page the- // provider HTTP layer.- for code in [- "RATE_LIMITED",- "USER_INSUFFICIENT_CREDITS",- "UPSTREAM_UNAVAILABLE",- "MODEL_UNAVAILABLE",- "INTERNAL_ERROR",- ] {- let body = format!("{{\"error\":{{\"errorCode\":\"{code}\",\"message\":\"x\"}}}}");- assert!(- is_backend_error_code_owned(PROVIDER_LABEL, &body),- "errorCode={code} must be backend-owned (no provider-layer Sentry)"- );- }-- // A user-param BAD_REQUEST is still backend-owned (F8 only carves out the- // malformed variant).- assert!(is_backend_error_code_owned(- PROVIDER_LABEL,- "{\"error\":{\"errorCode\":\"BAD_REQUEST\",\"message\":\"bad param\"}}"- ));-- // Client-guard-leak codes page: the client enforces these limits before- // sending (attachment size gates; context-window management), so a backend- // rejection means our guard leaked — the gate must NOT claim them.- for code in ["PAYLOAD_TOO_LARGE", "CONTEXT_LENGTH_EXCEEDED"] {- let body = format!("{{\"error\":{{\"errorCode\":\"{code}\",\"message\":\"x\"}}}}");- assert!(- !is_backend_error_code_owned(PROVIDER_LABEL, &body),- "errorCode={code} is a client guard leak and must page (not owned)"- );- }-- // F8: a backend-flagged malformed BAD_REQUEST is also a case the FE still- // pages — the gate must NOT claim it.- assert!(!is_backend_error_code_owned(- PROVIDER_LABEL,- "{\"error\":{\"errorCode\":\"BAD_REQUEST\",\"malformed\":true}}"- ));-- // BYO (no errorCode) is never claimed by this gate — it falls through to- // the status-based decision.- assert!(!is_backend_error_code_owned(- PROVIDER_LABEL,- "{\"error\":{\"message\":\"Incorrect API key provided\"}}"- ));-- // CodeRabbit: a BYO / direct provider whose body merely contains an- // `errorCode`-shaped field must NOT be claimed as backend-owned — the- // provider gate keeps it reaching Sentry via the status decision.- assert!(!is_backend_error_code_owned(- "custom_openai",- "{\"error\":{\"errorCode\":\"RATE_LIMITED\"}}"- ));-}-// Exercises the real `config_rejection_demoted` decision used// by `api_error`, including the inverted provider-aware polarity.mod provider_config_rejection_suppression {diff --git a/crates/openhuman-tinyhumans/src/inference/tiers_tests.rs b/crates/openhuman-tinyhumans/src/inference/tiers_tests.rsindex 1e15331c90..dc2a5012e9 100644--- a/crates/openhuman-tinyhumans/src/inference/tiers_tests.rs+++ b/crates/openhuman-tinyhumans/src/inference/tiers_tests.rs@@ -32,7 +32,7 @@ fn hosted_normalizer_covers_all_legacy_model_fields_and_preserves_non_tiers() {config.orchestrator.model = Some("reasoning-quick-v1".to_string());config.teams.insert("team".to_string(),- openhuman_embed::__host::config::schema::TeamConfig {+ openhuman_embed::__host::config::schema::TeamModelConfig {lead_model: Some("chat-v1".to_string()),agent_model: Some("burst-v1".to_string()),..Default::default()@@ -48,23 +48,23 @@ fn hosted_normalizer_covers_all_legacy_model_fields_and_preserves_non_tiers() {},);config.model_routes.push(- openhuman_embed::__host::config::schema::ModelRoute {+ openhuman_embed::__host::config::schema::ModelRouteConfig {+ hint: "summary".to_string(),model: "summarization-v1".to_string(),- ..Default::default()},);config.model_routes.extend([- openhuman_embed::__host::config::schema::ModelRoute {+ openhuman_embed::__host::config::schema::ModelRouteConfig {+ hint: "custom".to_string(),model: "vendor/pinned".to_string(),- ..Default::default()},- openhuman_embed::__host::config::schema::ModelRoute {+ openhuman_embed::__host::config::schema::ModelRouteConfig {+ hint: "unknown".to_string(),model: "hint:unknown".to_string(),- ..Default::default()},- openhuman_embed::__host::config::schema::ModelRoute {+ openhuman_embed::__host::config::schema::ModelRouteConfig {+ hint: "blank".to_string(),model: String::new(),- ..Default::default()},]);