Skip to content

feat(search): WebSearchProvider abstraction + SearXNG and Brave backends (#9022, #9023) - #10292

Merged
mrveiss merged 3 commits into
Dev_new_guifrom
issue-9022
Jun 18, 2026
Merged

mrveiss merged 3 commits into
Dev_new_guifrom
issue-9022

Conversation

@mrveiss

@mrveiss mrveiss commented Jun 18, 2026

Copy link
Copy Markdown
Owner

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.py as the extension point, but that file is only an output extractor; the real search-execution seam is chat_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/ (mirrors llm_shared/provider_registry.py):

Wiring (chat_workflow/tool_handler.py): _web_search_structured_entries routes 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_playwright now sources from the same path, so both snippet and full-fetch modes use a configured provider. Reachable from the agent web_search tool.

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.
  • Fallback proven: registry returns [] gracefully when unconfigured → tool_handler falls back to Playwright (unchanged default behavior). Providers raise on unreachable/error → registry advances the fallback chain.
  • Startup-safe: providers/config imported lazily inside _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)

@github-actions

github-actions Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

github-actions Bot and others added 2 commits June 18, 2026 10:31
Applied Black, isort, and autoflake to match code-quality checks.
Triggered by workflow auto-fix-formatting.yml.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant