Skip to content

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

fix(config): reconcile orphaned provider settings during migration

Steven Enamakel9bec771fd711
diff --git a/crates/openhuman-core/src/config/migrations/mod.rs b/crates/openhuman-core/src/config/migrations/mod.rs
index 5cff76072b..a6bf7ea7f6 100644
--- a/crates/openhuman-core/src/config/migrations/mod.rs
+++ b/crates/openhuman-core/src/config/migrations/mod.rs
@@ -422,7 +422,7 @@ pub async fn run_pending(config: &mut Config) {
// 7 -> 8: retire the two stale OpenHuman reasoning-tier `default_model`
// defaults to `chat-v1`. `reasoning-v1` (a former DEFAULT_MODEL) and the
// deprecated `reasoning-quick-v1` alias were the persisted default for older
- // builds and drive the implicit managed turns (triage, the subconscious tick,
+ // builds and drive the implicit managed turns (triage,
// escalation base, chat-fallback) onto a stale tier, since app updates never
// refresh `default_model`. Only those two values are rewritten — `default_model`
// round-trips arbitrary custom/BYOK ids (config-mutation contract), so anything
@@ -602,8 +602,9 @@ pub async fn run_pending(config: &mut Config) {
);
}
- // 11 -> 12: reserialize the legacy subconscious engine name as `local`.
- // Deserialization accepts the retired name so old configs still start.
+ // 11 -> 12: reserialize the config. This step once rewrote a retired
+ // background-engine name; that config block no longer exists, so the save
+ // now just drops it. Kept so the schema_version sequence stays contiguous.
if config.schema_version == 11 {
let previous_version = config.schema_version;
config.schema_version = 12;
diff --git a/crates/openhuman-core/src/config/migrations/reconcile_orphaned_providers.rs b/crates/openhuman-core/src/config/migrations/reconcile_orphaned_providers.rs
index 20e56d1893..a1c459b43f 100644
--- a/crates/openhuman-core/src/config/migrations/reconcile_orphaned_providers.rs
+++ b/crates/openhuman-core/src/config/migrations/reconcile_orphaned_providers.rs
@@ -180,7 +180,7 @@ pub fn run(config: &mut Config) -> anyhow::Result<MigrationStats> {
/// can't enforce this at compile time without a field-reflection macro, and a
/// serde-based count guard doesn't work because the `Option<String>` fields
/// default to `None` and are omitted from the serialized table.
-fn workload_fields(config: &mut Config) -> [(&'static str, &mut Option<String>); 10] {
+fn workload_fields(config: &mut Config) -> [(&'static str, &mut Option<String>); 8] {
[
("chat", &mut config.chat_provider),
("reasoning", &mut config.reasoning_provider),
@@ -189,9 +189,7 @@ fn workload_fields(config: &mut Config) -> [(&'static str, &mut Option<String>);
("vision", &mut config.vision_provider),
("memory", &mut config.memory_provider),
("embeddings", &mut config.embeddings_provider),
- ("heartbeat", &mut config.heartbeat_provider),
("learning", &mut config.learning_provider),
- ("subconscious", &mut config.subconscious_provider),
]
}
diff --git a/crates/openhuman-core/src/config/migrations/unify_ai_provider_settings.rs b/crates/openhuman-core/src/config/migrations/unify_ai_provider_settings.rs
index 54e784ea07..924ecd3524 100644
--- a/crates/openhuman-core/src/config/migrations/unify_ai_provider_settings.rs
+++ b/crates/openhuman-core/src/config/migrations/unify_ai_provider_settings.rs
@@ -14,15 +14,18 @@
//! - `memory_tree.llm_backend` (+ `cloud_llm_model`) — memory summariser
//!
//! After this migration there is one grammar — provider strings parsed by
-//! [`crate::inference::provider::factory`] — addressing all eight workloads
+//! [`crate::inference::provider::factory`] — addressing every workload
//! uniformly:
//!
//! ```text
//! reasoning_provider, agentic_provider, coding_provider,
-//! memory_provider, embeddings_provider, heartbeat_provider,
-//! learning_provider, subconscious_provider
+//! memory_provider, embeddings_provider, learning_provider
//! ```
//!
+//! The legacy `local_ai.usage.heartbeat` / `local_ai.usage.subconscious`
+//! booleans are not carried forward: the background loops they routed were
+//! removed, so there is no workload left to derive.
+//!
//! plus `cloud_providers: Vec<CloudProviderCreds>` and `primary_cloud` for
//! the credential side.
//!
@@ -226,15 +229,7 @@ fn derive_workload_providers(config: &mut Config, stats: &mut MigrationStats) {
};
set_field(&mut config.embeddings_provider, embeddings_value, stats);
- // The remaining three use the chat model when local.
- let heartbeat_value = if config.local_ai.usage.heartbeat && runtime_on && !chat_model.is_empty()
- {
- format!("ollama:{}", chat_model)
- } else {
- "cloud".to_string()
- };
- set_field(&mut config.heartbeat_provider, heartbeat_value, stats);
-
+ // Learning uses the chat model when local.
let learning_value =
if config.local_ai.usage.learning_reflection && runtime_on && !chat_model.is_empty() {
format!("ollama:{}", chat_model)
@@ -243,14 +238,6 @@ fn derive_workload_providers(config: &mut Config, stats: &mut MigrationStats) {
};
set_field(&mut config.learning_provider, learning_value, stats);
- let subconscious_value =
- if config.local_ai.usage.subconscious && runtime_on && !chat_model.is_empty() {
- format!("ollama:{}", chat_model)
- } else {
- "cloud".to_string()
- };
- set_field(&mut config.subconscious_provider, subconscious_value, stats);
-
// The three chat workloads (reasoning/agentic/coding) intentionally
// stay None — the factory treats unset as "cloud" which routes to
// primary_cloud. No equivalent of "force this to local" existed in the
diff --git a/crates/openhuman-core/src/config/schema/load/migrate.rs b/crates/openhuman-core/src/config/schema/load/migrate.rs
index 6a044feff5..7d49c2126c 100644
--- a/crates/openhuman-core/src/config/schema/load/migrate.rs
+++ b/crates/openhuman-core/src/config/schema/load/migrate.rs
@@ -165,9 +165,7 @@ pub(crate) fn migrate_cloud_provider_slugs(config: &mut Config) {
rewrite(&mut config.vision_provider);
rewrite(&mut config.memory_provider);
rewrite(&mut config.embeddings_provider);
- rewrite(&mut config.heartbeat_provider);
rewrite(&mut config.learning_provider);
- rewrite(&mut config.subconscious_provider);
fn normalize_provider_endpoint(url: &str) -> String {
url.trim().trim_end_matches('/').to_ascii_lowercase()