Skip to content

fix(web): honor Hermes config-aware SEARXNG_URL lookup#34306

Open
Kailigithub wants to merge 1 commit into
NousResearch:mainfrom
Kailigithub:fix/searxng-config-env-34290
Open

fix(web): honor Hermes config-aware SEARXNG_URL lookup#34306
Kailigithub wants to merge 1 commit into
NousResearch:mainfrom
Kailigithub:fix/searxng-config-env-34290

Conversation

@Kailigithub

Copy link
Copy Markdown
Contributor

Summary

Fixes a configuration consistency bug where the SearXNG web search provider only checked os.getenv("SEARXNG_URL"), ignoring values set through Hermes' config-aware env handling (.env files, hermes config set, etc.).

Problem

SearXNGWebSearchProvider reads SEARXNG_URL using os.getenv() directly in both is_available() and search(). When SEARXNG_URL is configured through Hermes' own env handling (which populates the Hermes config layer but not necessarily the raw process env), SearXNG reports unavailable even though it is correctly configured.

Solution

Introduce _searxng_url() helper that checks Hermes config-aware env first via get_env_value(), then falls back to os.getenv(). Both is_available() and search() now use this helper.

The fallback preserves backward compatibility: if Hermes config lookup fails for any reason, the code gracefully degrades to raw process env.

Verification

  • python3 -m py_compile plugins/web/searxng/provider.py passes
  • ruff check plugins/web/searxng/provider.py passes (no issues)

Closes #34290

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins tool/web Web search and extraction area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels May 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #34300 — both fix SearXNG config-aware env lookup for #34290. #34300 is broader (also touches web_tools.py for backend auto-detect consistency).

kshitijk4poor added a commit that referenced this pull request Jun 7, 2026
…s Hermes config

Follow-up to #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 #34290.
kshitijk4poor added a commit that referenced this pull request Jun 7, 2026
…nv-34306

fix(web): honor Hermes config-aware SEARXNG_URL lookup (salvage #34306 + auto-detect follow-up)
changman pushed a commit to changman/hermes-agent that referenced this pull request Jun 10, 2026
…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
…s Hermes config

Follow-up to #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 #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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists 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.

Bug: SearXNG provider ignores Hermes config env values for SEARXNG_URL

2 participants