fix(desktop): refresh conductor model chip on profile-only reloads

loadModelProfiles only updated the main model chip, never
state.conductorModelName. The mykey-import path (and add/remove-mixin,
reorder, add/delete model) call loadModelProfiles without
loadBridgeConfig, so after importing keys the conductor chip stayed on
its stale label (e.g. the empty "渠道组(自动故障转移)") until a manual
model switch recomputed it. Recompute conductorModelName from the fresh
profiles when a conductor model is bound.
This commit is contained in:
yanghang committed 2026-06-26 14:37:15 +08:00
1 parent 1c3c14a5f8
commit 352525f87d
1 file changed
+6
+6
View File
@@ -3895,6 +3895,12 @@ async function loadModelProfiles() {
state.llmNo = active.id ?? 0;
state.modelName = modelDisplayName(active);
}
// conductor chip 的显示名只在 loadBridgeConfig/selectConductorModel 更新;导入密钥等
// 仅刷新 profiles 的路径若不在此一并重算,会让 conductor chip 停在旧文案(如空渠道组)。
if (state.conductorLlmNo != null) {
const cp = state.modelProfiles.find(p => (p.id ?? 0) === state.conductorLlmNo);
if (cp) state.conductorModelName = modelDisplayName(cp);
}
updateModelChip();
renderSettingsModels();
} catch (_) {}