Repository navigation
fix(searxng): avoid duplicating configured search endpoint - #113661
Conversation
d4c966a to
68bdaed
Compare
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
68bdaed to
2c483b5
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 25, 2026, 9:19 AM ET / 13:19 UTC. ClawSweeper reviewWhat this changesThe PR makes the SearXNG web-search client reuse a configured URL path already ending in Merge readinessKeep this PR open for normal maintainer review. The current implementation on Likely related people: Priority: P2 Review scores
Verification
How this fits togetherThe bundled SearXNG plugin converts a configured self-hosted instance URL plus a search query into a JSON search request. That request is validated and sent through OpenClaw’s guarded web-search transport, then normalized into tool results for agents. flowchart LR
A[Configured SearXNG URL] --> B[Resolve search settings]
C[Agent web search query] --> D[Build JSON search URL]
B --> D
D --> E[Validate endpoint and send request]
E --> F[Parse SearXNG results]
F --> G[Return normalized web-search results]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +15. Total +16 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase or update the branch onto current Do we have a high-confidence way to reproduce the issue? Yes, at source level: configure the SearXNG base URL with a pathname ending in Is this the best way to solve the issue? Yes. Normalizing only trailing slashes and treating an existing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9a7a5791c720. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: fix(codex): restore connected apps for token-authenticated runs (openclaw#115075) fix(codex): classify hosted search timeouts (openclaw#115837) fix(msteams): keep attachment replies in channel threads (openclaw#94348) fix(telegram): linkPreview:false is ignored on streamed replies (openclaw#114125) fix(protocol): make Swift model checks non-mutating (openclaw#115793) fix(searxng): avoid duplicating search endpoint (openclaw#113661) fix(agents): preserve tool-result middleware identity (openclaw#115821) refactor(meetings): consolidate runtime facades (openclaw#115819)
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
* origin/main: fix(codex): restore connected apps for token-authenticated runs (openclaw#115075) fix(codex): classify hosted search timeouts (openclaw#115837) fix(msteams): keep attachment replies in channel threads (openclaw#94348) fix(telegram): linkPreview:false is ignored on streamed replies (openclaw#114125) fix(protocol): make Swift model checks non-mutating (openclaw#115793) fix(searxng): avoid duplicating search endpoint (openclaw#113661) fix(agents): preserve tool-result middleware identity (openclaw#115821) refactor(meetings): consolidate runtime facades (openclaw#115819)
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes an issue where users configuring a self-hosted SearXNG instance with a base URL that already points at the
/searchendpoint would have OpenClaw send requests to/search/searchinstead.This affects the SearXNG web-search path because
runSearxngSearch()resolves the configured base URL and thenbuildSearxngSearchUrl()appends the search endpoint before the guarded provider request is made. A normal endpoint-style configuration such ashttp://127.0.0.1:<port>/searchtherefore targets the wrong route.Why This Change Was Made
The URL builder now trims trailing slashes from the configured path and reuses it when it already ends in
/search; otherwise it keeps the existing behavior of appending/searchto base-path prefixes.This keeps the fix local to the SearXNG client endpoint construction. It does not change SSRF validation, trusted/self-hosted routing, query parameter handling, category retry behavior, response parsing, or cache keys.
User Impact
Users can configure either a SearXNG host root or an explicit SearXNG search endpoint without OpenClaw duplicating the path segment.
For example,
https://search.example.com/searxngstill buildshttps://search.example.com/searxng/search?..., whilehttps://search.example.com/searchnow buildshttps://search.example.com/search?...rather thanhttps://search.example.com/search/search?....Evidence
User-realistic local path capture using
runSearxngSearch()against a local HTTP server:Focused validation:
Additional check:
Sibling surface checked: the existing base-path-prefix test still verifies that a configured prefix such as
/searxngcontinues to append/searchinstead of being treated as a complete endpoint.