Summary
The SearXNG web search provider currently reads SEARXNG_URL only from the process environment via os.getenv(). In Hermes, env values may be supplied through Hermes config / .env handling and are available through hermes_cli.config.get_env_value(), but not necessarily present in the raw process environment.
This can make SearXNG appear unavailable even when it is configured correctly through Hermes' normal config/env mechanism.
Expected behavior
If SEARXNG_URL is configured through Hermes config/env handling, SearXNG should be available and web_search should use it.
Actual behavior
The SearXNG provider can report unavailable / SEARXNG_URL is not set because it only checks:
os.getenv("SEARXNG_URL", "")
This affects both availability checks and the actual search call.
Affected areas
Current source shape uses process env directly in the SearXNG provider:
def is_available(self) -> bool:
return bool(os.getenv("SEARXNG_URL", "").strip())
base_url = os.getenv("SEARXNG_URL", "").strip().rstrip("/")
tools/web_tools.py has a similar config/env boundary concern for choosing and configuring the web search backend.
Suggested fix
Use Hermes' config-aware env lookup first, then fall back to process env:
def _get_env_value(name: str) -> str:
try:
from hermes_cli.config import get_env_value
val = get_env_value(name)
except Exception:
val = None
if val is None:
val = os.getenv(name)
return (val or "").strip()
Then use _get_env_value("SEARXNG_URL") in both is_available() and search().
Why this matters
This is not about a user preference such as default result count. It is a configuration consistency bug: a backend configured through Hermes' own config/env system should not be invisible to the provider because only raw process env is checked.
Local verification
I have a local patch with regression coverage for:
- SearXNG availability using config-aware env lookup
- search call reading
SEARXNG_URL through the same helper
- existing process-env fallback still working
No secrets or private URLs are included in this report.
Summary
The SearXNG web search provider currently reads
SEARXNG_URLonly from the process environment viaos.getenv(). In Hermes, env values may be supplied through Hermes config /.envhandling and are available throughhermes_cli.config.get_env_value(), but not necessarily present in the raw process environment.This can make SearXNG appear unavailable even when it is configured correctly through Hermes' normal config/env mechanism.
Expected behavior
If
SEARXNG_URLis configured through Hermes config/env handling, SearXNG should be available andweb_searchshould use it.Actual behavior
The SearXNG provider can report unavailable /
SEARXNG_URL is not setbecause it only checks:This affects both availability checks and the actual search call.
Affected areas
Current source shape uses process env directly in the SearXNG provider:
tools/web_tools.pyhas a similar config/env boundary concern for choosing and configuring the web search backend.Suggested fix
Use Hermes' config-aware env lookup first, then fall back to process env:
Then use
_get_env_value("SEARXNG_URL")in bothis_available()andsearch().Why this matters
This is not about a user preference such as default result count. It is a configuration consistency bug: a backend configured through Hermes' own config/env system should not be invisible to the provider because only raw process env is checked.
Local verification
I have a local patch with regression coverage for:
SEARXNG_URLthrough the same helperNo secrets or private URLs are included in this report.