feat(searxng): cache /config + reject pageno=0 + annotate truncation#3108
Merged
Conversation
Each search_searxng call previously issued a fresh GET /config purely to validate the category — doubling round-trip latency and load on the upstream SearXNG instance. Cache the categories list per-engine for 5 minutes (RwLock<Option<(Vec<String>, Instant)>>) and fall back to the stale entry if the refresh fetch fails so transient /config outages don't block searches.
SearXNG silently returns an empty result set for pageno=0 instead of treating it as a 1-indexed page boundary error. Reject up-front so LLM tool callers get an actionable message and the daemon doesn't issue a wasted upstream request.
The SearXNG search formatter applies client-side .take(max_results) without telling the model how many results were actually available. Append a "Showing N of M results on page P" line when truncation happens so the LLM can choose to widen max_results or paginate explicitly.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Apr 25, 2026
Merged
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.
Summary
Follow-up review concerns from #3079 (already merged).
/configcategories response to avoid making two HTTP calls per search.pageno=0early with a clear error message instead of letting it propagate as an empty/odd response.Cherry-picks: 4310c20, a2d7e1b, b96156c
Test plan