Skip to content

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

chore: files changed crates/openhuman-core/src/config/schema/cloud_providers.rs,crates/openhuman-cor

Steven Enamakel990ecb8ae472
diff --git a/crates/openhuman-core/src/config/schema/cloud_providers.rs b/crates/openhuman-core/src/config/schema/cloud_providers.rs
index a0b05b0923..75dcea56ba 100644
--- a/crates/openhuman-core/src/config/schema/cloud_providers.rs
+++ b/crates/openhuman-core/src/config/schema/cloud_providers.rs
@@ -192,7 +192,7 @@ pub const BUILTIN_CLOUD_PROVIDERS: &[BuiltinCloudProvider] = &[
},
];
-fn builtin_cloud_provider(type_str: &str) -> Option<&'static BuiltinCloudProvider> {
+pub(crate) fn builtin_cloud_provider(type_str: &str) -> Option<&'static BuiltinCloudProvider> {
BUILTIN_CLOUD_PROVIDERS
.iter()
.find(|provider| provider.slug == type_str)
diff --git a/crates/openhuman-core/src/config/schema/mod.rs b/crates/openhuman-core/src/config/schema/mod.rs
index 0b8344d619..81e105a1c1 100644
--- a/crates/openhuman-core/src/config/schema/mod.rs
+++ b/crates/openhuman-core/src/config/schema/mod.rs
@@ -3,10 +3,7 @@
//! Split into submodules; this module re-exports the main `Config` and all public types.
pub mod cloud_providers;
-pub use cloud_providers::{
- generate_provider_id, is_slug_reserved, migrate_legacy_fields, AuthStyle, CloudProviderCreds,
- CloudProviderType,
-};
+pub use cloud_providers::{generate_provider_id, is_slug_reserved, AuthStyle, CloudProviderCreds};
pub mod ephemeral_route;
pub use ephemeral_route::{EphemeralRoute, EPHEMERAL_ROUTE_SLUG};
mod agent;
diff --git a/crates/openhuman-core/src/config/schemas/controllers/inference.rs b/crates/openhuman-core/src/config/schemas/controllers/inference.rs
index 0a5b17a1b6..3a55033b25 100644
--- a/crates/openhuman-core/src/config/schemas/controllers/inference.rs
+++ b/crates/openhuman-core/src/config/schemas/controllers/inference.rs
@@ -61,7 +61,7 @@ pub(super) fn handle_update_model_settings(params: Map<String, Value>) -> Contro
.cloud_providers
.map(|entries| {
use crate::config::schema::cloud_providers::{
- generate_provider_id, is_slug_reserved, migrate_legacy_fields, AuthStyle,
+ generate_provider_id, is_slug_reserved, builtin_cloud_provider, AuthStyle,
CloudProviderCreds,
};
let reserved_count = entries
@@ -99,10 +99,14 @@ pub(super) fn handle_update_model_settings(params: Map<String, Value>) -> Contro
"cloud provider slug must not be empty".to_string()
);
}
+ let legacy_auth = e.legacy_type.as_deref()
+ .and_then(builtin_cloud_provider)
+ .map(|provider| provider.auth_style.as_str())
+ .unwrap_or("bearer");
let auth_style = match e
.auth_style
.as_deref()
- .unwrap_or("bearer")
+ .unwrap_or(legacy_auth)
.to_ascii_lowercase()
.as_str()
{
@@ -125,17 +129,14 @@ pub(super) fn handle_update_model_settings(params: Map<String, Value>) -> Contro
.label
.filter(|s| !s.trim().is_empty())
.unwrap_or_else(|| slug.clone());
- let mut entry = CloudProviderCreds {
+ let entry = CloudProviderCreds {
id,
slug,
label,
endpoint: e.endpoint,
auth_style,
- legacy_type: e.legacy_type,
default_model: e.default_model,
};
- // Apply any remaining legacy-field migration.
- migrate_legacy_fields(&mut entry);
Ok(entry)
})
.collect::<Result<Vec<_>, String>>()
diff --git a/crates/openhuman-core/src/config/schemas/helpers.rs b/crates/openhuman-core/src/config/schemas/helpers.rs
index 1dd0369c89..fcaf49a084 100644
--- a/crates/openhuman-core/src/config/schemas/helpers.rs
+++ b/crates/openhuman-core/src/config/schemas/helpers.rs
@@ -30,6 +30,8 @@ pub(super) struct CloudProviderUpdate {
#[serde(default)]
pub(super) ca_cert_pem: Option<String>,
/// Legacy field — tolerated on read for back-compat but not required.
+ // keep until v0.66 (review after 2027-01-11): incoming RPC discriminator
+ // remains accepted until shipped-client parameter coverage exists.
#[serde(rename = "type", default)]
pub(super) legacy_type: Option<String>,
/// Legacy field — tolerated on read.
diff --git a/tests/raw_coverage/inference_local_admin_raw_coverage_e2e.rs b/tests/raw_coverage/inference_local_admin_raw_coverage_e2e.rs
index 08e8b3e696..b575fe5559 100644
--- a/tests/raw_coverage/inference_local_admin_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_local_admin_raw_coverage_e2e.rs
@@ -140,7 +140,6 @@ async fn provider_model_listing_covers_local_synthesis_and_openrouter_failures()
label: "OpenRouter".to_string(),
endpoint: format!("{base}/openrouter-error"),
auth_style: CloudAuthStyle::Bearer,
- legacy_type: None,
default_model: None,
},
CloudProviderCreds {
@@ -149,7 +148,6 @@ async fn provider_model_listing_covers_local_synthesis_and_openrouter_failures()
label: "Array Body".to_string(),
endpoint: format!("{base}/array-body"),
auth_style: CloudAuthStyle::None,
- legacy_type: None,
default_model: None,
},
CloudProviderCreds {
@@ -158,7 +156,6 @@ async fn provider_model_listing_covers_local_synthesis_and_openrouter_failures()
label: "Status Body".to_string(),
endpoint: format!("{base}/status-body"),
auth_style: CloudAuthStyle::None,
- legacy_type: None,
default_model: None,
},
];
diff --git a/tests/raw_coverage/inference_provider_admin_round22_raw_coverage_e2e.rs b/tests/raw_coverage/inference_provider_admin_round22_raw_coverage_e2e.rs
index 5abc5b3322..5fd1f79bd6 100644
--- a/tests/raw_coverage/inference_provider_admin_round22_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_provider_admin_round22_raw_coverage_e2e.rs
@@ -477,7 +477,6 @@ fn provider_entry(
label: slug.to_string(),
endpoint: endpoint.to_string(),
auth_style,
- legacy_type: None,
default_model: default_model.map(ToString::to_string),
}
}
diff --git a/tests/raw_coverage/inference_provider_raw_coverage_e2e.rs b/tests/raw_coverage/inference_provider_raw_coverage_e2e.rs
index 2f27186c7f..b677caf319 100644
--- a/tests/raw_coverage/inference_provider_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_provider_raw_coverage_e2e.rs
@@ -71,7 +71,6 @@ async fn provider_factory_and_model_listing_cover_cloud_local_and_invalid_shapes
label: "Custom".to_string(),
endpoint: format!("{base}/v1"),
auth_style: CloudAuthStyle::Bearer,
- legacy_type: None,
default_model: Some("demo-chat".to_string()),
},
CloudProviderCreds {
@@ -80,7 +79,6 @@ async fn provider_factory_and_model_listing_cover_cloud_local_and_invalid_shapes
label: "OpenRouter".to_string(),
endpoint: format!("{base}/openrouter"),
auth_style: CloudAuthStyle::Bearer,
- legacy_type: None,
default_model: None,
},
CloudProviderCreds {
@@ -89,7 +87,6 @@ async fn provider_factory_and_model_listing_cover_cloud_local_and_invalid_shapes
label: "Missing".to_string(),
endpoint: format!("{base}/missing"),
auth_style: CloudAuthStyle::None,
- legacy_type: None,
default_model: None,
},
CloudProviderCreds {
@@ -98,7 +95,6 @@ async fn provider_factory_and_model_listing_cover_cloud_local_and_invalid_shapes
label: "HTML".to_string(),
endpoint: format!("{base}/html"),
auth_style: CloudAuthStyle::None,
- legacy_type: None,
default_model: None,
},
CloudProviderCreds {
@@ -107,7 +103,6 @@ async fn provider_factory_and_model_listing_cover_cloud_local_and_invalid_shapes
label: "Wrong Data".to_string(),
endpoint: format!("{base}/wrong-data"),
auth_style: CloudAuthStyle::None,
- legacy_type: None,
default_model: None,
},
CloudProviderCreds {
@@ -116,7 +111,6 @@ async fn provider_factory_and_model_listing_cover_cloud_local_and_invalid_shapes
label: "Error Payload".to_string(),
endpoint: format!("{base}/error-payload"),
auth_style: CloudAuthStyle::None,
- legacy_type: None,
default_model: None,
},
];
diff --git a/tests/raw_coverage/inference_voice_http_round23_raw_coverage_e2e.rs b/tests/raw_coverage/inference_voice_http_round23_raw_coverage_e2e.rs
index a88e422990..cef64f02ac 100644
--- a/tests/raw_coverage/inference_voice_http_round23_raw_coverage_e2e.rs
+++ b/tests/raw_coverage/inference_voice_http_round23_raw_coverage_e2e.rs
@@ -75,7 +75,6 @@ async fn http_models_and_chat_use_mocked_ollama_without_real_runtime() {
label: "Round 23".to_string(),
endpoint: format!("{base}/cloud"),
auth_style: CloudAuthStyle::None,
- legacy_type: None,
default_model: Some("[email protected]".to_string()),
}];
config.save().await.expect("save config");