fix(web): honor plugin-registered backend availability - #38375
Closed
leeska wants to merge 1 commit into
Closed
Conversation
1 task
Collaborator
|
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 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.
What does this PR do?
Makes web backend availability checks plugin-aware. Today
_is_backend_available()only recognizes a hardcoded set of built-in backend names. A third-party web provider can register successfully throughPluginContext.register_web_search_provider(), but if a user setsweb.search_backendorweb.extract_backendto that provider name,_get_capability_backend()filters it out before dispatch reaches the provider registry.This PR keeps the existing fast paths for built-in backends, then falls back to the web provider registry for unknown backend names after plugin discovery. That lets user-installed web backend plugins decide their own availability via
provider.is_available()instead of requiring every provider name to be hardcoded in core.Related Issue
Fixes #31873
Fixes #35970
Related open PRs found before opening this one:
This PR differs by including a focused regression test and using the repository PR template/checklist.
Type of Change
Changes Made
tools/web_tools.py: for unknown backend names, trigger plugin discovery and consultagent.web_search_registry.get_provider(backend), returning the provider's ownis_available()result when registered.tests/tools/test_web_providers.py: add a regression test proving a custom registry-backed extract provider is selected viaweb.extract_backend, while an unregistered custom name still returns unavailable.How to Test
ctx.register_web_search_provider()and returns a provider namedcustom-extract.web.extract_backend: custom-extract.web_extractand verify it routes to the custom provider instead of falling back toweb.backend/ a built-in backend.Automated test run:
/root/.hermes/hermes-agent/venv/bin/python -m pytest tests/tools/test_web_providers.py tests/plugins/web/test_web_search_provider_plugins.py -q # 66 passed, 1 warning in 5.13sChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A
Screenshots / Logs
Targeted tests: