Skip to content

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

docs(config): update migration README and cloud provider logic

Steven Enamakela3f31dba2942
diff --git a/crates/openhuman-core/src/config/migrations/README.md b/crates/openhuman-core/src/config/migrations/README.md
index 6681172357..a5f4df1716 100644
--- a/crates/openhuman-core/src/config/migrations/README.md
+++ b/crates/openhuman-core/src/config/migrations/README.md
@@ -18,7 +18,7 @@ Startup data-migration runner gated by `Config::schema_version`. Each migration
| File | Role |
| ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [`crates/openhuman-core/src/config/migrations/mod.rs`](./mod.rs) | Module docstring + the `run_pending` runner, `seed_new_workspace`, and the `CURRENT_SCHEMA_VERSION` constant; declares each migration as a private `mod`. The 10→11 step (`reseed_cloud_providers`) is written inline here rather than as its own module. |
+| [`crates/openhuman-core/src/config/migrations/mod.rs`](./mod.rs) | Module docstring + the `run_pending` runner, `seed_new_workspace`, and the `CURRENT_SCHEMA_VERSION` constant; declares each migration as a private `mod`. The 10→11 step is generic schema progression; hosts supply config normalization separately. |
| [`crates/openhuman-core/src/config/migrations/phase_out_profile_md.rs`](./phase_out_profile_md.rs) | **0→1.** Deletes `{workspace}/PROFILE.md` and strips `### PROFILE.md` blocks from persisted JSONL session transcripts (`session_raw/**`) and `.md` companions (`sessions/**`). Blocking fs I/O. |
| [`crates/openhuman-core/src/config/migrations/unify_ai_provider_settings.rs`](./unify_ai_provider_settings.rs) | **1→2.** Consolidates scattered AI-provider settings into per-workload provider strings; seeds `cloud_providers` (always an `Openhuman` entry) and migrates a non-backend `inference_url` into a `Custom` cloud entry. Pure in-memory. |
| [`crates/openhuman-core/src/config/migrations/retire_chat_v1_model.rs`](./retire_chat_v1_model.rs) | **2→3.** Legacy `chat-v1` migration hook retained for schema-version progression; a no-op (the slug itself is retired by 12→13). Pure in-memory. |
@@ -29,7 +29,7 @@ Startup data-migration runner gated by `Config::schema_version`. Each migration
| [`crates/openhuman-core/src/config/migrations/migrate_legacy_embedding_provider.rs`](./migrate_legacy_embedding_provider.rs) | **6→7.** Rewrites the removed `memory.embedding_provider = "fastembed"` to `ollama` + `bge-m3` when a local Ollama is reachable (`prefer_local`), else to the `managed` cloud default; resets model/dimensions to 1024. Pure in-memory apart from the runner's reachability probe. |
| [`crates/openhuman-core/src/config/migrations/enable_session_shadow_reads.rs`](./enable_session_shadow_reads.rs) | **8→9.** Flips a persisted `agent.session_shadow_reads = false` to `true` once, because `Config::save` writes every field and the new serde default would never apply to upgraded workspaces. Pure in-memory. |
| [`crates/openhuman-core/src/config/migrations/retire_local_whisper_stt.rs`](./retire_local_whisper_stt.rs) | **9→10.** Rewrites `stt_provider` (top-level or legacy `local_ai`) values naming the removed local whisper engine (`"whisper"`, `"local"`) to `"cloud"`, which defers to `voice_server.stt_engine`. Pure in-memory. |
-| _(inline in `mod.rs`)_ | **10→11.** `reseed_cloud_providers`: backfills the managed `openhuman` entry for workspaces that were born past the `== 1` gate with `cloud_providers = []`; reuses `unify_ai_provider_settings::seed_cloud_providers`, which is a no-op on a populated list. On save failure rolls back both the version and the seeded entries. |
+| _(inline in `mod.rs`)_ | **10→11.** Generic schema-version progression. Hosted presets and hosted config repair are registered by TinyHumans' config normalizer, independent of schema version. |
| `crates/openhuman-core/src/config/migrations/mod.rs` | **11→12.** Reserializes the config; the retired background-engine block it once rewrote no longer exists, so the save drops it. |
| [`retire_cloud_provider_type.rs`](./retire_cloud_provider_type.rs) | **13→14.** Normalizes legacy provider discriminators before typed decoding, preserving explicit fields and provider-native models. The versioned runner persists the normalized config once and restores version 13 if saving fails. |
| [`crates/openhuman-core/src/config/migrations/mod_tests.rs`](./mod_tests.rs) | Tests for `run_pending` ordering, gating, rollback-on-save-failure. |
diff --git a/crates/openhuman-core/src/config/ops/primary_cloud.rs b/crates/openhuman-core/src/config/ops/primary_cloud.rs
index ff280a1128..d77c862d4a 100644
--- a/crates/openhuman-core/src/config/ops/primary_cloud.rs
+++ b/crates/openhuman-core/src/config/ops/primary_cloud.rs
@@ -138,8 +138,10 @@ fn cloud_entry_provider_string(entry: &CloudProviderCreds, config: &Config) -> S
.as_deref()
.map(str::trim)
.filter(|model| !model.is_empty())
- })
- .unwrap_or(BYOK_INCOMPLETE_SENTINEL);
+ });
+ let Some(model) = model else {
+ return BYOK_INCOMPLETE_SENTINEL.to_string();
+ };
format!("{}:{model}", entry.slug)
}
diff --git a/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs b/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs
index 2919e33b9a..5e15d83e16 100644
--- a/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs
+++ b/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs
@@ -57,6 +57,25 @@ fn explicit_managed_primary_fails_closed_for_unmatched_custom_intent() {
);
}
+#[test]
+fn custom_primary_without_any_model_fails_closed_without_a_synthetic_route() {
+ let mut config = Config::default();
+ config.cloud_providers = vec![provider(
+ "custom",
+ "my-provider",
+ "https://example.test/v1",
+ AuthStyle::Bearer,
+ )];
+ config.cloud_providers[0].default_model = None;
+ config.primary_cloud = Some("custom".to_string());
+ config.default_model = None;
+
+ assert_eq!(
+ resolve_primary_cloud_provider_string(&config),
+ crate::inference::provider::factory::BYOK_INCOMPLETE_SENTINEL
+ );
+}
+
#[test]
fn absent_primary_without_custom_intent_retains_managed_route() {
let config = Config::default();