Problem
The SearXNG provider (internal/web/search/providers/searxng.go) frequently fails silently or surfaces unhelpful errors. Common failure modes:
- JSON decode errors — Some SearXNG instances return HTML error pages (e.g. rate-limit page, maintenance page) when the
format=json parameter is not honoured. json.Decoder fails with a generic parse error and no hint that HTML was returned.
- No retry logic — A single transient network blip or a momentary SearXNG overload causes a permanent failure for that search.
- Fixed 20s timeout — Slow or remote SearXNG instances get cut off. There is no way to configure the timeout in
nexus.json.
- Opaque error messages — Errors like
"failed to decode SearXNG response: invalid character '<' …" are confusing for end-users; they don't indicate that the instance may be misconfigured.
enabled_engines query param misuse — When AllowedDomains is set, enabled_engines=google,bing,duckduckgo is appended, but this is a SearXNG-specific parameter that may not be supported on all instances and has nothing to do with domain filtering.
Proposed improvements
Better error detection
if ct := resp.Header.Get("Content-Type"); !strings.Contains(ct, "application/json") {
body, _ := io.ReadAll(io.LimitReader(resp.Body, 512))
return ProviderOutput{}, fmt.Errorf("SearXNG returned non-JSON response (%s): %s", ct, body)
}
Configurable timeout
Add Timeout int to SearXNGProvider / read from nexus.json web_search.searxng.timeout (seconds, default 20).
Retry on transient errors
Wrap the HTTP call in a simple 2-attempt retry with 500 ms back-off for 5xx responses and network errors.
Clearer user-facing errors in the Settings UI
When verification fails in WebSearchConfig.verify(), propagate a friendly message: e.g. "Could not reach SearXNG at http://localhost:8080 — is the instance running?".
Fix enabled_engines misuse
Remove the enabled_engines param from the AllowedDomains branch; it does not implement domain filtering. Domain filtering can be done via SearXNG's sitefilter if needed.
Files affected
internal/web/search/providers/searxng.go — core provider
internal/nexustui/ui/dialog/web_search_config.go — verification and error display
internal/nexustui/config/ — optional: add timeout field to SearXNGConfig
Problem
The SearXNG provider (
internal/web/search/providers/searxng.go) frequently fails silently or surfaces unhelpful errors. Common failure modes:format=jsonparameter is not honoured.json.Decoderfails with a generic parse error and no hint that HTML was returned.nexus.json."failed to decode SearXNG response: invalid character '<' …"are confusing for end-users; they don't indicate that the instance may be misconfigured.enabled_enginesquery param misuse — WhenAllowedDomainsis set,enabled_engines=google,bing,duckduckgois appended, but this is a SearXNG-specific parameter that may not be supported on all instances and has nothing to do with domain filtering.Proposed improvements
Better error detection
Configurable timeout
Add
Timeout inttoSearXNGProvider/ read fromnexus.jsonweb_search.searxng.timeout(seconds, default 20).Retry on transient errors
Wrap the HTTP call in a simple 2-attempt retry with 500 ms back-off for 5xx responses and network errors.
Clearer user-facing errors in the Settings UI
When verification fails in
WebSearchConfig.verify(), propagate a friendly message: e.g."Could not reach SearXNG at http://localhost:8080 — is the instance running?".Fix
enabled_enginesmisuseRemove the
enabled_enginesparam from theAllowedDomainsbranch; it does not implement domain filtering. Domain filtering can be done via SearXNG'ssitefilterif needed.Files affected
internal/web/search/providers/searxng.go— core providerinternal/nexustui/ui/dialog/web_search_config.go— verification and error displayinternal/nexustui/config/— optional: addtimeoutfield toSearXNGConfig