hermes - 💡(How to fix) Fix Bug: SearXNG provider ignores Hermes config env values for SEARXNG_URL

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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.

Error Message

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()

Root Cause

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.

Fix Action

Fix / Workaround

I have a local patch with regression coverage for:

Code Example

os.getenv("SEARXNG_URL", "")

---

def is_available(self) -> bool:
    return bool(os.getenv("SEARXNG_URL", "").strip())

base_url = os.getenv("SEARXNG_URL", "").strip().rstrip("/")

---

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()
RAW_BUFFERClick to expand / collapse

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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If SEARXNG_URL is configured through Hermes config/env handling, SearXNG should be available and web_search should use it.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Bug: SearXNG provider ignores Hermes config env values for SEARXNG_URL