hermes - ✅(Solved) Fix Hindsight memory provider crashes gateway when hindsight-client not installed [1 pull requests, 1 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#18876Fetched 2026-05-03 04:53:46
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
0
Author
Participants
Timeline (top)
labeled ×5cross-referenced ×2commented ×1

Error Message

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 does an unconditional from hindsight_client import Hindsight for all modes. The hindsight-client package is not in pyproject.toml and not in the Docker image. Import failure crashes the plugin with no graceful error.

grep -i hindsight pyproject.toml  # returns nothing

Fix Action

Fixed

PR fix notes

PR #18924: fix(memory): guard hindsight_client import to prevent gateway crash when package missing

Description (problem / solution / changelog)

Fix: Guard hindsight_client import to prevent gateway crash

Closes #18876

Problem

When memory.provider is set to hindsight but the hindsight-client package is not installed, the Hermes gateway crashes with an unhelpful ImportError and enters an infinite Docker restart loop. No error message explains why.

The root cause: plugins/memory/hindsight/__init__.py does from hindsight_client import Hindsight at line 808 without any fallback. In cloud mode, is_available() only checks for config keys (API key/URL) — it doesn't verify the package is importable. So is_available() returns True, the gateway attempts to use Hindsight memory, and _get_client() crashes.

Fix

Two changes in plugins/memory/hindsight/__init__.py:

  1. is_available() now checks importability for cloud mode: Added importlib.import_module("hindsight_client") check — returns False with a warning log if the package is missing, so the gateway skips Hindsight gracefully.

  2. _get_client() wraps the import in try/except: If hindsight_client isn't installed, raises a clear RuntimeError("hindsight-client is required for cloud mode. Install it with: pip install hindsight-client") instead of a bare ImportError.

Testing

  • Verified that is_available() returns False when hindsight_client is not importable
  • Verified that _get_client() raises a descriptive RuntimeError instead of crashing
  • Local mode already had this guard via _check_local_runtime()

Changed files

  • plugins/memory/hindsight/__init__.py (modified, +13/-1)

Code Example

grep -i hindsight pyproject.toml  # returns nothing

---

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 Hermes gateway to crash and enter an infinite Docker restart loop. No error message explains why.

Root cause

plugins/memory/hindsight/__init__.py does an unconditional from hindsight_client import Hindsight for all modes. The hindsight-client package is not in pyproject.toml and not in the Docker image. Import failure crashes the plugin with no graceful error.

grep -i hindsight pyproject.toml  # returns nothing

Steps to reproduce

  1. Deploy nousresearch/hermes-agent:latest via Docker
  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 message: "Install hindsight-client"

Suggested fix

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

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

Environment

  • Hermes v0.12.0 (Docker, nousresearch/hermes-agent:latest)
  • Hindsight self-hosted v0.5.6 (pg18)
  • OS: Linux

extent analysis

TL;DR

The Hermes gateway crash can be fixed by wrapping the hindsight_client import with a try/except block to handle the ImportError and provide a clear error message.

Guidance

  • Verify that the hindsight-client package is not installed in the Docker image by checking the pyproject.toml file and the Docker image dependencies.
  • Apply the suggested fix by wrapping the import with a try/except block in _get_client() to handle the ImportError and provide a clear error message.
  • Consider adding the hindsight-client package to the pyproject.toml file and the Docker image dependencies to prevent future import errors.
  • Test the fix by deploying the updated Docker image and verifying that the gateway no longer crashes when switching to the hindsight memory provider.

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 not installed in the Docker image. If the package is installed, the import error may be caused by a different issue.

Recommendation

Apply the workaround by wrapping the import with a try/except block to handle the ImportError and provide a clear error message, as this will prevent the gateway from crashing and provide a clear error message to the user.

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

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