From e69f2109aaef4d40a94359e02ba450ccbb821f2b Mon Sep 17 00:00:00 2001 From: "Bob.Hou" Date: Wed, 26 Aug 2026 16:40:32 -0400 Subject: [PATCH] chore(search): drop unreachable credential sweep after #11642 (#11687) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/lib/search/executeWebSearch.ts | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/lib/search/executeWebSearch.ts b/src/lib/search/executeWebSearch.ts index 5fd2abbf75..6c3b531041 100644 --- a/src/lib/search/executeWebSearch.ts +++ b/src/lib/search/executeWebSearch.ts @@ -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))