fix(web): ensure plugin discovery before web_*_tool registry lookups - #34563
Merged
Conversation
Web search/extract dispatch read agent.web_search_registry before plugin
discovery had run, so in any process that hadn't imported model_tools.py
(subprocess agent runs, delegate children, standalone scripts) the registry
was empty: get_provider('firecrawl') returned None and the dispatcher emitted
the misleading 'No web extract provider configured' error even with
web.extract_backend set and FIRECRAWL_API_KEY exported.
Adds an idempotent _ensure_web_plugins_loaded() helper (mirrors
tools.browser_tool._ensure_browser_plugins_loaded) and calls it at the top of
both the web_search_tool and web_extract_tool dispatch sites before the
registry lookup.
Fixes #27580.
Co-authored-by: briandevans <252620095+briandevans@users.noreply.github.com>
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
invalid-method-override |
1 |
First entries
tests/tools/test_web_providers.py:384: [invalid-method-override] invalid-method-override: Invalid override of method `extract`: Definition is incompatible with `WebSearchProvider.extract`
✅ Fixed issues: none
Unchanged: 4899 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
Collaborator
3 tasks
7 tasks
This was referenced Jul 28, 2026
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.
Summary
Web search and extract now work in any process — not just ones that happen to have imported
model_tools.pyfirst.Since the web providers became plugins, the registry is only populated as a side effect of
model_tools.pytriggering plugin discovery. The dispatchers intools/web_tools.pyreadagent.web_search_registrydirectly, so from a cold context (subprocess agent runs, delegate children, standalone scripts) the registry was empty:get_provider('firecrawl')returnedNoneand the user got the misleading"No web extract provider configured"error even withweb.extract_backend: firecrawlset andFIRECRAWL_API_KEYexported.Salvage of #27584 by @briandevans onto current main. The original PR also patched a
web_crawl_tooldispatcher that no longer exists on main (removed in the ~284 commits since), so that hunk and its test are dropped; the two live dispatchers (search + extract) carry the fix.Fixes #27580.
Changes
tools/web_tools.py: add idempotent_ensure_web_plugins_loaded()(mirrorstools.browser_tool._ensure_browser_plugins_loaded); call it at the top of theweb_search_toolandweb_extract_tooldispatch sites before the registry lookup.tests/tools/test_web_providers.py:TestDispatchersTriggerPluginDiscovery— asserts each dispatcher invokes the discovery hook before resolving the registry, on a deliberately-cleared registry.Validation
web.extract_backend: firecrawl+ key set"No web extract provider configured"[][brave-free, ddgs, exa, firecrawl, parallel, searxng, tavily, xai]tests/tools/test_web_providers.pyE2E-verified: cold process (no pre-triggered discovery), empty registry at import,
web_extract_tool(["https://example.com"])no longer short-circuits — discovery fires and it reaches the firecrawl backend.Infographic