Repository navigation
Fix #3364: web search robustness - handle non-2xx responses and filter search engine self-links - #3365
Conversation
…ters search engine self-links - Add HTTP status code check to execute_web_search: return error if response is not 2xx instead of proceeding with potentially junk results (e.g., DuckDuckGo challenge pages) - Filter out links pointing back to the search engine host in extract_search_hits_from_generic_links to avoid returning search engine self-links when no proper search results are found - Add regression tests for both scenarios Refs #3364
…responses - Replace exact host matching with registrable domain comparison to properly filter search engine self-links across subdomains (e.g., html.duckduckgo.com vs duckduckgo.com) - Add error handling for 2xx responses with no search results (e.g., 202 challenge pages from blocked search providers) - Add regression tests for both 202 challenge page and mixed self-link scenarios - Remove unrelated Cargo.lock version bumps (revert to 0.1.6) Fixes #3364
…ine links The challenge page arrives as HTTP 202, which is_success() accepts, and its links point at duckduckgo.com while the request goes to html.duckduckgo.com, so the previous filter kept them. Only a 200 page is parsed now, and the generic fallback drops any duckduckgo.com link or link to the configured search host. Removes the registrable-domain heuristic and the 'no hits is an error' path (a real query can legitimately return nothing), and replaces tests that never exercised a self-link with ones that fail on the old code. Refs #3364
|
Thanks for the fix — rejecting non-2xx responses instead of extracting junk from DuckDuckGo challenge pages, plus dropping self-referencing search-engine links, matches the symptom we hit (every connection returning HTTP 202). One note: the opt-in keyless API backend proposal from the triage issue is still unaddressed — worth tracking it as a separate issue so the 202 handling and the API backend stay decoupled. |
1 similar comment
|
Thanks for the fix — rejecting non-2xx responses instead of extracting junk from DuckDuckGo challenge pages, plus dropping self-referencing search-engine links, matches the symptom we hit (every connection returning HTTP 202). One note: the opt-in keyless API backend proposal from the triage issue is still unaddressed — worth tracking it as a separate issue so the 202 handling and the API backend stay decoupled. |
Fixes the bug reported in issue #3364 where DuckDuckGo challenge pages (HTTP 202 or similar without proper search result markup) would return junk results pointing back to DuckDuckGo itself.
Changes
What this fixes
Refs #3364
Note: The optional provider proposal from #3364 (CLAWD_WEB_SEARCH_PROVIDER=keenable) is left for maintainer review as a separate product decision.