Skip to content

feat(searxng): cache /config + reject pageno=0 + annotate truncation#3108

Merged
houko merged 4 commits into
mainfrom
followup/searxng-review
Apr 25, 2026
Merged

feat(searxng): cache /config + reject pageno=0 + annotate truncation#3108
houko merged 4 commits into
mainfrom
followup/searxng-review

Conversation

@houko

@houko houko commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up review concerns from #3079 (already merged).

  • Cache the SearXNG /config categories response to avoid making two HTTP calls per search.
  • Reject pageno=0 early with a clear error message instead of letting it propagate as an empty/odd response.
  • Annotate the truncated result count in the LLM-facing output so the model can see when results were trimmed.

Cherry-picks: 4310c20, a2d7e1b, b96156c

Test plan

  • Existing SearXNG provider tests still pass
  • Manual verification against a self-hosted SearXNG instance

houko added 3 commits April 25, 2026 18:51
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.
@github-actions github-actions Bot added the ready-for-review PR is ready for maintainer review label Apr 25, 2026
@github-actions github-actions Bot added area/runtime Agent loop, LLM drivers, WASM sandbox size/M 50-249 lines changed labels Apr 25, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@houko
houko merged commit 2a45c46 into main Apr 25, 2026
29 of 30 checks passed
@houko
houko deleted the followup/searxng-review branch April 25, 2026 12:03
@github-actions github-actions Bot removed the ready-for-review PR is ready for maintainer review label Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/runtime Agent loop, LLM drivers, WASM sandbox size/M 50-249 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant