Skip to content

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

refactor(inference): import demotion items from their module path

Steven Enamakel70ed524a7e83
diff --git a/crates/openhuman-core/src/inference/provider/http_error.rs b/crates/openhuman-core/src/inference/provider/http_error.rs
index f41cee0ede..e74013b0d0 100644
--- a/crates/openhuman-core/src/inference/provider/http_error.rs
+++ b/crates/openhuman-core/src/inference/provider/http_error.rs
@@ -10,6 +10,7 @@ mod tests;
use crate::inference::registry::classify_backend_error;
use tinyinference_core::sanitize::sanitize_api_error;
+use tinyinference_llm::failure::demotion::{demote_decision, DemotionKind};
use tinyinference_llm::failure::http::{
classify_and_report_http_failure, ErrorReporter, ProviderHttpFailure, ProviderHttpFailureFacts,
};
@@ -17,7 +18,6 @@ use tinyinference_llm::failure::{
local_provider_no_model_loaded_user_message, ollama_cloud_internal_500_user_message,
should_report_provider_http_status,
};
-use tinyinference_llm::failure::demotion::{demote_decision, DemotionKind};
/// Whether a non-2xx provider status is worth a per-attempt Sentry report.
pub fn should_report_provider_http_failure(status: reqwest::StatusCode) -> bool {
diff --git a/crates/openhuman-core/src/inference/provider/http_error_tests.rs b/crates/openhuman-core/src/inference/provider/http_error_tests.rs
index a5f691d65a..09f94ef793 100644
--- a/crates/openhuman-core/src/inference/provider/http_error_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/http_error_tests.rs
@@ -404,7 +404,7 @@ fn quota_demotion_precedes_backend_owned_error_code_guard() {
register_backend_error_classifier_in, BackendErrorClassification,
};
use std::sync::Arc;
- use tinyinference_llm::failure::DemotionKind;
+ use tinyinference_llm::failure::demotion::DemotionKind;
const PROVIDER: &str = "fixture-owned-code-provider";
const BODY: &str = "MONTHLY_REQUEST_COUNT quota exceeded OWNED_CODE";
let extensions = Extensions::new();
@@ -455,7 +455,7 @@ fn quota_demotion_precedes_backend_owned_error_code_guard() {
#[test]
fn managed_unknown_model_remains_user_configuration_state() {
- use tinyinference_llm::failure::{demote_decision, DemotionKind};
+ use tinyinference_llm::failure::demotion::{demote_decision, DemotionKind};
let facts = tinyinference_llm::failure::http::classify_http_failure(
"openhuman",
StatusCode::BAD_REQUEST.as_u16(),
@@ -469,7 +469,7 @@ fn managed_unknown_model_remains_user_configuration_state() {
#[test]
fn managed_provider_config_phrase_remains_reportable_but_unknown_model_demotes() {
- use tinyinference_llm::failure::{demote_decision, DemotionKind};
+ use tinyinference_llm::failure::demotion::{demote_decision, DemotionKind};
let config_phrase = tinyinference_llm::failure::http::classify_http_failure(
"openhuman",
StatusCode::BAD_REQUEST.as_u16(),
@@ -490,7 +490,7 @@ fn managed_provider_config_phrase_remains_reportable_but_unknown_model_demotes()
#[test]
fn config_rejection_demotion_keeps_provider_status_and_polarity() {
- use tinyinference_llm::failure::{demote_decision, DemotionKind};
+ use tinyinference_llm::failure::demotion::{demote_decision, DemotionKind};
let cases = [
(
"custom_openai",