fix(provider): prevent case-insensitive name + key duplicates; migrate and startup dedupe
- Use case-insensitive compare for name + API key in migration - Add runtime uniqueness checks in add/update commands - Startup dedupe prefers current provider; archives others - Keep original display casing; only normalize for comparisons - Validate Codex config.toml as before; archive before overwrite
This commit is contained in:
@@ -66,6 +66,11 @@ pub fn run() {
|
||||
// 确保两个 App 条目存在
|
||||
config_guard.ensure_app(&app_config::AppType::Claude);
|
||||
config_guard.ensure_app(&app_config::AppType::Codex);
|
||||
// 启动去重:名称(忽略大小写)+API Key
|
||||
let removed = migration::dedupe_config(&mut *config_guard);
|
||||
if removed > 0 {
|
||||
log::info!("已去重重复供应商 {} 个", removed);
|
||||
}
|
||||
}
|
||||
|
||||
// 保存配置
|
||||
|
||||
Reference in New Issue
Block a user