chore(search): drop unreachable credential sweep after #11642 (#11687)

Merged via /merge-batch (2026-08-26, v3.8.51). Boarded no worktree combinado; validação única: typecheck/complexity/cognitive-complexity/file-size/changelog verdes, lint nos mesmos 228 achados pré-existentes confirmados contra o tip puro, testes focados passando. Obrigado pela contribuição.
This commit is contained in:
Bob.Hou
2026-08-26 16:40:32 -04:00
committed by GitHub
parent bda83c1d39
commit e69f2109aa

View File

@@ -201,27 +201,7 @@ export async function executeWebSearch(
}
if (!credentials) {
// 1. Try credentialed providers first, sorted by cost. Fallback-only
// providers are reached only if no configured provider is available.
const sortedIds = Object.values(SEARCH_PROVIDERS)
.filter((provider) => !provider.fallbackOnly && supportsSearchType(provider, searchType))
.sort((a, b) => a.costPerQuery - b.costPerQuery)
.map((provider) => provider.id);
for (const providerId of sortedIds) {
if (providerId === providerConfig.id) continue;
const altConfig = getSearchProvider(providerId);
const altCreds = await resolveSearchCredentials(providerId);
if (altConfig && altCreds) {
providerConfig = altConfig;
credentials = altCreds;
break;
}
}
}
if (!credentials) {
// 2. Last resort: fallback-only providers so out-of-the-box search
// Last resort: fallback-only providers so out-of-the-box search
// still works when no credentialed provider is configured.
const fallbackProviders = Object.values(SEARCH_PROVIDERS)
.filter((provider) => provider.fallbackOnly && supportsSearchType(provider, searchType))