Skip to content

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

fix(config): handle legacy embedding provider migration for renamed fields

Steven Enamakelda913e254f8a
diff --git a/crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider.rs b/crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider.rs
index 19f3b6425a..742ee68d4f 100644
--- a/crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider.rs
+++ b/crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider.rs
@@ -33,8 +33,7 @@
//! - `prefer_local = false` → `"managed"` cloud backend + cloud defaults (the
//! fresh-install default), used when no local Ollama is reachable.
//!
-//! Both targets are 1024-dim — matching the memory tree's fixed on-disk
-//! `EMBEDDING_DIM=1024`. This step only ever rewrites `fastembed`, so cloud-only
+//! Both targets are 1024-dim. This step only ever rewrites `fastembed`, so cloud-only
//! users (never on `fastembed`) are untouched.
//!
//! Stored vectors written at the old signature are left in place: they are
@@ -120,7 +119,7 @@ pub fn run(config: &mut Config, prefer_local: bool) -> anyhow::Result<MigrationS
return Ok(stats);
}
- // Both targets are 1024-dim (the memory tree's fixed on-disk EMBEDDING_DIM);
+ // Both targets are 1024-dim ;
// the legacy 384-dim BGE values are incompatible with either, so stored
// vectors re-embed lazily via backfill regardless of which target we pick.
let (provider, model, dimensions) = if prefer_local {
diff --git a/crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider_tests.rs b/crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider_tests.rs
index 605bf475fd..f87b0e9103 100644
--- a/crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider_tests.rs
+++ b/crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider_tests.rs
@@ -49,7 +49,7 @@ fn rewrites_fastembed_to_ollama_when_local_preferred() {
config.memory.embedding_dimensions,
DEFAULT_OLLAMA_DIMENSIONS
);
- // Both targets land on the memory tree's fixed 1024-dim format.
+ // Both targets are 1024-dim.
assert_eq!(
DEFAULT_OLLAMA_DIMENSIONS,
DEFAULT_CLOUD_EMBEDDING_DIMENSIONS
diff --git a/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs b/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs
index 2221802015..7b9b36799d 100644
--- a/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs
+++ b/crates/openhuman-core/src/inference/embedding_host/rpc/settings.rs
@@ -157,9 +157,8 @@ pub async fn get_settings(config: &Config) -> Result<Outcome<serde_json::Value>,
// The embedder ingestion will *actually* use. `provider` above is the
// per-section setting the picker writes; it is NOT authoritative for how
- // embeddings are funded, because the Local AI "Memory embeddings" toggle and
- // the `memory_tree.embedding_endpoint` override both route to local Ollama
- // without rewriting it. Additive field — callers that only need the picker
+ // embeddings are funded, because the Local AI "Memory embeddings" toggle
+ // routes to local Ollama without rewriting it. Additive field — callers that only need the picker
// value are unaffected; callers asking "does this bill the managed budget?"
// must read this one (#5402).
let effective_provider = effective_embedder_slug_from_config(config);
diff --git a/crates/openhuman-core/src/inference/provider/ops/http_error/auth_failure.rs b/crates/openhuman-core/src/inference/provider/ops/http_error/auth_failure.rs
index f47ebaaa4e..b6549584e2 100644
--- a/crates/openhuman-core/src/inference/provider/ops/http_error/auth_failure.rs
+++ b/crates/openhuman-core/src/inference/provider/ops/http_error/auth_failure.rs
@@ -19,7 +19,7 @@ pub fn is_backend_auth_failure(provider: &str, status: reqwest::StatusCode) -> b
///
/// This is deterministic **user-config** state (the user pasted a bad or empty
/// key into a custom OpenAI-compatible provider), not a product bug. Sentry has
-/// no remediation path, yet retry loops (memory-tree extraction, memory jobs,
+/// no remediation path, yet retry loops (background jobs,
/// cron) hammer the known-bad credential and flood Sentry with thousands of
/// identical events from a single user — TAURI-RUST-DHM (5,636 events from a
/// `kiro` custom provider with no key), the same class as the Cohere
diff --git a/crates/openhuman-core/src/inference/provider/ops_tests_models_parsing_tests.rs b/crates/openhuman-core/src/inference/provider/ops_tests_models_parsing_tests.rs
index 61f159a015..d069501845 100644
--- a/crates/openhuman-core/src/inference/provider/ops_tests_models_parsing_tests.rs
+++ b/crates/openhuman-core/src/inference/provider/ops_tests_models_parsing_tests.rs
@@ -132,7 +132,7 @@ fn is_backend_auth_failure_only_matches_openhuman_backend_401_403() {
/// `is_byo_provider_auth_failure_http` demotes a non-backend provider's
/// 401/403 from Sentry when the body looks like a missing/invalid BYO API
/// key (TAURI-RUST-DHM: a `kiro` custom provider with no key flooded Sentry
-/// with 5,636 identical events from one user via the memory-tree retry loop).
+/// with 5,636 identical events from one user via a background retry loop).
/// The gate is provider-scoped (backend keeps its SessionExpired branch) and
/// body-shape-anchored (a non-auth 401, e.g. quota / geo-block, still reports).
#[test]
diff --git a/crates/openhuman-core/src/inference/provider/types.rs b/crates/openhuman-core/src/inference/provider/types.rs
index e285bed52b..93f16a7e0a 100644
--- a/crates/openhuman-core/src/inference/provider/types.rs
+++ b/crates/openhuman-core/src/inference/provider/types.rs
@@ -131,8 +131,7 @@ pub enum ProviderDelta {
/// condition. Capping every agent turn at a realistic ceiling prices the
/// pre-flight against a budget the user can actually afford; a residual `402`
/// is then the genuine flat-balance case the insufficient-credits demote arm
-/// is meant for (TAURI-RUST-C62; mirrors [`EXTRACTION_MAX_OUTPUT_TOKENS`] in
-/// `memory_tree::score::extract::llm`).
+/// is meant for (TAURI-RUST-C62).
///
/// `16384` sits comfortably above any realistic single agent turn — `max_tokens`
/// is an upper bound, not a forced length, so the model still stops at its