Skip to content

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

refactor(inference): use route owner for default model identification

Steven Enamakelea5c406dc7c3
diff --git a/crates/openhuman-core/src/inference/http/backend.rs b/crates/openhuman-core/src/inference/http/backend.rs
index f5222791f1..c9f0ee451a 100644
--- a/crates/openhuman-core/src/inference/http/backend.rs
+++ b/crates/openhuman-core/src/inference/http/backend.rs
@@ -103,7 +103,7 @@ pub(super) fn configured_models(config: &Config) -> Vec<ListedModel> {
{
// A configured default is known to be managed even when its model id
// contains a colon (for example `qwen3:14b`).
- push(default_model.to_string(), "openhuman");
+ push(route_owner(default_model).0, "openhuman");
}
for cp in &config.cloud_providers {
diff --git a/crates/openhuman-core/src/inference/http/backend_tests.rs b/crates/openhuman-core/src/inference/http/backend_tests.rs
index dc2935d433..5509a8b8bd 100644
--- a/crates/openhuman-core/src/inference/http/backend_tests.rs
+++ b/crates/openhuman-core/src/inference/http/backend_tests.rs
@@ -27,7 +27,7 @@ fn configured_models_lists_sentinel_and_strips_temperature_suffix() {
#[test]
fn configured_managed_default_keeps_colon_bearing_model_owner() {
let config = Config {
- default_model: Some("qwen3:14b".to_string()),
+ default_model: Some("qwen3:14b@NaN".to_string()),
..Config::default()
};
let listed = configured_models(&config);
diff --git a/crates/openhuman-core/src/inference/provider/factory/access_gates.rs b/crates/openhuman-core/src/inference/provider/factory/access_gates.rs
index 2eb2f5642f..3fa6d15077 100644
--- a/crates/openhuman-core/src/inference/provider/factory/access_gates.rs
+++ b/crates/openhuman-core/src/inference/provider/factory/access_gates.rs
@@ -2,6 +2,7 @@
//! `LocalOnly` enforcement, the backend-session requirement, and egress disclosure.
use super::*;
+use tinyinference_providers::route::ProviderRoute;
/// Human-readable label for an *external* provider string, used in the
/// LocalOnly privacy-mode block message so the user knows what was refused.
@@ -19,11 +20,12 @@ pub(super) fn external_provider_label(provider: &str) -> String {
if p.starts_with(tinyagents_harness::providers::claude_code::PROVIDER_PREFIX) {
return "Claude Code CLI".to_string();
}
- // Concrete cloud slug "<slug>:<model>" → surface just the slug.
- match p.split_once(':') {
- Some((slug, _)) if !slug.trim().is_empty() => slug.trim().to_string(),
- _ => p.to_string(),
- }
+ // A concrete external route exposes just its provider slug.
+ ProviderRoute::parse(p)
+ .filter(ProviderRoute::is_external)
+ .map(|route| route.provider.trim().to_string())
+ .filter(|slug| !slug.is_empty())
+ .unwrap_or_else(|| p.to_string())
}
/// Privacy Mode (#4435) pure decision: under `mode`, is constructing chat
@@ -52,6 +54,9 @@ pub(super) fn local_only_violation(
if tinyinference_local::profile::is_local_provider_string(p) {
return None;
}
+ if ProviderRoute::parse(p).is_some_and(|route| !route.is_external()) {
+ return None;
+ }
Some(external_provider_label(p))
}