hermes - ✅(Solved) Fix Hindsight memory provider crashes gateway with no error when hindsight-client not installed [1 pull requests, 2 comments, 2 participants]

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…
GitHub stats
NousResearch/hermes-agent#18875Fetched 2026-05-03 04:53:48
View on GitHub
Comments
2
Participants
2
Timeline
8
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2cross-referenced ×2

Error Message

Before (crashes gateway)

from hindsight_client import Hindsight

After

try: from hindsight_client import Hindsight except ImportError: raise RuntimeError( "hindsight-client is required. Install: pip install hindsight-client" )

Root Cause

plugins/memory/hindsight/__init__.py_get_client() does an unconditional from hindsight_client import Hindsight for all modes (cloud / local_external / local_embedded). The hindsight-client package is not declared in pyproject.toml and not included in the Docker image. When the import fails the entire plugin crashes, taking the gateway down.

grep -i hindsight pyproject.toml  # returns nothing

Fix Action

Fixed

PR fix notes

PR #18882: fix(hindsight): guard against missing hindsight-client in cloud/external modes

Description (problem / solution / changelog)

Problem

When hindsight-client is not installed but the user has configured cloud or local_external mode (e.g. has an API key set from a previous install), the gateway crashes with an unhandled ImportError on the first memory operation.

Root cause: _get_client() (line 808) does a bare from hindsight_client import Hindsight without any guard. Meanwhile:

  • is_available() for cloud mode only checks API key/URL, not package availability
  • initialize() has a guard for local_embedded mode (_check_local_runtime()) but none for cloud/external modes

Fix

Three-layer defense:

  1. _check_cloud_client() — new helper (parallel to _check_local_runtime()) that verifies hindsight_client is importable
  2. is_available() — now checks package availability for cloud and local_external modes before returning True
  3. initialize() — disables cloud/external modes when client is missing (mirrors existing local_embedded guard)
  4. _get_client() — wraps import in try/except with actionable error message as safety net

Tests

4 new tests added:

  • test_cloud_mode_unavailable_when_client_not_installed
  • test_local_external_mode_unavailable_when_client_not_installed
  • test_initialize_disables_cloud_mode_when_client_not_installed
  • test_initialize_disables_local_external_when_client_not_installed

All 95 hindsight tests pass.

Fixes #18875

Changed files

  • plugins/memory/hindsight/__init__.py (modified, +36/-2)
  • tests/plugins/memory/test_hindsight_provider.py (modified, +93/-2)

Code Example

grep -i hindsight pyproject.toml  # returns nothing

---

# Before (crashes gateway)
from hindsight_client import Hindsight

# After
try:
    from hindsight_client import Hindsight
except ImportError:
    raise RuntimeError(
        "hindsight-client is required. Install: pip install hindsight-client"
    )
RAW_BUFFERClick to expand / collapse

What happens

Switching memory.provider from builtin to hindsight causes the gateway to crash and enter an infinite Docker restart loop. No error message explains why.

Root cause

plugins/memory/hindsight/__init__.py_get_client() does an unconditional from hindsight_client import Hindsight for all modes (cloud / local_external / local_embedded). The hindsight-client package is not declared in pyproject.toml and not included in the Docker image. When the import fails the entire plugin crashes, taking the gateway down.

grep -i hindsight pyproject.toml  # returns nothing

Steps to reproduce

  1. Deploy nousresearch/hermes-agent:latest
  2. Set memory.provider: hindsight in config.yaml
  3. Restart gateway → crash → Docker restart → crash → loop

Expected

is_available() returns False or plugin raises a clear error: "hindsight-client required, install with pip install hindsight-client"

Suggested fix

Wrap the import in _get_client() with try/except ImportError:

# Before (crashes gateway)
from hindsight_client import Hindsight

# After
try:
    from hindsight_client import Hindsight
except ImportError:
    raise RuntimeError(
        "hindsight-client is required. Install: pip install hindsight-client"
    )

Alternatively, add hindsight-client as an optional extra in pyproject.toml.

Environment

  • Hermes v0.12.0 (Docker)
  • Hindsight self-hosted local v0.5.6

extent analysis

TL;DR

To fix the gateway crash when switching to the hindsight memory provider, wrap the Hindsight import in a try-except block or add hindsight-client as an optional extra in pyproject.toml.

Guidance

  • Verify that hindsight-client is not installed by running pip list hindsight-client in the Docker container.
  • Apply the suggested fix by wrapping the import in _get_client() with a try-except block to raise a clear error message when hindsight-client is not installed.
  • Alternatively, add hindsight-client as an optional extra in pyproject.toml to allow for conditional installation.
  • Test the fix by restarting the gateway and checking for the expected error message or successful operation.

Example

try:
    from hindsight_client import Hindsight
except ImportError:
    raise RuntimeError(
        "hindsight-client is required. Install: pip install hindsight-client"
    )

Notes

This fix assumes that the hindsight-client package is required for the hindsight memory provider to function correctly. If this is not the case, additional investigation may be necessary to determine the root cause of the crash.

Recommendation

Apply the workaround by wrapping the import in a try-except block, as this provides a clear error message and allows for easier debugging.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING