fix(web): honor Hermes config-aware SEARXNG_URL lookup (salvage #34306 + auto-detect follow-up)#41482
Merged
kshitijk4poor merged 2 commits intoJun 7, 2026
Conversation
…s Hermes config Follow-up to NousResearch#34306. The provider fix made SearXNG *usable* with a config-only SEARXNG_URL, but tools/web_tools._has_env still read raw os.getenv, so the backend auto-detect cascade and check_web_api_key remained blind to it — SearXNG worked when explicitly selected but was never auto-selected. Route _has_env (and the SearXNG diagnostic print) through a config-aware _env_value helper mirroring the provider's _searxng_url(). Fixing the shared helper covers every provider key in one place. Adds regression tests for config-only auto-detect and check_web_api_key. See NousResearch#34290.
alt-glitch
pushed a commit
that referenced
this pull request
Jun 14, 2026
…nv-34306 fix(web): honor Hermes config-aware SEARXNG_URL lookup (salvage #34306 + auto-detect follow-up)
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.
Salvages #34306 (@Kailigithub) onto current main and closes the auto-detect gap that the original PR left open.
Background
#34290: the SearXNG provider read
SEARXNG_URLonly viaos.getenv(), so a URL set through Hermes' config/.env layer (hermes config set,hermes tools) — visible viahermes_cli.config.get_env_value()but not necessarily exported to the live process env — made SearXNG appear unavailable.There were three competing PRs (#34306, #34300 draft, #34367 closed). #34306 was the smallest and earliest and fixes the provider, but as flagged in review it only touched
plugins/web/searxng/provider.py— leavingtools/web_tools.py::_has_envreading rawos.getenv. Net effect: SearXNG worked when explicitly configured but was never auto-selected by the backend-priority cascade, andcheck_web_api_key()couldn't see a config-only URL.Commits
fix(web): honor Hermes config-aware SEARXNG_URL lookup— @Kailigithub's original fix, verbatim, cherry-picked onto current main. Adds_searxng_url()(config-aware, falls back toos.getenv) and routes bothis_available()andsearch()through it.fix(web): make _has_env config-aware …— follow-up closing the auto-detect gap at the shared helper. Routes_has_env(and the SearXNG diagnostic-print path) through a new config-aware_env_value()that mirrors the provider's_searxng_url(). Fixing the shared helper makes every provider key in the cascade config-aware in one place, not just SearXNG. Adds regression tests for config-only auto-detect (_get_backend() == "searxng") andcheck_web_api_key().Verification
tests/tools/test_web_providers_searxng.py: 26/26 pass (24 original + 2 new).ruff checkclean on both changed files.SEARXNG_URLabsent from process env):_has_env→ True (was False),_get_backend()→searxng,check_web_api_key()→ True,provider.is_available()→ True.Closes #34290.
Co-authored-by: Kailigithub 12250313+Kailigithub@users.noreply.github.com