Repository navigation
feat(search): free DuckDuckGo web search as last-resort provider (FCC port, Fase 6) - #4136
Merged
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
# Conflicts: # config/quality/file-size-baseline.json
The GET /v1/search registry-listing test still asserted 12 providers and the pre-duckduckgo id list. duckduckgo-free is registered last in SEARCH_PROVIDERS, so getAllSearchProviders() returns it at the tail — update the count and append the id to the deepEqual.
Merged
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
… port, Fase 6) (cheaper-inference#4136) Free DuckDuckGo web search as last-resort provider (FCC port, Fase 6). Integrado em release/v3.8.29: conflito de file-size-baseline.json resolvido (união dos rebaselines duckduckgo_free + stream_recovery) e teste de contagem de providers atualizado 12->13.
diegosouzapw
added a commit
that referenced
this pull request
Oct 13, 2026
…nslateState stream.ts is frozen in the file-size baseline. The initial translate state, including the model-family-scoped signature namespace (#4136), is now built by initTranslateStreamState, with a direct unit test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumo
Adiciona um provider de web search grátis, sem API key —
duckduckgo-free(scraping dolite.duckduckgo.com) — como último recurso (fallback) do/v1/search. É a Fase 6 do porte free-claude-code→OmniRoute (docs/superpowers/plans/2026-06-17-fcc-portable-features.md): web search funciona out-of-the-box (grátis) quando nenhum provider com chave está configurado.Comportamento de seleção (decisão do operador: "último recurso"):
duckduckgo-freeéfallbackOnly→ nunca auto-selecionado sobre um provider pago configurado.searxng(self-hosted) também.provider: "duckduckgo-free").authType: "none").O que entra
open-sse/services/freeWebSearch.ts(novo):parseDuckDuckGoLite(html)(parser do HTML lite, aterrado no markup REAL capturado) +freeWebSearch()(fetch viasafeOutboundFetchcom guardpublic-only).open-sse/config/searchRegistry.ts: flagfallbackOnly+ entradaduckduckgo-free;selectProvider()excluifallbackOnlyda auto-seleção.src/app/api/v1/search/route.ts: loops de auto-seleção e de alternate excluemfallbackOnly; novo passo last-resort que só usa umfallbackOnlyquando nenhum provider com credencial foi achado.open-sse/handlers/search.ts:tryDuckDuckGoFreeProvider()(caminho HTML dedicado, espelha o special-casetryZaiMCPProvider— o lite retorna HTML, não o JSON que o fluxo genérico espera).src/shared/validation/schemas/apiV1.ts:duckduckgo-freeno enum de providers (seleção explícita).Segurança (endereçada na revisão independente)
[\s\S]{0,N}?hard-bounded + HTML truncado a 256KB (CLAUDE.md PII §1). Teste de regressão prova retorno <1s em input adversarial.resolveResultUrlsó retornahttp(s)://— descartajavascript:/data:/file:/IP-interno antes de chegar ao LLM/cliente.safeOutboundFetchcomguard: "public-only"+allowRedirect: false(o guard só valida a URL inicial; sem seguir 3xx para hosts internos).Validação (Hard Rule #18)
tests/unit/free-web-search.test.ts(9: parser fiel ao HTML real,<b>/entidades, decodeuddg, protocol-relative, scheme-filter, ReDoS-bound),tests/unit/search-registry.test.ts(+fallbackOnly excluído do auto-select / explícito ainda funciona),tests/unit/search-handler-duckduckgo.test.ts(path explícito + failover searxng→DDG via fetch mockado retornando HTML real). 54/54.typecheck:coreexit 0, ESLint 0 erros / 0 warnings novos (paridade deanycom origin),check:file-size(rebaseline search.ts 1442→1546 justificado),check:cycles,check:any-budget:t11,check:docs-sync— verdes.Nota
web_search_20250305) Claude→Claude continua em passthrough (não tocada). O DDG-free flui naturalmente pelo fallback toolomniroute_web_search→/v1/searchquando esse caminho é usado.Test Plan
node --import tsx/esm --test tests/unit/free-web-search.test.ts tests/unit/search-registry.test.ts tests/unit/search-handler-duckduckgo.test.ts→ 54/54npm run typecheck:core && npm run check:file-size && npm run check:any-budget:t11→ verdes🤖 Generated with Claude Code