Skip to content

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

refactor(provider): clean up factory module exports and imports

Steven Enamakele514338eaf6e
diff --git a/crates/openhuman-core/src/inference/host_runtime/ops/complete_once_tests.rs b/crates/openhuman-core/src/inference/host_runtime/ops/complete_once_tests.rs
index 2dfacb265e..d9dfde6d12 100644
--- a/crates/openhuman-core/src/inference/host_runtime/ops/complete_once_tests.rs
+++ b/crates/openhuman-core/src/inference/host_runtime/ops/complete_once_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
use tinyinference_llm::message::Message;
use tinyinference_llm::model::ResponseFormat;
use tinyinference_llm::tool::ToolSchema;
@@ -107,9 +107,7 @@ async fn preserves_configured_endpoint_path_on_the_wire() {
let server = MockServer::start().await;
Mock::given(method("POST"))
.and(path("/private-path-segment/v1/chat/completions"))
- .respond_with(
- ResponseTemplate::new(200).set_body_json(completion_body("ok", "stop")),
- )
+ .respond_with(ResponseTemplate::new(200).set_body_json(completion_body("ok", "stop")))
.mount(&server)
.await;
let endpoint = CompletionEndpoint {
@@ -123,7 +121,10 @@ async fn preserves_configured_endpoint_path_on_the_wire() {
let requests = server.received_requests().await.unwrap();
assert_eq!(requests.len(), 1);
- assert_eq!(requests[0].url.path(), "/private-path-segment/v1/chat/completions");
+ assert_eq!(
+ requests[0].url.path(),
+ "/private-path-segment/v1/chat/completions"
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/inference/provider/factory.rs b/crates/openhuman-core/src/inference/provider/factory.rs
index 2b48b4ad61..5937a1caaf 100644
--- a/crates/openhuman-core/src/inference/provider/factory.rs
+++ b/crates/openhuman-core/src/inference/provider/factory.rs
@@ -30,10 +30,10 @@ pub use chat_model::{
create_chat_model_from_string, create_chat_model_from_string_with_model_id,
create_chat_model_in, create_chat_model_with_model_id_in, probe_inference_readiness,
};
+pub use credentials::{auth_key_for_slug, lookup_key_for_slug};
pub(crate) use credentials::{
openai_bearer_is_oauth, redact_endpoint_origin, resolve_codex_routing,
};
-pub use credentials::{auth_key_for_slug, lookup_key_for_slug};
pub(crate) use discovery::{model_limits_request, model_limits_request_for};
pub(crate) use local_runtime::create_local_chat_model_from_string;
pub(crate) use managed_backend::make_openhuman_backend_model;
@@ -55,8 +55,8 @@ use cloud_slug::{
try_create_cloud_slug_chat_model_with_native_tools_for,
};
use local_runtime::{
- try_create_local_runtime_chat_model, try_create_local_runtime_chat_model_from_string,
- OptionalChatModelResult,
+ OptionalChatModelResult, try_create_local_runtime_chat_model,
+ try_create_local_runtime_chat_model_from_string,
};
#[cfg(test)]
pub(crate) use managed_backend::make_openhuman_backend_model_for_thread;
@@ -91,16 +91,16 @@ pub mod test_provider_override;
#[path = "factory_tests.rs"]
mod factory_tests;
-use crate::config::schema::cloud_providers::AuthStyle;
use crate::config::Config;
+use crate::config::schema::cloud_providers::AuthStyle;
use crate::security::credentials::AuthService;
use crate::security::egress::EgressLedger;
use std::sync::Arc;
use tinyagents_harness::providers::claude_agent_sdk::ClaudeAgentSdkProvider;
use tinyinference_llm::model::{ChatModel, ModelRequest, ModelResponse, ModelStream};
use tinyinference_llm::providers::openai::codex::{
- openai_codex_client_version, openai_codex_user_agent, OPENAI_CODEX_ACCOUNT_HEADER,
- OPENAI_CODEX_ORIGINATOR, OPENAI_CODEX_ORIGINATOR_HEADER,
+ OPENAI_CODEX_ACCOUNT_HEADER, OPENAI_CODEX_ORIGINATOR, OPENAI_CODEX_ORIGINATOR_HEADER,
+ openai_codex_client_version, openai_codex_user_agent,
};
/// Sentinel meaning "use the OpenHuman backend session JWT".
diff --git a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
index d3da10f22d..014d653b19 100644
--- a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
@@ -10,7 +10,7 @@ use crate::inference::provider::factory::access_gates::verify_session_active;
use crate::inference::provider::fallback_diagnostics;
use tinyinference_llm::providers::anthropic::endpoint_is_anthropic_messages;
use tinyinference_llm::providers::registry::{
- resolve_slug_model, ProviderBuildOptions, ProviderRegistry,
+ ProviderBuildOptions, ProviderRegistry, resolve_slug_model,
};
/// Look up a `cloud_providers` entry by slug and build the provider.
diff --git a/crates/openhuman-core/src/inference/provider/factory/cloud_spec_tests.rs b/crates/openhuman-core/src/inference/provider/factory/cloud_spec_tests.rs
index 88f294148c..5ce712f220 100644
--- a/crates/openhuman-core/src/inference/provider/factory/cloud_spec_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/cloud_spec_tests.rs
@@ -1,4 +1,5 @@
use super::*;
+use tinyinference_llm::providers::openai::codex::OpenAiCodexRouting;
use tinyinference_llm::providers::registry::{ProviderBuildOptions, ProviderRegistry};
fn entry(slug: &str, endpoint: &str, auth_style: AuthStyle) -> CloudProviderCreds {
@@ -87,10 +88,12 @@ fn discovery_request_carries_bearer_auth_and_pins_openrouter_sorting() {
.unwrap()
.expect("openrouter has a listing");
assert_eq!(request.endpoint, "https://openrouter.ai/api/v1");
- assert!(request
- .headers
- .iter()
- .any(|(name, value)| name == "Authorization" && value == "Bearer sk-or"));
+ assert!(
+ request
+ .headers
+ .iter()
+ .any(|(name, value)| name == "Authorization" && value == "Bearer sk-or")
+ );
}
#[test]
@@ -143,18 +146,24 @@ fn discovery_request_builds_codex_oauth_listing_request() {
"https://chatgpt.com/backend-api/codex/models?client_version=0.130.0"
);
assert_eq!(request.model, "gpt");
- assert!(request
- .headers
- .iter()
- .any(|(name, value)| name == "Authorization" && value == "Bearer tok"));
- assert!(request
- .headers
- .iter()
- .any(|(name, value)| name == "ChatGPT-Account-ID" && value == "account-123"));
- assert!(request
- .headers
- .iter()
- .any(|(name, value)| name == "originator" && value == "codex_cli_rs"));
+ assert!(
+ request
+ .headers
+ .iter()
+ .any(|(name, value)| name == "Authorization" && value == "Bearer tok")
+ );
+ assert!(
+ request
+ .headers
+ .iter()
+ .any(|(name, value)| name == "ChatGPT-Account-ID" && value == "account-123")
+ );
+ assert!(
+ request
+ .headers
+ .iter()
+ .any(|(name, value)| name == "originator" && value == "codex_cli_rs")
+ );
assert!(request.headers.iter().any(|(name, value)| {
name == "User-Agent" && value == "codex_cli_rs/0.0.0 (OpenHuman 0.64.18)"
}));
diff --git a/crates/openhuman-core/src/inference/provider/factory/credentials.rs b/crates/openhuman-core/src/inference/provider/factory/credentials.rs
index 13386e32ef..4d0d117971 100644
--- a/crates/openhuman-core/src/inference/provider/factory/credentials.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/credentials.rs
@@ -75,10 +75,7 @@ pub(crate) fn resolve_codex_routing(
endpoint: &str,
bearer_key: &str,
bearer_is_oauth: bool,
-) -> std::result::Result<
- tinyinference_llm::providers::openai::codex::OpenAiCodexRouting,
- String,
-> {
+) -> std::result::Result<tinyinference_llm::providers::openai::codex::OpenAiCodexRouting, String> {
let credentials = if slug == "openai" {
match crate::security::credentials::openai_oauth::lookup_openai_oauth_credentials(config) {
Ok(credentials) => credentials,
@@ -89,7 +86,9 @@ pub(crate) fn resolve_codex_routing(
None
}
Err(error) => {
- return Err(format!("[chat-factory] openai oauth lookup failed: {error}"));
+ return Err(format!(
+ "[chat-factory] openai oauth lookup failed: {error}"
+ ));
}
}
} else {
@@ -217,4 +216,3 @@ pub fn lookup_key_for_slug(slug: &str, config: &Config) -> anyhow::Result<String
);
Ok(String::new())
}
-
diff --git a/crates/openhuman-core/src/inference/provider/factory/discovery.rs b/crates/openhuman-core/src/inference/provider/factory/discovery.rs
index 728f8b52de..35eaec4cd6 100644
--- a/crates/openhuman-core/src/inference/provider/factory/discovery.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/discovery.rs
@@ -83,16 +83,15 @@ pub(crate) fn model_limits_request_for(
if resolution.entry.auth_style == AuthStyle::OpenhumanJwt {
return None;
}
- let spec = super::cloud_spec::cloud_provider_spec(resolution.entry, &resolution.effective_model);
+ let spec =
+ super::cloud_spec::cloud_provider_spec(resolution.entry, &resolution.effective_model);
let options = ProviderBuildOptions {
auth_style: Some(resolution.entry.auth_style.into()),
codex: Some(&resolution.codex),
..ProviderBuildOptions::default()
};
- match ProviderRegistry::new(super::cloud_spec::CloudCredentialResolver(
- &resolution.key,
- ))
- .discovery_request(&spec, &options)
+ match ProviderRegistry::new(super::cloud_spec::CloudCredentialResolver(&resolution.key))
+ .discovery_request(&spec, &options)
{
Ok(request) => request,
Err(error) => {
diff --git a/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs b/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs
index 3aef45d5ac..2149dcae5f 100644
--- a/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/local_runtime.rs
@@ -40,7 +40,7 @@ pub(super) fn try_create_local_runtime_chat_model_from_string(
egress: &EgressLedger,
) -> OptionalChatModelResult {
use tinyinference_local::local_runtime::{
- resolve_local_runtime, LocalRuntimeAuth, LocalRuntimeInputs,
+ LocalRuntimeAuth, LocalRuntimeInputs, resolve_local_runtime,
};
// Use the same classifier as privacy and session policy. Canonicalize only
diff --git a/crates/openhuman-core/src/inference/provider/factory/routing_tests.rs b/crates/openhuman-core/src/inference/provider/factory/routing_tests.rs
index 109b68a11d..a871a5d70e 100644
--- a/crates/openhuman-core/src/inference/provider/factory/routing_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/routing_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::config::Config;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::inference::provider::factory::resolves_to_managed_backend;
fn byok_openai_compatible_entry() -> CloudProviderCreds {
diff --git a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
index e922f8bac7..eedc1a4fe6 100644
--- a/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory_crate_native_tests.rs
@@ -80,9 +80,11 @@ fn enforce_local_only_inference_errors_on_external_when_local_only() {
Err(error) => error,
Ok(_) => panic!("direct Claude Code model must preserve the privacy gate"),
};
- assert!(claude_code_error
- .to_string()
- .contains("Local-only privacy mode"));
+ assert!(
+ claude_code_error
+ .to_string()
+ .contains("Local-only privacy mode")
+ );
// Both the default factory and a thread-attached managed picker route must
// hit the managed resolver's privacy gate before any backend client exists.
@@ -466,9 +468,11 @@ fn create_chat_model_routes_anthropic_auth_cloud_slug_to_crate_native() {
identity.starts_with("anthropic:https://api.anthropic.com/v1:claude-sonnet-4-6"),
"expected the native Messages adapter, got identity {identity}"
);
- assert!(model
- .profile()
- .is_some_and(|p| p.tool_calling && p.streaming));
+ assert!(
+ model
+ .profile()
+ .is_some_and(|p| p.tool_calling && p.streaming)
+ );
}
/// Text mode (prompt-guided tools) is only implemented on the Chat Completions
diff --git a/crates/openhuman-core/src/inference/provider/factory_explicit_ctx_tests.rs b/crates/openhuman-core/src/inference/provider/factory_explicit_ctx_tests.rs
index 21b3776433..89f3f8d016 100644
--- a/crates/openhuman-core/src/inference/provider/factory_explicit_ctx_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory_explicit_ctx_tests.rs
@@ -5,8 +5,8 @@ async fn managed_factory_and_probe_use_the_explicit_provider_entry() {
use crate::core::runtime::{CoreContext, DispatchCtx, DomainSet};
use crate::core::slots::Extensions;
use crate::inference::registry::{ChatModelEntry, ProviderModelHooks};
- use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
+ use std::sync::atomic::{AtomicBool, Ordering};
use tinyinference_llm::message::Message;
use tinyinference_llm::model::ModelRequest;
@@ -121,12 +121,12 @@ async fn managed_factory_and_probe_use_the_explicit_provider_entry() {
#[tokio::test]
async fn hosted_cloud_slug_uses_explicit_auth_policy_and_model_entry() {
use crate::config::schema::cloud_providers::{
- register_hosted_cloud_provider_policy_in, AuthStyle, CloudProviderCreds,
+ AuthStyle, CloudProviderCreds, register_hosted_cloud_provider_policy_in,
};
use crate::core::runtime::{CoreContext, DispatchCtx, DomainSet};
use crate::core::slots::Extensions;
use crate::inference::registry::{
- register_catalog_in, CatalogEntry, ChatModelEntry, ProviderModelHooks,
+ CatalogEntry, ChatModelEntry, ProviderModelHooks, register_catalog_in,
};
use std::sync::Arc;
use tinyinference_llm::message::Message;
diff --git a/crates/openhuman-core/src/inference/provider/factory_tests.rs b/crates/openhuman-core/src/inference/provider/factory_tests.rs
index 5c837b5d7d..4d90ae3028 100644
--- a/crates/openhuman-core/src/inference/provider/factory_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/factory_tests.rs
@@ -1,6 +1,6 @@
use super::*;
-use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::config::Config;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::security::credentials::AuthService;
use tempfile::TempDir;
@@ -231,7 +231,7 @@ fn deepseek_entry(id: &str) -> CloudProviderCreds {
/// A config carrying a resolved model, as `agent_chat` leaves it after applying
/// `model_override` and before building the agent.
fn routed_config(endpoint: &str, api_key: &str, model: &str) -> Config {
- use crate::config::schema::ephemeral_route::{apply, EphemeralRoute};
+ use crate::config::schema::ephemeral_route::{EphemeralRoute, apply};
let mut config = Config {
default_model: Some(model.to_string()),
..Config::default()
diff --git a/crates/openhuman-core/src/inference/provider/http_error.rs b/crates/openhuman-core/src/inference/provider/http_error.rs
index e74013b0d0..cab64a883f 100644
--- a/crates/openhuman-core/src/inference/provider/http_error.rs
+++ b/crates/openhuman-core/src/inference/provider/http_error.rs
@@ -10,9 +10,9 @@ 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::demotion::{DemotionKind, demote_decision};
use tinyinference_llm::failure::http::{
- classify_and_report_http_failure, ErrorReporter, ProviderHttpFailure, ProviderHttpFailureFacts,
+ ErrorReporter, ProviderHttpFailure, ProviderHttpFailureFacts, classify_and_report_http_failure,
};
use tinyinference_llm::failure::{
local_provider_no_model_loaded_user_message, ollama_cloud_internal_500_user_message,
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 42dab3b4fd..1f8343f0c1 100644
--- a/crates/openhuman-core/src/inference/provider/http_error_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/http_error_tests.rs
@@ -15,7 +15,7 @@ const FIXTURE_BACKEND: &str = "fixture-managed-provider";
fn install_fixture_backend_classifier() {
use crate::inference::registry::{
- register_backend_error_classifier, BackendErrorClassification,
+ BackendErrorClassification, register_backend_error_classifier,
};
register_backend_error_classifier(std::sync::Arc::new(|provider, _message| {
BackendErrorClassification {
@@ -86,10 +86,11 @@ async fn api_error_replaces_no_model_loaded_body_with_guidance() {
),
)
.await;
- assert!(err
- .to_string()
- .to_ascii_lowercase()
- .contains("load a model"));
+ assert!(
+ err.to_string()
+ .to_ascii_lowercase()
+ .contains("load a model")
+ );
}
#[tokio::test]
@@ -361,7 +362,7 @@ fn skips_sentry_report_for_transient_upstream_statuses() {
fn provider_http_policy_uses_registered_error_ownership_metadata() {
use crate::core::slots::Extensions;
use crate::inference::registry::{
- register_backend_error_classifier_in, BackendErrorClassification, BackendErrorKind,
+ BackendErrorClassification, BackendErrorKind, register_backend_error_classifier_in,
};
use std::sync::Arc;
@@ -401,7 +402,7 @@ fn provider_http_policy_uses_registered_error_ownership_metadata() {
fn quota_demotion_precedes_backend_owned_error_code_guard() {
use crate::core::slots::Extensions;
use crate::inference::registry::{
- register_backend_error_classifier_in, BackendErrorClassification,
+ BackendErrorClassification, register_backend_error_classifier_in,
};
use std::sync::Arc;
use tinyinference_llm::failure::demotion::DemotionKind;
@@ -455,7 +456,7 @@ fn quota_demotion_precedes_backend_owned_error_code_guard() {
#[test]
fn managed_unknown_model_remains_user_configuration_state() {
- use tinyinference_llm::failure::demotion::{demote_decision, DemotionKind};
+ use tinyinference_llm::failure::demotion::{DemotionKind, demote_decision};
let facts = tinyinference_llm::failure::http::classify_http_failure(
"openhuman",
StatusCode::BAD_REQUEST.as_u16(),
@@ -469,7 +470,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::demotion::{demote_decision, DemotionKind};
+ use tinyinference_llm::failure::demotion::{DemotionKind, demote_decision};
let config_phrase = tinyinference_llm::failure::http::classify_http_failure(
"openhuman",
StatusCode::BAD_REQUEST.as_u16(),
@@ -490,7 +491,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::demotion::{demote_decision, DemotionKind};
+ use tinyinference_llm::failure::demotion::{DemotionKind, demote_decision};
let cases = [
(
"custom_openai",
diff --git a/crates/openhuman-core/src/inference/provider/mod.rs b/crates/openhuman-core/src/inference/provider/mod.rs
index 546468f36c..d87ab54b1f 100644
--- a/crates/openhuman-core/src/inference/provider/mod.rs
+++ b/crates/openhuman-core/src/inference/provider/mod.rs
@@ -11,9 +11,9 @@ pub mod http_error;
pub mod models;
pub use factory::{
- create_chat_model_from_string, create_chat_model_from_string_with_model_id,
- create_chat_model_in, create_chat_model_with_model_id_in, probe_inference_readiness,
- provider_for_role, BYOK_INCOMPLETE_SENTINEL,
+ BYOK_INCOMPLETE_SENTINEL, create_chat_model_from_string,
+ create_chat_model_from_string_with_model_id, create_chat_model_in,
+ create_chat_model_with_model_id_in, probe_inference_readiness, provider_for_role,
};
#[cfg(test)]
diff --git a/crates/openhuman-core/src/inference/provider/model_listing_test_support.rs b/crates/openhuman-core/src/inference/provider/model_listing_test_support.rs
index ac18c4596e..757c81ee9a 100644
--- a/crates/openhuman-core/src/inference/provider/model_listing_test_support.rs
+++ b/crates/openhuman-core/src/inference/provider/model_listing_test_support.rs
@@ -1,17 +1,17 @@
-use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::config::Config;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::security::credentials::AuthService;
use axum::{
+ Json, Router,
extract::State,
http::{HeaderMap, StatusCode},
response::{IntoResponse, Response},
routing::get,
- Json, Router,
};
use std::collections::HashMap;
use std::sync::{
- atomic::{AtomicUsize, Ordering as AtomicOrdering},
Arc, Mutex,
+ atomic::{AtomicUsize, Ordering as AtomicOrdering},
};
use tempfile::TempDir;
diff --git a/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs b/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
index a2ef9b5852..5aa934a780 100644
--- a/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
+++ b/crates/openhuman-core/src/inference/provider/models/catalog_listing.rs
@@ -6,13 +6,13 @@
use super::super::factory::resolve_codex_routing;
use super::local_runtime::synthesize_local_runtime_entry;
use tinyinference_llm::catalog::{
- append_query_param, endpoint_hosts_models_listing, is_openrouter_provider, list_models,
- merge_openai_codex_model_hints, validate_openrouter_key, ModelInfo,
+ ModelInfo, append_query_param, endpoint_hosts_models_listing, is_openrouter_provider,
+ list_models, merge_openai_codex_model_hints, validate_openrouter_key,
};
use tinyinference_llm::model::discover::DiscoveryRequest;
use tinyinference_llm::providers::openai::codex::{
- openai_codex_client_version, openai_codex_user_agent, OpenAiCodexRouting,
OPENAI_CODEX_ACCOUNT_HEADER, OPENAI_CODEX_ORIGINATOR, OPENAI_CODEX_ORIGINATOR_HEADER,
+ OpenAiCodexRouting, openai_codex_client_version, openai_codex_user_agent,
};
/// Resolve the API key used to probe a provider's `/models` endpoint.
diff --git a/crates/openhuman-core/src/inference/provider/models/catalog_listing_error_tests.rs b/crates/openhuman-core/src/inference/provider/models/catalog_listing_error_tests.rs
index 138f9c5e8d..d96e3b5331 100644
--- a/crates/openhuman-core/src/inference/provider/models/catalog_listing_error_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/models/catalog_listing_error_tests.rs
@@ -6,7 +6,7 @@ use crate::inference::provider::model_listing_test_support::{
};
use axum::http::StatusCode;
use std::sync::atomic::Ordering as AtomicOrdering;
-use tinyinference_core::sanitize::{sanitize_api_error, MAX_API_ERROR_CHARS};
+use tinyinference_core::sanitize::{MAX_API_ERROR_CHARS, sanitize_api_error};
#[test]
fn list_configured_models_accepts_slug() {
@@ -14,8 +14,8 @@ fn list_configured_models_accepts_slug() {
// passes a slug instead of the opaque random id. This lets the frontend
// call the RPC before the provider config has been persisted (where only
// the slug is stable).
- use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::config::Config;
+ use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
let mut config = Config::default();
config.cloud_providers.push(CloudProviderCreds {
diff --git a/crates/openhuman-core/src/inference/provider/models/catalog_listing_tests.rs b/crates/openhuman-core/src/inference/provider/models/catalog_listing_tests.rs
index 05754fc669..1591a19760 100644
--- a/crates/openhuman-core/src/inference/provider/models/catalog_listing_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/models/catalog_listing_tests.rs
@@ -1,8 +1,8 @@
use super::*;
use super::local_runtime::synthesize_local_runtime_entry;
-use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::config::Config;
+use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
use crate::inference::provider::model_listing_test_support::{
configure_generic_workspace, spawn_static_models_server,
};
diff --git a/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_lifecycle_tests.rs b/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_lifecycle_tests.rs
index c6cf38d2ba..cf9aba0188 100644
--- a/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_lifecycle_tests.rs
+++ b/crates/openhuman-core/src/security/credentials/openai_oauth/flow_tests_lifecycle_tests.rs
@@ -281,11 +281,13 @@ fn persist_openai_oauth_token_stores_oauth_profile_with_metadata() {
.and_then(|set| set.refresh_token.as_deref()),
Some("refresh-token")
);
- assert!(profile
- .token_set
- .as_ref()
- .and_then(|set| set.expires_at)
- .is_some());
+ assert!(
+ profile
+ .token_set
+ .as_ref()
+ .and_then(|set| set.expires_at)
+ .is_some()
+ );
let data = AuthProfilesStore::new(tmp.path(), false).load().unwrap();
let stored = data.profiles.get(&profile.id).unwrap();
@@ -452,7 +454,7 @@ fn import_codex_cli_auth_file_reports_missing_file_with_login_hint() {
/// `.codex/auth.json` anchor from a message, this test fails in CI.
#[test]
fn codex_import_user_state_errors_classify_as_expected() {
- use crate::core::observability::{expected_error_kind, ExpectedErrorKind};
+ use crate::core::observability::{ExpectedErrorKind, expected_error_kind};
let tmp = tempdir().unwrap();
let config = test_config(&tmp);