fix: apply web search config even when no provider configured; bump to 1.3.5

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
stswangzhiping
2026-05-05 21:40:15 +08:00
parent 684e9728dd
commit 7e44744c31
2 changed files with 9 additions and 2 deletions

View File

@@ -362,10 +362,17 @@ function refreshModelsIfChanged(onDone) {
return;
}
// provider 不存在时也要确保 web search 配置
const providers = config.models?.providers || {};
const providerId = Object.keys(providers)[0];
if (!providerId) {
log.info('openclaw-provider', 'refreshModels: 未找到已配置的 provider跳过');
try {
if (ensureWebSearchConfig(configFile, config)) {
writeJsonFile(configFile, config);
log.info('openclaw-provider', 'web search config applied (no provider)');
}
} catch (_) {}
log.info('openclaw-provider', 'refreshModels: 未找到已配置的 provider跳过模型刷新');
if (typeof onDone === 'function') onDone();
return;
}