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
fix(embedding): report persisted provider in settings signature
Steven Enamakelab9be6455fe0
diff --git a/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs b/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rsindex 6e956e405d..32616851f0 100644--- a/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs+++ b/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs@@ -222,11 +222,19 @@ pub async fn update_settings(let new_model = model.clone().unwrap_or_else(|| config.memory.embedding_model.clone());+ // Resolve the provider string exactly as it will be persisted so the+ // signature reported to callers describes the saved configuration.+ let effective_provider = match &custom_endpoint {+ Some(ep) if new_provider == "custom" || new_provider.starts_with("custom:") => {+ format!("custom:{ep}")+ }+ _ => new_provider.clone(),+ };// `new_dims`/`new_sig` are recomputed after the Custom// verification probe auto-detects the endpoint's real vector length// (issue #4056), so they must be mutable.let mut new_dims = dimensions.unwrap_or(config.memory.embedding_dimensions);- let mut new_sig = format_embedding_signature(&new_provider, &new_model, new_dims);+ let mut new_sig = format_embedding_signature(&effective_provider, &new_model, new_dims);let mut sig_changed = new_sig != old_sig;@@ -245,12 +253,6 @@ pub async fn update_settings(// embedding-capable by construction, and probing `managed`/`cloud`// pre-login would false-fail. Resolve the provider string exactly as it// will be stored so the probe targets the real endpoint.- let effective_provider = match &custom_endpoint {- Some(ep) if new_provider == "custom" || new_provider.starts_with("custom:") => {- format!("custom:{ep}")- }- _ => new_provider.clone(),- };if effective_provider.starts_with("custom:") {// Probe dimension-agnostically for non-`text-embedding-3-*` models so the// user's guessed `dimensions` can't fail an otherwise-valid endpoint; the@@ -361,7 +363,7 @@ pub async fn update_settings("{LOG_PREFIX} update_settings auto-detected custom embedding dimension from probe");new_dims = detected_dims;- new_sig = format_embedding_signature(&new_provider, &new_model, new_dims);+ new_sig = format_embedding_signature(&effective_provider, &new_model, new_dims);sig_changed = new_sig != old_sig;}tracing::debug!(diff --git a/crates/openhuman-core/src/inference/embedding_host/rpc/settings_tests.rs b/crates/openhuman-core/src/inference/embedding_host/rpc/settings_tests.rsindex 19ff6ed343..6b97d35adb 100644--- a/crates/openhuman-core/src/inference/embedding_host/rpc/settings_tests.rs+++ b/crates/openhuman-core/src/inference/embedding_host/rpc/settings_tests.rs@@ -56,16 +56,9 @@ async fn endpoint_only_custom_change_reports_persisted_provider_signature() {let (endpoint, server) = endpoint().await;let (tmp, ctx) = config_context("custom:http://127.0.0.1:1/v1".to_string()).await;- let outcome = update_settings(- &ctx,- None,- None,- None,- Some(endpoint.clone()),- None,- )- .await- .unwrap();+ let outcome = update_settings(&ctx, None, None, None, Some(endpoint.clone()), None)+ .await+ .unwrap();let persisted = reloaded_config(&tmp).await;let expected = format_embedding_signature(&persisted.memory.embedding_provider,@@ -73,7 +66,10 @@ async fn endpoint_only_custom_change_reports_persisted_provider_signature() {persisted.memory.embedding_dimensions,);- assert_eq!(persisted.memory.embedding_provider, format!("custom:{endpoint}"));+ assert_eq!(+ persisted.memory.embedding_provider,+ format!("custom:{endpoint}")+ );assert_eq!(outcome.value["signature_changed"], true);assert_eq!(outcome.value["new_signature"], expected);server.abort();@@ -104,16 +100,9 @@ async fn auto_detected_dimensions_are_used_in_persisted_provider_signature() {let (endpoint, server) = endpoint().await;let (tmp, ctx) = config_context("custom:http://127.0.0.1:1/v1".to_string()).await;- let outcome = update_settings(- &ctx,- None,- None,- Some(8),- Some(endpoint.clone()),- None,- )- .await- .unwrap();+ let outcome = update_settings(&ctx, None, None, Some(8), Some(endpoint.clone()), None)+ .await+ .unwrap();let persisted = reloaded_config(&tmp).await;let expected = format_embedding_signature(&persisted.memory.embedding_provider,@@ -121,7 +110,10 @@ async fn auto_detected_dimensions_are_used_in_persisted_provider_signature() {persisted.memory.embedding_dimensions,);- assert_eq!(persisted.memory.embedding_provider, format!("custom:{endpoint}"));+ assert_eq!(+ persisted.memory.embedding_provider,+ format!("custom:{endpoint}")+ );assert_eq!(persisted.memory.embedding_dimensions, 4);assert_eq!(outcome.value["signature_changed"], true);assert_eq!(outcome.value["new_signature"], expected);