Files
ai-kit/test
CatoandClaude 5c9102e286 feat(web): keyless fallback backends for when every configured one is down (1.25.0) (#111)
* feat(web): keyless fallback backends for when every configured one is down

A self-hosted SearXNG is refused by upstream engines from time to time;
without a paid key the chain then has nothing left, and every app on the
box says it could not look (seen on Substrata, 2026-11-11 to -12).

- gdeltProvider: GDELT DOC 2.0 news search, keyless. Paced to one request
  every five seconds per process (GDELT's own ask); a call that cannot wait
  its turn fails as rate_limited without being sent. Its plain-text refusals
  are typed failures, never empty results.
- wikipediaProvider: one Wikipedia edition's search, keyless, no invented
  date (the API's timestamp is the last edit).
- keylessProviders() and withKeylessFallback(env): one call to opt in.
  defaultProviders is unchanged.
- A provider may declare coverage: "partial"; a partial index answering
  empty never turns a search into "nothing".

Version 1.25.0.

Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

* fix(web): keyless providers, from review

- GDELT query: OR and the parentheses grouping it are kept; a short
  acronym ("AI", "EU") is joined to its neighbour as a phrase instead of
  dropped; lower-case function words go; CJK words are quoted; unbalanced
  quotes are removed.
- GDELT: a non-object body or row is bad_response, not "unreachable"; a
  non-finite or negative interval falls back to 5 s instead of corrupting
  the shared pacing; a call left with under a second is not sent.
- Wikipedia: a site naming an edition searches that edition; edition codes
  such as "simple" and "zh-yue" are honoured and an unknown hint falls back
  to the configured edition; a MediaWiki error in a 200 body is a failure,
  never an empty search.

Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 08:00:02 +01:00
..