Repository navigation
fix(plugins): auto-add scheme to schemeless Hindsight api_url - #78979
thatssoheil wants to merge 1 commit into
Conversation
A configured api_url without a scheme (e.g. "host:8888") reached the HTTP layer as an invalid URL and every hindsight_* tool failed with a cryptic URL-only error. Normalize at provider init: prepend http:// for local modes and https:// otherwise, matching the existing defaults. Explicit schemes are left untouched. Fixes NousResearch#78967.
|
This was generated by AI during triage. Open PR #78968, by the issue reporter, covers both of #78967's expected behaviors — including the wrong-but-valid-scheme hint this diff omits — so whichever of the two #78968 ( Checked against |
|
Closing as a duplicate of #78968. #78968 (Realmagnum) was submitted earlier (00:07 UTC vs. my 00:26 UTC) and is a broader superset that covers both expected behaviors in the issue:
Thanks to @Realmagnum for the more complete fix. |
Summary
Fixes #78967. A configured
api_urlwithout a scheme (e.g."host:8888") reached the HTTP layer as an invalid URL, so everyhindsight_recall/hindsight_retain/hindsight_reflectcall failed with a cryptic URL-only error.hermes memory statusstill reported the provider as available, so nothing surfaced the misconfiguration until runtime.Fix
Added
_ensure_url_scheme()inplugins/memory/hindsight/__init__.py, applied at providerinitialize()— the single assignment site of_api_url, covering config.json,HINDSIGHT_API_URLenv var, and wizard-set values:local_embedded/local_external) → prependhttp://(self-hosted daemon, matches_DEFAULT_LOCAL_URL)https://(matches_DEFAULT_API_URL)://) → left untouchedTests
4 regression tests in
tests/plugins/memory/test_hindsight_provider.py:local_external→http://addedcloud→https://addedHINDSIGHT_API_URLenv var normalizedAll pass under
scripts/run_tests.sh(CI parity). The 6 pre-existing failures in the file are missinghindsight_client_apimodule — verified identical on pristine main.