Skip to content

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

test(config): update schema migration and corruption recovery tests

Steven Enamakel943aa5c0868f
diff --git a/crates/openhuman-core/src/config/migrations/mod_tests.rs b/crates/openhuman-core/src/config/migrations/mod_tests.rs
index 184dc02b28..b3829869d6 100644
--- a/crates/openhuman-core/src/config/migrations/mod_tests.rs
+++ b/crates/openhuman-core/src/config/migrations/mod_tests.rs
@@ -223,15 +223,14 @@ async fn run_pending_rolls_back_schema_version_when_save_fails() {
}
#[tokio::test]
-async fn run_pending_v7_to_v8_rolls_back_default_model_when_save_fails() {
+async fn run_pending_v7_to_v8_rolls_back_schema_version_when_save_fails() {
let tmp = TempDir::new().unwrap();
fs::create_dir_all(tmp.path().join("workspace")).unwrap();
let mut config = config_in(&tmp);
config.schema_version = 7;
config.default_model = Some("reasoning-v1".to_string());
- // Force save() to fail after normalize_default_model_tier mutates
- // default_model, so the 7->8 rollback path runs.
+ // Force save() to fail so the generic 7->8 schema gate remains retryable.
let blocker = tmp.path().join("blocker");
fs::write(&blocker, "not a directory").unwrap();
config.config_path = blocker.join("nested").join("config.toml");
diff --git a/crates/openhuman-core/src/config/schema/load_corruption_recovery_tests.rs b/crates/openhuman-core/src/config/schema/load_corruption_recovery_tests.rs
index 23e0354f34..a7b9f23e61 100644
--- a/crates/openhuman-core/src/config/schema/load_corruption_recovery_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load_corruption_recovery_tests.rs
@@ -596,8 +596,8 @@ async fn load_or_init_recovers_from_non_utf8_config() {
// Should have loaded defaults (not crashed).
assert!(
- config.default_model.is_some(),
- "must load defaults from non-UTF-8 config"
+ config.default_model.is_none(),
+ "bare core has no provider-owned default model"
);
// The runtime recovery flag must be set so the boot path can surface a