fix(hindsight): surface the exception chain when the local runtime is unavailable - #61611
Open
falkoro wants to merge 1 commit into
Open
fix(hindsight): surface the exception chain when the local runtime is unavailable#61611falkoro wants to merge 1 commit into
falkoro wants to merge 1 commit into
Conversation
teknium1
reviewed
Jul 10, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the narrowly scoped diagnosability fix. Current main still drops chained import failures at plugins/memory/hindsight/__init__.py:140, and that reason reaches both the local-mode warning (:1273-1278) and _get_client() RuntimeError (:1016-1021). The formatter and focused explicit-cause, implicit-context, single-error, cycle, and integration-path tests are appropriate.
Problems
tests/plugins/memory/test_hindsight_provider.py:1882importsimportlib as _importlib, but the test only useshs.importlib;_importlibis unused.
Suggested changes
- Remove the unused import at
tests/plugins/memory/test_hindsight_provider.py:1882.
Automated hermes-sweeper review.
| assert rendered.count("ValueError") == 2 | ||
|
|
||
| def test_check_local_runtime_reason_contains_root_cause(self, monkeypatch): | ||
| import importlib as _importlib |
Contributor
There was a problem hiding this comment.
_importlib is never referenced; the test patches hs.importlib below. Please remove this unused import.
falkoro
force-pushed
the
fix/hindsight-import-error-chain
branch
from
July 15, 2026 13:39
511aada to
2a12e12
Compare
falkoro
force-pushed
the
fix/hindsight-import-error-chain
branch
2 times, most recently
from
July 27, 2026 18:46
4964ca0 to
00c26b1
Compare
… unavailable
_check_local_runtime() returned str(exc), which drops the exception
cause/context chain. Upstream wrappers hide the real failure behind a
generic re-raise: hindsight_api's LocalSTEmbeddings.initialize() catches
the actual error and re-raises 'sentence-transformers is required ...
pip install sentence-transformers' even when that package IS installed
and the real problem is a dependency conflict underneath it. During the
package while the chained cause held the actual conflict
('huggingface-hub>=1.5.0,<2.0 is required ... found 1.2.3').
Walk __cause__/__context__ (cycle-safe, capped at 5 links) and render
the chain into the reason Hermes reports, plus a debug-level traceback.
The reason flows verbatim into the RuntimeError raised by _get_client()
and the availability messaging, so the root cause is now visible in one
log read instead of requiring a dig through the Hindsight daemon's own
profile logs.
Diagnosability follow-up to NousResearch#60783 (the downgrade itself is fixed by
falkoro
force-pushed
the
fix/hindsight-import-error-chain
branch
from
July 31, 2026 17:28
00c26b1 to
30e430e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Diagnosability fix for the failure mode documented in #60783's second confirming report: when the local Hindsight runtime fails to import,
_check_local_runtime()returnedstr(exc)— which drops the exception cause/context chain. Upstream,hindsight_api'sLocalSTEmbeddings.initialize()catches the real error and re-raises a generic "sentence-transformers is required … pip install sentence-transformers" even when that package is installed — during the #60783 huggingface-hub downgrade the actual conflict (huggingface-hub>=1.5.0,<2.0 is required … found 1.2.3) lived only in the chained cause, and the surfaced message sent users reinstalling the wrong package.Fix: a
_format_exception_chain()helper walks__cause__/__context__(cycle-safe, capped at 5 links) and renders the chain into the reason — which flows verbatim into_get_client()'sRuntimeErrorand availability messaging — plus a debug-level full traceback. The root cause becomes visible in one Hermes log read instead of requiring a dig through the Hindsight daemon's own profile logs.Kept deliberately separate from #60797 (which fixes the downgrade itself) so each PR stays single-concern.
Related Issue
Diagnosability follow-up to #60783 (root cause fixed by #60797)
Type of Change
Changes Made
plugins/memory/hindsight/__init__.py— new_format_exception_chain();_check_local_runtime()returns the rendered chain and logs the traceback at debug leveltests/plugins/memory/test_hindsight_provider.py— 5 new tests: explicitfrom echain, implicit__context__chain, single-exception shape, cycle safety, and the end-to-end_check_local_runtimereason containing the root causeHow to Test
pytest tests/plugins/memory/test_hindsight_provider.py -q→ 121 passed (5 new)hermesmemory init now reportsImportError: sentence-transformers is required … <- caused by: ImportError: huggingface-hub>=1.5.0,<2.0 is required …instead of only the misleading first half.Checklist
Code
Documentation & Housekeeping
cli-config.yaml.example— N/A (no config keys)