diff --git a/src-tauri/tests/import_export_sync.rs b/src-tauri/tests/import_export_sync.rs index 7018d52aa..380c58730 100644 --- a/src-tauri/tests/import_export_sync.rs +++ b/src-tauri/tests/import_export_sync.rs @@ -210,7 +210,7 @@ experimental_bearer_token = "stored-bearer-key" } #[test] -fn sync_codex_provider_preserves_live_model_provider_id_for_history() { +fn sync_codex_provider_preserves_user_model_provider_id_after_migration() { let _guard = test_mutex().lock().expect("acquire test mutex"); reset_test_fs(); @@ -264,8 +264,8 @@ requires_openai_auth = true assert_eq!( parsed.get("model_provider").and_then(|v| v.as_str()), - Some("custom"), - "legacy ConfigService sync should collapse third-party providers into the stable \"custom\" history bucket" + Some("aihubmix"), + "ConfigService sync should preserve user-editable model_provider after the one-time migration" ); let model_providers = parsed @@ -273,12 +273,12 @@ requires_openai_auth = true .and_then(|v| v.as_table()) .expect("model_providers should exist"); assert!( - model_providers.get("aihubmix").is_none(), - "provider-specific target id should not be written to live config" + model_providers.get("custom").is_none(), + "provider sync should not force user-edited provider ids back to custom" ); assert_eq!( model_providers - .get("custom") + .get("aihubmix") .and_then(|v| v.get("base_url")) .and_then(|v| v.as_str()), Some("https://aihubmix.example/v1") diff --git a/src-tauri/tests/provider_service.rs b/src-tauri/tests/provider_service.rs index f9187c659..8eb1b0345 100644 --- a/src-tauri/tests/provider_service.rs +++ b/src-tauri/tests/provider_service.rs @@ -244,7 +244,7 @@ command = "say" } #[test] -fn provider_service_switch_codex_preserves_live_model_provider_id_for_history() { +fn provider_service_switch_codex_preserves_user_model_provider_id_after_migration() { let _guard = test_mutex().lock().expect("acquire test mutex"); reset_test_fs(); let _home = ensure_test_home(); @@ -313,8 +313,8 @@ requires_openai_auth = true assert_eq!( parsed.get("model_provider").and_then(|v| v.as_str()), - Some("custom"), - "live Codex third-party model_provider should use the CC Switch history bucket" + Some("aihubmix"), + "provider switching should preserve user-editable model_provider after the one-time migration" ); let model_providers = parsed @@ -322,16 +322,16 @@ requires_openai_auth = true .and_then(|v| v.as_table()) .expect("model_providers table exists"); assert!( - model_providers.get("aihubmix").is_none(), - "target provider-specific id should be rewritten in live config" + model_providers.get("custom").is_none(), + "provider switching should not force user-edited provider ids back to custom" ); assert_eq!( model_providers - .get("custom") + .get("aihubmix") .and_then(|v| v.get("base_url")) .and_then(|v| v.as_str()), Some("https://aihubmix.example/v1"), - "stable provider id should point at the newly selected supplier endpoint" + "selected provider id should point at the newly selected supplier endpoint" ); let providers = state @@ -469,16 +469,16 @@ requires_openai_auth = true assert_eq!( parsed_live .get("model_providers") - .and_then(|v| v.get("custom")) + .and_then(|v| v.get("aihubmix")) .and_then(|v| v.get("experimental_bearer_token")) .and_then(|v| v.as_str()), Some("bridge-key"), - "third-party key should be injected into the stable live provider table" + "third-party key should be injected into the selected live provider table" ); assert_eq!( parsed_live .get("model_providers") - .and_then(|v| v.get("custom")) + .and_then(|v| v.get("aihubmix")) .and_then(|v| v.get("requires_openai_auth")) .and_then(|v| v.as_bool()), Some(true)