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(inference): simplify managed backend model creation
Steven Enamakela8550e298cba
diff --git a/crates/openhuman-core/src/inference/provider/factory.rs b/crates/openhuman-core/src/inference/provider/factory.rsindex 3cee39a584..61b493d4fd 100644--- a/crates/openhuman-core/src/inference/provider/factory.rs+++ b/crates/openhuman-core/src/inference/provider/factory.rs@@ -90,7 +90,7 @@ use local_runtime::{OptionalChatModelResult,};pub(crate) use managed_backend::{- make_openhuman_backend_model_for_options, make_openhuman_backend_model_for_thread,+ make_openhuman_backend_model_for_thread,};use managed_backend::{managed_chat_model, resolve_managed_model};use primary_cloud::{legacy_inference_slug, resolve_primary_cloud_provider_string};diff --git a/crates/openhuman-core/src/inference/provider/factory/managed_backend.rs b/crates/openhuman-core/src/inference/provider/factory/managed_backend.rsindex 707a13fedb..c859ad89c9 100644--- a/crates/openhuman-core/src/inference/provider/factory/managed_backend.rs+++ b/crates/openhuman-core/src/inference/provider/factory/managed_backend.rs@@ -133,29 +133,3 @@ pub(crate) fn make_openhuman_backend_model(managed_chat_model(role, config, None, None, true, None, &EgressLedger::none())}-/// The managed model for a caller that holds runtime options rather than a-/// [`Config`] (the configured `delegate` tool): `model` is used verbatim, with-/// no tier translation and no egress emission, exactly as that tool always did.-pub(crate) fn make_openhuman_backend_model_for_options(- options: &crate::inference::provider::ProviderRuntimeOptions,- model: &str,- thread_id: Option<&str>,-) -> anyhow::Result<ManagedChatModel> {- let Some(entry) = crate::inference::registry::chat_model(PROVIDER_OPENHUMAN) else {- return Err(managed_unavailable_error());- };- let mut config = Config::default();- if let Some(dir) = options.openhuman_dir.as_ref() {- config.config_path = dir.join("config.toml");- }- config.secrets.encrypt = options.secrets_encrypt;- (entry.build)(&crate::inference::registry::ChatModelRequest {- role: "delegate",- config: &config,- model_override: Some(model),- default_model: Some(model),- native_tool_calling: true,- thread_id,- egress: &EgressLedger::none(),- })-}diff --git a/crates/openhuman-core/src/inference/provider/ops/mod.rs b/crates/openhuman-core/src/inference/provider/ops/mod.rsindex 0bfdcce991..b6851b7e89 100644--- a/crates/openhuman-core/src/inference/provider/ops/mod.rs+++ b/crates/openhuman-core/src/inference/provider/ops/mod.rs@@ -4,7 +4,7 @@//! - `sanitize` — secret scrubbing, error formatting//! - `http_error` — HTTP error classification, Sentry routing, `api_error`//! - `models` — model listing (`list_configured_models`, parsing)-//! - `provider_factory` — provider construction (`create_*`, `ProviderRuntimeOptions`)+//! - `provider_factory` — provider construction (`create_*`)mod http_error;mod models;@@ -24,7 +24,7 @@ pub use models::{};pub use provider_factory::{- list_providers, ProviderInfo, ProviderRuntimeOptions, INFERENCE_BACKEND_ID,+ list_providers, ProviderInfo, INFERENCE_BACKEND_ID,};// ── test re-exports for ops_tests.rs ──diff --git a/crates/openhuman-core/src/inference/provider/ops/provider_factory.rs b/crates/openhuman-core/src/inference/provider/ops/provider_factory.rsindex b4f51e92bb..e6b5be44fb 100644--- a/crates/openhuman-core/src/inference/provider/ops/provider_factory.rs+++ b/crates/openhuman-core/src/inference/provider/ops/provider_factory.rs@@ -1,27 +1,6 @@-use std::path::PathBuf;-/// Fixed id for the single inference backend (OpenHuman API).pub const INFERENCE_BACKEND_ID: &str = "openhuman";-#[derive(Debug, Clone)]-pub struct ProviderRuntimeOptions {- pub auth_profile_override: Option<String>,- pub openhuman_dir: Option<PathBuf>,- pub secrets_encrypt: bool,- pub reasoning_enabled: Option<bool>,-}--impl Default for ProviderRuntimeOptions {- fn default() -> Self {- Self {- auth_profile_override: None,- openhuman_dir: None,- secrets_encrypt: true,- reasoning_enabled: None,- }- }-}-/// Information about a supported provider for display purposes.pub struct ProviderInfo {pub name: &'static str,