Skip to content

fix(web): ensure plugin discovery before web_*_tool registry lookups - #34563

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-13d3d6b7
May 29, 2026
Merged

fix(web): ensure plugin discovery before web_*_tool registry lookups#34563
teknium1 merged 1 commit into
mainfrom
hermes/hermes-13d3d6b7

Conversation

@teknium1

@teknium1 teknium1 commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Web search and extract now work in any process — not just ones that happen to have imported model_tools.py first.

Since the web providers became plugins, the registry is only populated as a side effect of model_tools.py triggering plugin discovery. The dispatchers in tools/web_tools.py read agent.web_search_registry directly, so from a cold context (subprocess agent runs, delegate children, standalone scripts) the registry was empty: get_provider('firecrawl') returned None and the user got the misleading "No web extract provider configured" error even with web.extract_backend: firecrawl set and FIRECRAWL_API_KEY exported.

Salvage of #27584 by @briandevans onto current main. The original PR also patched a web_crawl_tool dispatcher 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() (mirrors tools.browser_tool._ensure_browser_plugins_loaded); call it at the top of the web_search_tool and web_extract_tool dispatch 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

Before After
Cold process, web.extract_backend: firecrawl + key set "No web extract provider configured" routes to real firecrawl backend
Registry at dispatch from cold context [] [brave-free, ddgs, exa, firecrawl, parallel, searxng, tavily, xai]
tests/tools/test_web_providers.py 13 passed 15 passed (2 new regression tests)

E2E-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

web-search-plugin-discovery-fix

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>
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-13d3d6b7 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9436 on HEAD, 9435 on base (🆕 +1)

🆕 New issues (1):

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.

@alt-glitch alt-glitch added type/bug Something isn't working comp/tools Tool registry, model_tools, toolsets tool/web Web search and extraction comp/plugins Plugin system and bundled plugins P2 Medium — degraded but workaround exists labels May 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Salvage of #27584 onto current main by @teknium1. Supersedes #27584. Also supersedes closed #27700 and #28202.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins comp/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists tool/web Web search and extraction type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web_extract fails with "No web extract provider configured" despite extract_backend: firecrawl and valid API key

3 participants