Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tools/web_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,14 @@ async def web_extract_tool(
if not safe_urls:
results = []
else:
# Ensure plugin-registered providers (including custom

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a regression test for this earlier placement. The existing discovery test uses legacy firecrawl and only checks that the hook ran; it does not prove that a plugin-only extract_backend is resolved after discovery rather than falling back to a shared searxng backend.

# extract-only backends like web-local) are loaded BEFORE
# resolving the backend, so _is_backend_available() can see
# them via the registry. Loading after resolution caused the
# configured extract_backend to be reported as "unavailable"
# and silently fall back to web.backend (e.g. searxng),
# producing a "search-only backend" error.
_ensure_web_plugins_loaded()
backend = _get_extract_backend()

# All seven providers (brave-free, ddgs, searxng, exa, parallel,
Expand All @@ -864,7 +872,6 @@ async def web_extract_tool(
# detect coroutine functions and await; sync functions run
# inline (the policy gate, SSRF re-check, etc. live inside the
# provider itself for the firecrawl per-URL loop).
_ensure_web_plugins_loaded()
from agent.web_search_registry import (
get_active_extract_provider,
get_provider as _wsp_get_provider,
Expand Down