fix: model provider config

This commit is contained in:
zhayujie
2026-02-28 18:35:04 +08:00
parent ff37d8a577
commit b4806c4366
2 changed files with 3 additions and 1 deletions

View File

@@ -909,7 +909,8 @@ function initConfigView(data) {
const providerEl = document.getElementById('cfg-provider');
const providerOpts = Object.entries(configProviders).map(([pid, p]) => ({ value: pid, label: p.label }));
const detected = detectProvider(configCurrentModel);
// if use_linkai is enabled, always select linkai as the provider
const detected = data.use_linkai ? 'linkai' : detectProvider(configCurrentModel);
cfgProviderValue = detected || (providerOpts[0] ? providerOpts[0].value : '');
initDropdown(providerEl, providerOpts, cfgProviderValue, onProviderChange);

View File

@@ -522,6 +522,7 @@ class ConfigHandler:
"use_agent": use_agent,
"title": title,
"model": local_config.get("model", ""),
"use_linkai": bool(local_config.get("use_linkai", False)),
"channel_type": local_config.get("channel_type", ""),
"agent_max_context_tokens": local_config.get("agent_max_context_tokens", 50000),
"agent_max_context_turns": local_config.get("agent_max_context_turns", 20),