fix: require doctor migration for legacy web search config

This commit is contained in:
Peter Steinberger
2026-04-01 04:21:55 +09:00
parent 2001603020
commit ce58f55fe0
28 changed files with 356 additions and 1482 deletions

View File

@@ -6,6 +6,7 @@ import {
} from "../agents/model-selection.js";
import { listPotentialConfiguredChannelIds } from "../channels/config-presence.js";
import type { OpenClawConfig } from "../config/config.js";
import { resolvePluginWebSearchConfig } from "../config/legacy-web-search.js";
import {
resolveAgentModelFallbackValues,
resolveAgentModelPrimaryValue,
@@ -183,22 +184,22 @@ function collectConfiguredActivationIds(config: OpenClawConfig): Set<string> {
}
addResolvedActivationId({
raw: config.tools?.web?.search?.gemini?.model,
raw: resolvePluginWebSearchConfig(config, "google")?.model as string | undefined,
activationIds,
aliasIndex,
});
addResolvedActivationId({
raw: config.tools?.web?.search?.grok?.model,
raw: resolvePluginWebSearchConfig(config, "xai")?.model as string | undefined,
activationIds,
aliasIndex,
});
addResolvedActivationId({
raw: config.tools?.web?.search?.kimi?.model,
raw: resolvePluginWebSearchConfig(config, "moonshot")?.model as string | undefined,
activationIds,
aliasIndex,
});
addResolvedActivationId({
raw: config.tools?.web?.search?.perplexity?.model,
raw: resolvePluginWebSearchConfig(config, "perplexity")?.model as string | undefined,
activationIds,
aliasIndex,
});

View File

@@ -526,7 +526,7 @@ describe("resolvePluginWebSearchProviders", () => {
hint: "Brave runtime provider",
envVar: "BRAVE_API_KEY",
signupUrl: "https://example.com/brave",
credentialPath: "tools.web.search.brave.apiKey",
credentialPath: "plugins.entries.brave.config.webSearch.apiKey",
}),
);
setActivePluginRegistry(registry, cacheKey);