Skip to content

feat(web-search): add firecrawl and duckduckgo as fallbacks - #15

Merged
AaronCQL merged 2 commits into
mainfrom
feat/web-search-fallback-providers
Aug 14, 2026
Merged

feat(web-search): add firecrawl and duckduckgo as fallbacks#15
AaronCQL merged 2 commits into
mainfrom
feat/web-search-fallback-providers

Conversation

@AaronCQL

Copy link
Copy Markdown
Owner

No description provided.

Exa's keyless MCP tier allows only 50 tool calls per day per IP, so a
single research-heavy session can exhaust web search for the rest of the
day. Add a provider chain that falls back to Firecrawl's keyless search
endpoint and, last, DuckDuckGo Lite read through Jina's keyless reader.

An empty result set ends the chain: a query with genuinely no hits must
not burn every provider's quota. A quota rejection additionally opens a
disk-backed circuit breaker so later searches skip the dead provider
outright, which matters most for the long-lived Telegram daemon. Trips
expire at the next UTC midnight but allow a probe every 30 minutes, so a
false positive from an IP-shared burst does not sideline a provider for
the rest of the day.

Also throttle the Exa client to 2 requests per second, matching the
keyless endpoint's actual limit, so a 429 reliably means the daily cap
rather than a self-inflicted rate limit.

The serving provider is surfaced in the tool details, the TUI call title
and the Telegram tool entry, since silent degradation is otherwise
invisible.
Firecrawl meters keyless search over a rolling 24h window rather than a
calendar day, and reports the remaining time as `retry_after_seconds` in
the 429 body instead of a Retry-After header. The breaker was therefore
falling back to its next-UTC-midnight default and reopening hours early,
wasting a probe cycle per search.

Observed live: a keyless budget exhausted after roughly 40 searches
reports ~22.9h remaining, against a default that would have expired in
~19h.
@AaronCQL
AaronCQL merged commit 667438f into main Aug 14, 2026
1 check passed
@AaronCQL
AaronCQL deleted the feat/web-search-fallback-providers branch August 14, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant