mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-14 02:42:24 +03:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user