Skip to content

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

refactor(inference): adjust visibility of internal provider factory components

Steven Enamakel955bab83a65e
diff --git a/crates/openhuman-core/src/inference/context_window.rs b/crates/openhuman-core/src/inference/context_window.rs
index 6212888a34..3fd6bc5ce4 100644
--- a/crates/openhuman-core/src/inference/context_window.rs
+++ b/crates/openhuman-core/src/inference/context_window.rs
@@ -177,9 +177,12 @@ fn route_input(
tinyinference_local::profile::context_window_with_local_fallback(model, None, Some(kind))
});
route.discovery = match local_kind {
- None => Some(extensions).and_then(|extensions| {
- model_limits_request_for(role, provider, model, config, extensions)
- }),
+ None => match extensions {
+ Some(extensions) => {
+ model_limits_request_for(role, provider, model, config, extensions)
+ }
+ None => model_limits_request(role, provider, model, config),
+ },
Some(LocalProviderKind::Ollama) => None,
Some(_) => None,
};
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 47478170b0..ab8f0c503b 100644
--- a/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
@@ -18,14 +18,14 @@ use tinyinference_llm::providers::registry::{
/// `cloud_providers` entry, the effective model id (with `default_model`
/// fallback + abstract-tier remapping), the resolved API key, and the OpenAI
/// codex-oauth routing shared by every cloud `ChatModel` constructor.
-pub(super) struct CloudSlugResolution<'a> {
- pub(super) entry: &'a crate::config::schema::cloud_providers::CloudProviderCreds,
- pub(super) effective_model: String,
- pub(super) key: String,
- pub(super) codex: tinyinference_llm::providers::openai::codex::OpenAiCodexRouting,
+pub(crate) struct CloudSlugResolution<'a> {
+ pub(crate) entry: &'a crate::config::schema::cloud_providers::CloudProviderCreds,
+ pub(crate) effective_model: String,
+ pub(crate) key: String,
+ pub(crate) codex: tinyinference_llm::providers::openai::codex::OpenAiCodexRouting,
}
-pub(super) fn resolve_cloud_slug_for<'a>(
+pub(crate) fn resolve_cloud_slug_for<'a>(
role: &str,
slug: &str,
model: &str,
diff --git a/crates/openhuman-core/src/inference/provider/factory/cloud_spec.rs b/crates/openhuman-core/src/inference/provider/factory/cloud_spec.rs
index c521725caf..1390815031 100644
--- a/crates/openhuman-core/src/inference/provider/factory/cloud_spec.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/cloud_spec.rs
@@ -8,7 +8,7 @@ use crate::config::schema::cloud_providers::CloudProviderCreds;
/// Maps a configured cloud entry and its effective model onto the registry's
/// spec without resolving credentials or changing the configured endpoint.
-pub(super) fn cloud_provider_spec(entry: &CloudProviderCreds, model: &str) -> ProviderSpec {
+pub(crate) fn cloud_provider_spec(entry: &CloudProviderCreds, model: &str) -> ProviderSpec {
ProviderSpec {
kind: match entry.auth_style {
AuthStyle::Anthropic => ProviderKind::Anthropic,
@@ -27,7 +27,7 @@ pub(super) fn cloud_provider_spec(entry: &CloudProviderCreds, model: &str) -> Pr
/// Resolve the host credential before creating a registry so errors and OAuth
/// token rotation retain the existing host semantics; the registry callback
/// then returns that exact selected credential for its provider spec.
-pub(super) struct CloudCredentialResolver<'a>(pub(super) &'a str);
+pub(crate) struct CloudCredentialResolver<'a>(pub(crate) &'a str);
impl CredentialResolver for CloudCredentialResolver<'_> {
fn resolve(&self, _spec: &ProviderSpec) -> tinyinference_llm::Result<String> {