Skip to content

fix(web): honor Hermes config-aware SEARXNG_URL lookup (salvage #34306 + auto-detect follow-up)#41482

Merged
kshitijk4poor merged 2 commits into
NousResearch:mainfrom
kshitijk4poor:salvage/searxng-config-env-34306
Jun 7, 2026
Merged

fix(web): honor Hermes config-aware SEARXNG_URL lookup (salvage #34306 + auto-detect follow-up)#41482
kshitijk4poor merged 2 commits into
NousResearch:mainfrom
kshitijk4poor:salvage/searxng-config-env-34306

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

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_URL only via os.getenv(), so a URL set through Hermes' config/.env layer (hermes config set, hermes tools) — visible via hermes_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 — leaving tools/web_tools.py::_has_env reading raw os.getenv. Net effect: SearXNG worked when explicitly configured but was never auto-selected by the backend-priority cascade, and check_web_api_key() couldn't see a config-only URL.

Commits

  1. 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 to os.getenv) and routes both is_available() and search() through it.

  2. 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") and check_web_api_key().

Verification

  • tests/tools/test_web_providers_searxng.py: 26/26 pass (24 original + 2 new).
  • ruff check clean on both changed files.
  • End-to-end repro (config-only SEARXNG_URL absent 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

Kailigithub and others added 2 commits June 8, 2026 01:11
…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.
@kshitijk4poor kshitijk4poor enabled auto-merge June 7, 2026 19:46
@kshitijk4poor kshitijk4poor merged commit c986377 into NousResearch:main Jun 7, 2026
30 of 31 checks passed
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: SearXNG provider ignores Hermes config env values for SEARXNG_URL

2 participants