Repository navigation
Description
Problem or Motivation
The pinned SearXNG in namespace devops is throttled by several engines when it runs from the cluster. A web search through it often returns few hits or none, and the chain then falls through to DuckDuckGo (the ddgs library) and Firecrawl (src/devops_cli/ai/web_search.py).
Facts from the cluster on 2026-11-08 (read only, kubectl -n devops logs deploy/searxng --since=3h):
duckduckgo: 6SearxEngineCaptchaException("CAPTCHA (us-en)",suspended_time=0). Withsuspended_time=0SearXNG does not suspend the engine, so the next query hits the CAPTCHA again.superuser,stackoverflow,askubuntuandarxiv: "Too many request (suspended_time=180)". Each of these engines was suspended for 180 s.stackoverflow,superuserandaskubuntu: HTTP 400 fromapi.stackexchange.com/2.3/search/advanced(no key in the request). The reply body is not in the log, so the cause of the 400 is not proven. The Stack Exchange documentation names HTTP 400 for error 502,throttle_violation. This must be checked.devops k8s searxng-check(PR feat(k8s): add the searxng-check command #4136) got 1 hit for the plaingeneralcategory while DuckDuckGo was CAPTCHA-blocked, 50 hits foritand 10 forscience.
Part of this load is self-inflicted: the live check and manual queries ran in the same window. A Service that runs refine and alternatives sends fewer queries. So the facts do not yet show if the cause is the query rate or a flag on the cluster egress address.
The engine set is in k8s/devops/searxng/configmap.yaml (keep_only: duckduckgo, wikipedia, github, stackoverflow, askubuntu, superuser, arxiv, mdn, docker hub). The decision not to add a retry loop (#4094, merged) stands. Related: #3929 and #4136 (searxng-check), #3877 (research ADR).
Proposed Solution
- Measure first, change nothing before. Read
devops_cli_web_searches_totalbybackendandresultfor a few days of the real Service. Write the query rate for each backend and the share of eachresultin this issue. Split the rate into Service traffic and check or manual traffic. - Tell the two causes apart. A throttle that follows the rate falls when the rate falls. A flag on the egress address does not. Compare the result share at a low-rate hour with the share at a high-rate hour. Send the same query once from a different egress address if a person can do it.
- Fix at the source. The choice depends on step 2. The options, from least to most work:
- Remove an engine that needs a key-free scrape from one address and gives little (for example
duckduckgoas an engine, because the chain already hasddgs, or the three Stack Exchange engines). - Set a per-engine suspension in the SearXNG settings so that a CAPTCHA suspends the engine and does not repeat at once.
- Use a Stack Exchange API key. It is a Secret, so a person must create it.
- Add a rate limit in the provider (
web_search.py), at the Service side. - Accept the fallback and document it in the README.
- Remove an engine that needs a key-free scrape from one address and gives little (for example
- Add the check named under Acceptance.
Feasibility
Step 1 is feasible now: the metric exists (src/devops_cli/telemetry/instruments.py, devops_cli_web_searches_total). The log facts above were read from the live pod. The cause of the HTTP 400 and the split between rate and address are not yet known. The change to the cluster waits for the measure.
Acceptance Criteria
- The issue holds the measure: the query rate for each backend and the
resultshare, over at least 3 days. - A command or test that fails today, for example a test over the
searxng-settingsConfigMap that checks the chosen engine set (no engine inkeep_onlythat the measure shows as blocked by the cluster egress address), and adevops k8s searxng-checkrun that gets hits for thegeneralcategory. - The cause is named: query rate or the cluster egress address.
- No retry loop is added (fix(k8s): SearXNG engines time out or return no hit #4094).
Proposed design
Problem statement
Web search through the pinned SearXNG in namespace devops returns few hits or none. Several key-free engines are throttled or refused from the cluster egress address, and the chain falls through to ddgs and Firecrawl. The change removes the three Stack Exchange engines, which return HTTP 400 on every request without an API key, so the it results come only from engines that answer.
Acceptance criteria
Requirement: The settings keep no Stack Exchange engine
The searxng-settings ConfigMap SHALL keep none of stackoverflow, askubuntu and superuser in engines.keep_only.
Scenario: The rendered engine set
- WHEN the invariant test renders
k8s/devops/searxng/configmap.yamland readsengines.keep_only - THEN the list holds
duckduckgo,wikipedia,github,arxiv,mdnanddocker hub, and holds none of the three Stack Exchange names
Requirement: The README lists the kept engines
k8s/README.md SHALL list the six kept engines and SHALL NOT list stackoverflow, askubuntu or superuser.
Scenario: The README agrees with the ConfigMap
- WHEN the invariant test reads the engine paragraph of
k8s/README.md - THEN each of the six kept names is present and none of the three removed names is present
Requirement: The ConfigMap comment records the cause
The comment of k8s/devops/searxng/configmap.yaml SHALL name the HTTP 400 of api.stackexchange.com and SHALL say that the three engines need an API key.
Scenario: The comment names the 400
- WHEN the invariant test reads the comment block of the ConfigMap
- THEN the comment holds
HTTP 400,api.stackexchange.comandAPI key
Requirement: The provider chain keeps one attempt for each provider
web_search SHALL ask each provider at most once for one search.
Scenario: A failed provider passes the search on
- WHEN the first provider raises an HTTP error and the second provider returns one hit
- THEN the first provider is called once, the second provider is called once, and the search returns the hit
Existing Tool Considered
No alternatives check has run. SearXNG, pinned in k8s/devops/searxng/deployment.yaml, and the ddgs library already cover the need, and this change adds no code that the project keeps: it edits one ConfigMap, one README section and one invariant test. What they lack: a key-free engine that answers from the shared cluster egress address. stackoverflow, askubuntu and superuser need a Stack Exchange API key, and a person creates that Secret.
Key questions
- Which engines leave
keep_onlynow, before the measure?: Removestackoverflow,askubuntuandsuperuser. Each returned HTTP 400 fromapi.stackexchange.comon every request in the 3-hour log, with no key in the request. A key is a Secret that a person creates, so the keyed engines wait. (best practice) [sources: k8s/devops/searxng/configmap.yaml:30, k8s/README.md:843, openspec/specs/searxng-service/spec.md]- Chosen: Remove the three Stack Exchange engines. They return no hit without an API key. The living spec requires that the settings keep no engine that never answers.
- Rejected: Keep them and add an API key. The key is a Secret that a person creates, so the change waits on a person. The deferred issue holds it.
- Rejected: Keep them unchanged. They add one request on each 180 s suspension and return no hit.
- Does
duckduckgostay inkeep_only?: Yes. It is the onlygeneralengine that returns hits. The engine raises its CAPTCHA with no suspension, so the next query repeats it. The deferred measure fixes that defect. (best practice) [sources: k8s/README.md:843, k8s/devops/searxng/configmap.yaml:31, src/devops_cli/ai/web_search.py]- Chosen: Keep
duckduckgo. It is the onlygeneralengine with hits. Theddgsprovider sends the same request from the same address, so a removal moves the load and does not cut it. - Rejected: Remove
duckduckgo. Thegeneralcategory would return no hit from SearXNG, and theddgsprovider would send the same request. - Rejected: Set
search.suspended_timesfor the CAPTCHA. The README records that the engine raises the CAPTCHA with no suspension, so the settings value does not apply. The deferred issue checks this against the pinned image.
- Chosen: Keep
- How does the change prove the new engine set offline?: Extend
tests/invariants/test_k8s_searxng.py. The test renders the ConfigMap and reads the README, so it needs no cluster. (best practice) [sources: tests/invariants/test_k8s_searxng.py, tests/commands/k8s/test_k8s_searxng_check.py]- Chosen: Extend the invariant test. It reads the ConfigMap and the README, so it runs offline and fails before the change.
- Rejected: Rely on
devops k8s searxng-check. It needs the live pod, so it is no offline check.
- Does the change add a retry loop to the provider chain?: No. A provider that fails passes the search on at once, as fix(k8s): SearXNG engines time out or return no hit #4094 decided. A test holds this. (best practice) [sources: src/devops_cli/ai/web_search.py, tests/ai/test_web_search.py]
- Chosen: Keep one attempt for each provider. fix(k8s): SearXNG engines time out or return no hit #4094 decided it, and the docstring of the provider states no retry and no wait.
- Rejected: Add a retry with a backoff. It contradicts fix(k8s): SearXNG engines time out or return no hit #4094 and hides the throttle.
- Which engines does
keep_onlyhold today?: Nine:duckduckgo,wikipedia,github,stackoverflow,askubuntu,superuser,arxiv,mdnanddocker hub. [sources: k8s/devops/searxng/configmap.yaml:30, k8s/README.md:843] - Which labels does
devops_cli_web_searches_totalhold?:backendandresult. The backend is the provider name ornone, and the result isok,empty, an HTTP status,degraded,error,refusedorexhausted. [sources: src/devops_cli/telemetry/instruments.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-18: in-use.
The repository already uses this tool.
Tool: searxng/searxng (https://github.com/searxng/searxng), AGPL-3.0, last activity 2026-11-18, maintained.
Reason: Searches found SearXNG, the metasearch engine the cluster already runs, as the maintained open tool that holds the whole fix: the engine allow-list, per-engine suspension and engine keys. The issue needs a settings change, not a new tool.
Covers:
- Metasearch over many key-free engines from one endpoint
- Engine allow-list through
keep_onlyin the settings - Per-engine suspension and engine API-key settings
- No key and no user store for the search path
Lacks:
- No per-backend query-rate or result-share metric
- CAPTCHA can repeat when an engine sets no suspension
- No way to tell query rate from an egress-address flag
- Stack Exchange engines need a Secret that a person creates
Activity
dan-petty commentedon Nov 8, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(k8s)scope of the title gives the scope.devops-cli-service commentedon Nov 9, 2026
Status set to Ready at 91ee652 (see proposed design in issue body).
Moved to new items: #4201.
devops-cli-service commentedon Nov 10, 2026
Alternatives check: in-use
Reason: The searches found SearXNG itself — an open, actively maintained metasearch engine that the project already pins in the cluster — which covers the need: it aggregates many key-free engines and lets its settings choose the engine set and the per-engine suspension. No maintained drop-in replacement turned up that would make the upstream engines answer from a shared egress address; the remaining gaps are the keyed Stack Exchange engines and the per-provider rate limit, which sit outside the engine.
The item already names this tool.
Tool: searxng/searxng (https://github.com/searxng/searxng)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-10. A person decides what this means for the item. The check changes no label and closes no issue.
8 remaining items
docs(openspec): plan #4141 Drop the Stack Exchange engines from SearXNG
docs(openspec): plan #4141 Remove the three Stack Exchange engines
docs(openspec): fix the #4141 plan: drop a stub task and an unedited …
docs(openspec): state the duckduckgo fact of the #4141 plan alone
docs(openspec): plan #4141 Remove the three Stack Exchange engines (#…
devops-cli-service commentedon Nov 25, 2026
Released in v0.215.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.215.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 04:21 UTC