Repository navigation
Description
Problem
The web search of the roadmap jobs has one backend: the hosted Firecrawl API (firecrawl_search in src/devops_cli/ai/common_tools.py). When Firecrawl refuses a search, the search returns nothing. On 2026-11-06 the Service logged 7 searches in 24 hours that failed with Firecrawl answered with HTTP 402 (the credit of the account is used up). The alternatives check and the refine investigation then run without web results, and the check cannot tell a missing tool from a failed search.
Expected
When a Firecrawl search fails (HTTP 402, 429, 5xx, a timeout or an empty reply that is an error), the same call searches with DuckDuckGo and returns results in the same form. A search that Firecrawl answered is not repeated. The metric devops_cli_firecrawl_searches_total keeps its meaning, and a second metric or label tells which backend answered. A fallback is logged once per search, with the reason.
Acceptance criteria
- A test: Firecrawl answers HTTP 402, the fallback runs, and the caller gets DuckDuckGo results in the form of Firecrawl results.
- A test: Firecrawl answers with results, and the fallback does not run.
- A test: both backends fail, and the call returns an error result the way a Firecrawl failure does today (no exception that stops the job).
- The metric tells the backend that answered.
docs/TELEMETRY.mdlists it. - The fallback goes through the HTTP entry point of the project and its egress rules (SECURITY.md); a query never holds private code or a secret (SECURITY.md rule 13).
k8s/README.mdanddocs/roadmap/alternatives.mdname the fallback.
Existing tool considered
pydantic-ai ships a DuckDuckGo search tool that uses the maintained ddgs package. Use that, or ddgs directly if the tool does not fit the result form. No home-grown scraper of the DuckDuckGo page. SearXNG is a second option for a later item.
Related
Related: #2475 (Firecrawl metric), #2398, #2650, #3243. The investigation of a wider research agent is a separate item.
Activity
dan-petty commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(ai)scope of the title gives the scope.Firecrawl failures degrade the alternatives check and refine investigation, but the system still runs; it is a reliability gap, not an outage.Users get web results when Firecrawl is down, which keeps the roadmap pipeline functional.Requires DuckDuckGo integration, metrics, logging, three tests, and documentation updates across multiple files.Both concern Firecrawl web search in devops-cli, but #2432 audits which features should adopt Firecrawl while the candidate adds a DuckDuckGo fallback for when Firecrawl fails.dan-petty commentedon Nov 7, 2026
Answer from project standards, under the owner's instruction of 2026-11-05.
Question: can the fallback use the pydantic-ai DuckDuckGo tool or
ddgs, and can it go through the project HTTP entry point?Answer: use
ddgs9.16.1 (MIT, published 2026-10-23, maintained), but not through its client. The pydantic-ai tool only wrapsDDGS().text.DDGSsends its requests withprimp, which takes no transport, so a request would skip the egress check ofdevops_cli.http.client(SECURITY.md rule 2). TheDuckduckgoengine ofddgssplits the work intobuild_payload, a request andextract_results. The change calls those parts and sends the request withhttp_client(level=EgressLevel.PUBLIC). It writes no scraper.primp2.0.1 andlxml6.1.3 havecp314manylinux wheels, so thepython:3.14-slim-trixiestage installs them withuv sync --locked.Egress:
devops-default-perimeteradmits public TCP 443, sohtml.duckduckgo.comneeds no new rule.Rule and code that give the answer: AGENTS.md rules 2 and 3, SECURITY.md rule 2,
ddgs/engines/duckduckgo.pyinddgs9.16.1.Metric: a new counter
devops_cli_web_search_fallbacks_total(backend,result) tells the backend.devops_cli_firecrawl_searches_totalkeeps its meaning, because the alerts read it.A person must decide one point, not blocking this item: a search with no Firecrawl key. The jobs turn the web search off with no key. A fallback-only mode would need a decision on that rule. This item does not change it.
dan-petty commentedon Nov 7, 2026
Plan note of 2026-11-07, from the owner's request to add a local SearXNG and the Brave Search API.
PR #3900 stays as it is. Merge it when its checks pass. It adds the function web_search (Firecrawl, then DuckDuckGo), the function duckduckgo_search, and the counter devops_cli_web_search_fallbacks_total.
A later item (feat(ai): search the web through a chain of providers) will replace web_search with one search over a list of providers: searxng, brave, duckduckgo, firecrawl. It will move duckduckgo_search into the duckduckgo provider, with its tests and the ddgs dependency. It will replace the two counters by devops_cli_web_searches_total{backend,result}. That item starts after this pull request merges. No code stacks on branch feat/3876-ddg-search-fallback.
The point for a person in the comment of 2026-11-07 (a search with no Firecrawl key) moves to that item: the chain turns web search on for a public repository when any provider is configured, and DuckDuckGo needs no key.
dan-petty commentedon Nov 7, 2026
Plan note of 2026-11-07 (owner decision): the Brave Search API is not used. Its terms (1 Sep 2026) forbid storing results and it has no free tier. This replaces the part of the earlier plan note that mentions Brave:
searxng,duckduckgo,firecrawl. There is no keyed provider for now, and noBRAVE_SEARCH_API_KEY.keepparameter and theallows_keepflag are dropped from the design of the chain (they existed only because of the Brave terms). Every provider's hits may be kept.devops-cli-service commentedon Nov 7, 2026
Released in v0.77.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.77.0
devops-cli-service commentedon Nov 7, 2026
Live since 2026-11-07 05:06 UTC