Repository navigation
feat(search): WebSearchProvider abstraction + SearXNG and Brave backends (#9022, #9023) - #10292
Merged
Merged
Conversation
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
Applied Black, isort, and autoflake to match code-quality checks. Triggered by workflow auto-fix-formatting.yml. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This was referenced Jun 18, 2026
Closed
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.
Thinking Path
#9022 (SearXNG) and #9023 (Brave) both need the same thing — a pluggable web-search provider with selection + graceful fallback — so they're batched into one PR. The issues named
web_search.pyas the extension point, but that file is only an output extractor; the real search-execution seam ischat_workflow/tool_handler.py. New providers are wired into that real path (not left as orphan classes).What Changed
New abstraction
autobot-backend/agent_loop/search/(mirrorsllm_shared/provider_registry.py):base.py—WebSearchProviderABC (async search(query, *, category, count) -> list[SearchResult],is_available()) +SearchResultdataclass.registry.py—SearchProviderRegistrywith credential-gated auto-population + ordered fallback chain +registry_search()/get_search_registry()singleton.searxng_provider.py(plugin(search): SearXNG self-hosted web search backend — privacy-preserving search for agents #9022) — async GET{url}/search?format=json&categories=…; general/news/code/academic categories; HTTP Basic or token auth; no API key.brave_provider.py(plugin(search): Brave Search API — independent search index for agent web research #9023) — async GETapi.search.brave.com/res/v1/web/searchwithX-Subscription-Token; web + news; 429/quota handled; key fromssot_config(same idiom asopenai_api_key).Wiring (
chat_workflow/tool_handler.py):_web_search_structured_entriesroutes through the registry first (_web_search_via_registry), falling back to the existing Playwright backend when no provider is configured or all fail._web_search_via_playwrightnow sources from the same path, so both snippet and full-fetch modes use a configured provider. Reachable from the agentweb_searchtool.Config (
ssot_config, all default""= disabled/credential-gated):SEARXNG_INSTANCE_URL,SEARXNG_BASIC_AUTH_USER/PASS,SEARXNG_TOKEN,BRAVE_SEARCH_API_KEY.Verification
pytest tests/search/→ 19 passed (7 SearXNG, 6 Brave, 6 registry; all HTTP mocked). flake8 clean; py_compile OK on tool_handler + the package + ssot_config.[]gracefully when unconfigured → tool_handler falls back to Playwright (unchanged default behavior). Providers raise on unreachable/error → registry advances the fallback chain._populate_default_providers(try/except), and the tool_handler import is method-local — no new module-level imports.Closes #9022 and #9023.
Model Used
Claude Opus 4.8 (1M context)