Skip to content

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

refactor(config): remove old migration tests

Steven Enamakel6b33c1edb331
diff --git a/crates/openhuman-core/src/config/migrations/normalize_default_model_tier.rs b/crates/openhuman-core/src/config/migrations/normalize_default_model_tier.rs
index 097459f4c0..cb2657d16c 100644
--- a/crates/openhuman-core/src/config/migrations/normalize_default_model_tier.rs
+++ b/crates/openhuman-core/src/config/migrations/normalize_default_model_tier.rs
@@ -5,8 +5,10 @@
use crate::config::Config;
#[derive(Debug, Default, Clone)]
-pub struct MigrationStats;
+pub struct MigrationStats {
+ pub default_model_normalized: bool,
+}
pub fn run(_config: &mut Config) -> anyhow::Result<MigrationStats> {
- Ok(MigrationStats)
+ Ok(MigrationStats::default())
}
diff --git a/crates/openhuman-core/src/config/migrations/normalize_default_model_tier_tests.rs b/crates/openhuman-core/src/config/migrations/normalize_default_model_tier_tests.rs
deleted file mode 100644
index ac08c782f8..0000000000
--- a/crates/openhuman-core/src/config/migrations/normalize_default_model_tier_tests.rs
+++ /dev/null
@@ -1,84 +0,0 @@
-use super::*;
-use crate::config::{Config, MODEL_MANAGED_DEFAULT};
-
-#[test]
-fn rewrites_stale_reasoning_v1_to_the_managed_default() {
- // `reasoning-v1` is a stale former DEFAULT_MODEL — the substantive change.
- let mut config = Config::default();
- config.default_model = Some("reasoning-v1".to_string());
-
- let stats = run(&mut config).expect("migration should succeed");
-
- assert!(stats.default_model_normalized);
- assert_eq!(config.default_model.as_deref(), Some(MODEL_MANAGED_DEFAULT));
-}
-
-#[test]
-fn rewrites_padded_reasoning_v1_to_chat_v1() {
- let mut config = Config::default();
- config.default_model = Some(" reasoning-v1 ".to_string());
-
- let stats = run(&mut config).expect("migration should succeed");
-
- assert!(stats.default_model_normalized);
- assert_eq!(config.default_model.as_deref(), Some(MODEL_MANAGED_DEFAULT));
-}
-
-#[test]
-fn rewrites_deprecated_reasoning_quick_v1_alias_to_chat_v1() {
- // `reasoning-quick-v1` was the chat alias; it lands on the managed default too.
- let mut config = Config::default();
- config.default_model = Some("reasoning-quick-v1".to_string());
-
- let stats = run(&mut config).expect("migration should succeed");
-
- assert!(stats.default_model_normalized);
- assert_eq!(config.default_model.as_deref(), Some(MODEL_MANAGED_DEFAULT));
-}
-
-#[test]
-fn leaves_the_managed_default_unchanged() {
- let mut config = Config::default();
- config.default_model = Some(MODEL_MANAGED_DEFAULT.to_string());
-
- let stats = run(&mut config).expect("migration should succeed");
-
- assert!(!stats.default_model_normalized);
- assert_eq!(config.default_model.as_deref(), Some(MODEL_MANAGED_DEFAULT));
-}
-
-#[test]
-fn leaves_arbitrary_custom_value_unchanged() {
- // `default_model` round-trips custom/BYOK ids; the migration must not
- // clobber them (config-mutation contract; config_*_e2e round-trip tests).
- let mut config = Config::default();
- config.default_model = Some("worker-a-updated".to_string());
-
- let stats = run(&mut config).expect("migration should succeed");
-
- assert!(!stats.default_model_normalized);
- assert_eq!(config.default_model.as_deref(), Some("worker-a-updated"));
-}
-
-#[test]
-fn leaves_other_known_tier_unchanged() {
- // An explicit non-reasoning tier (e.g. agentic) is left for migration 12 → 13.
- let mut config = Config::default();
- config.default_model = Some("agentic-v1".to_string());
-
- let stats = run(&mut config).expect("migration should succeed");
-
- assert!(!stats.default_model_normalized);
- assert_eq!(config.default_model.as_deref(), Some("agentic-v1"));
-}
-
-#[test]
-fn leaves_none_unchanged() {
- let mut config = Config::default();
- config.default_model = None;
-
- let stats = run(&mut config).expect("migration should succeed");
-
- assert!(!stats.default_model_normalized);
- assert_eq!(config.default_model, None);
-}
diff --git a/crates/openhuman-core/src/config/migrations/retire_managed_tier_slugs.rs b/crates/openhuman-core/src/config/migrations/retire_managed_tier_slugs.rs
new file mode 100644
index 0000000000..589b2648ef
--- /dev/null
+++ b/crates/openhuman-core/src/config/migrations/retire_managed_tier_slugs.rs
@@ -0,0 +1,14 @@
+//! Generic schema-version progression for the retired 12 → 13 model
+//! normalization step. Provider-specific normalization runs through the host
+//! registration independently of schema-version gates.
+
+use crate::config::Config;
+
+#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
+pub struct MigrationStats {
+ pub rewritten: usize,
+}
+
+pub fn run(_config: &mut Config) -> anyhow::Result<MigrationStats> {
+ Ok(MigrationStats::default())
+}
diff --git a/crates/openhuman-core/src/config/migrations/retire_managed_tier_slugs_tests.rs b/crates/openhuman-core/src/config/migrations/retire_managed_tier_slugs_tests.rs
deleted file mode 100644
index 3375873c7b..0000000000
--- a/crates/openhuman-core/src/config/migrations/retire_managed_tier_slugs_tests.rs
+++ /dev/null
@@ -1,81 +0,0 @@
-use super::*;
-use crate::config::schema::{DelegateAgentConfig, ModelRouteConfig, TeamModelConfig};
-
-fn delegate(model: &str) -> DelegateAgentConfig {
- DelegateAgentConfig {
- model: model.to_string(),
- system_prompt: None,
- temperature: None,
- max_depth: 3,
- }
-}
-
-#[test]
-fn rewrites_every_tier_slug_to_the_managed_default() {
- let mut config = Config::default();
- config.default_model = Some("chat-v1".to_string());
- config.orchestrator.model = Some("reasoning-v1".to_string());
- config.teams.insert(
- "research".to_string(),
- TeamModelConfig {
- lead_model: Some("agentic-v1".to_string()),
- agent_model: Some("burst-v1".to_string()),
- },
- );
- config
- .agents
- .insert("coder".to_string(), delegate("coding-v1"));
- config.model_routes.push(ModelRouteConfig {
- hint: "summarization".to_string(),
- model: "summarization-v1".to_string(),
- });
-
- let stats = run(&mut config).expect("migration runs");
-
- assert_eq!(stats.rewritten, 6);
- assert_eq!(config.default_model.as_deref(), Some(MODEL_MANAGED_DEFAULT));
- assert_eq!(
- config.orchestrator.model.as_deref(),
- Some(MODEL_MANAGED_DEFAULT)
- );
- assert_eq!(
- config.teams["research"].lead_model.as_deref(),
- Some(MODEL_MANAGED_DEFAULT)
- );
- assert_eq!(
- config.teams["research"].agent_model.as_deref(),
- Some(MODEL_MANAGED_DEFAULT)
- );
- assert_eq!(config.agents["coder"].model, MODEL_MANAGED_DEFAULT);
- assert_eq!(config.model_routes[0].model, MODEL_MANAGED_DEFAULT);
- // The route's hint key is the role and stays.
- assert_eq!(config.model_routes[0].hint, "summarization");
-}
-
-#[test]
-fn leaves_concrete_ids_hints_and_empty_values_alone() {
- let mut config = Config::default();
- config.default_model = Some("openrouter/deepseek/deepseek-v4-pro".to_string());
- config.orchestrator.model = Some("hint:reasoning".to_string());
- config.agents.insert("byok".to_string(), delegate("gpt-4o"));
-
- let stats = run(&mut config).expect("migration runs");
-
- assert_eq!(stats, MigrationStats::default());
- assert_eq!(
- config.default_model.as_deref(),
- Some("openrouter/deepseek/deepseek-v4-pro")
- );
- assert_eq!(config.orchestrator.model.as_deref(), Some("hint:reasoning"));
- assert_eq!(config.agents["byok"].model, "gpt-4o");
-}
-
-#[test]
-fn is_idempotent() {
- let mut config = Config::default();
- config.default_model = Some("reasoning-quick-v1".to_string());
- run(&mut config).expect("first run");
- let stats = run(&mut config).expect("second run");
- assert_eq!(stats.rewritten, 0);
- assert_eq!(config.default_model.as_deref(), Some(MODEL_MANAGED_DEFAULT));
-}