Conversation
…or plugin backends The hardcoded switch in _is_backend_available() only knew about the built-in backends (brave-free, ddgs, xai, etc.) and returned False for any other name. Plugin-registered backends like crawl4ai were properly loaded into agent.web_search_registry but the dispatcher treated them as unavailable, then silently fell back to brave-free. Fix: when the hardcoded switch doesn't recognize a backend, ask the provider registry's own is_available() method. This makes plugins authoritative about their own availability — which is also the correct design. Tested locally: with a 'crawl4ai' plugin registered in agent.web_search_registry, setting web.extract_backend: crawl4ai in config.yaml now correctly routes web_extract through the plugin instead of falling back to brave-free.
1 task
This was referenced May 27, 2026
This was referenced May 28, 2026
Closed
18 tasks
3 tasks
Contributor
|
Superseded by #57779, which fixes this same bug class (plugin-registered web providers invisible to the tool-availability gate) as a single chokepoint in Your PR targeted the same gate and informed the approach — thanks for the contribution, credited in the merged PR body. Closing as superseded. #57779 |
This was referenced Jul 4, 2026
This was referenced Aug 3, 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
_is_backend_available()intools/web_tools.pyuses a hardcoded switch that only knows about the built-in backends (brave-free,ddgs,xai, etc.). For any other backend name, it returnsFalse. This silently breaks plugin-registered web search/extract backends: even when a plugin correctly registers a provider withagent.web_search_registry, the dispatcher seesis_backend_available == Falseand falls back tobrave-free. From the user's perspective, the plugin is fully loaded ("Plugin 'web-foo' registered web provider: foo" appears in the agent log) butweb_extractstill routes to the default — confusing to debug.Fix
When the hardcoded switch doesn't recognize a backend name, fall through to the provider registry and ask its
is_available()method. This makes plugins authoritative about their own availability, which matches how the rest of the plugin system already works.Eleven lines, no new dependencies, no behavior change for any of the built-in backends. The registry import is intentionally local to the function so it doesn't introduce an import-time circular dep, and the
try/exceptis broad on purpose because_is_backend_availableruns on everyweb_search/web_extractdispatch and must never raise.Repro (before this patch)
~/.hermes/plugins/web/<name>/that callsctx.register_web_search_provider(MyProvider())whereMyProvider.name == "myname"andMyProvider.supports_extract() == True.web.extract_backend: mynamein~/.hermes/config.yaml.Plugin 'web-myname' registered web provider: myname.web_extractagainst any URL.Expected: the plugin handles the extract.
Actual (without patch): falls back to
brave-freeand returns the Brave search-only error.After this patch, step 4 correctly routes through the plugin.
Test
Tested locally on a real plugin (
web-crawl4ai, a Crawl4AI wrapper) on a Hermes deployment in production use.web.extract_backend: crawl4ainow routes correctly; built-in backends (brave-free,ddgs,xai) behave identically to before.No new unit tests added because the change is a fall-through path inside a private helper that's only exercised through the existing dispatch tests. Happy to add a focused test if you'd like — point me at the right file and I'll follow up.
Notes for reviewers
from agent.web_search_registry import get_provideris intentionally inside the function. Module-level imports ofagent.*fromtools/*historically tangle import order on this codebase; the local import keeps things tidy.