refactor(codex): stop force-rewriting user's model_provider field in live config

The one-time history migration already consolidates legacy provider IDs
into a single bucket; there is no need to normalize on every write.
This preserves user-chosen provider identities through the full
write/backup/restore cycle.
This commit is contained in:
Jason
2026-05-28 11:39:54 +08:00
parent 6b0dd3c4e9
commit a2ac21d0a6
3 changed files with 63 additions and 401 deletions
+2 -2
View File
@@ -187,8 +187,8 @@ impl ConfigService {
&provider.settings_config,
restore_provider_token,
)?;
// 必须同时写回 auth 和 config: backfill 会恢复 stored provider id
// 并把 live 的 experimental_bearer_token 移到 restored.auth.OPENAI_API_KEY。
// 必须同时写回 auth 和 config: backfill 会把 live 的
// experimental_bearer_token 移到 restored.auth.OPENAI_API_KEY。
if let Some(restored_obj) = restored.as_object() {
if let Some(auth_value) = restored_obj.get("auth") {
obj.insert("auth".to_string(), auth_value.clone());