fix(honcho): read base_url and defaultHost from honcho.json host blocks - #61675
fix(honcho): read base_url and defaultHost from honcho.json host blocks#61675Elektrofussel wants to merge 2 commits into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tracing the Honcho configuration path and linking #61661.
Problems
plugins/memory/honcho/client.py:72returnsdefaultHostbefore the active-profile lookup. That makes every profile withoutHERMES_HONCHO_HOSTuse one configured host, conflicting with the current profile-derived host contract inplugins/memory/honcho/client.py:54-72andplugins/memory/honcho/README.md:126.- The host-block
baseUrlprecedence atplugins/memory/honcho/client.py:468reverses an explicit existing contract:tests/honcho_plugin/test_client.py:256-265requires rootbaseUrlto win. Current setup also writesbaseUrlat the root (plugins/memory/honcho/cli.py:568-573) and the local JWT under the host block (plugins/memory/honcho/cli.py:599-604).
Suggested changes
- Reproduce the empty-key case with the setup-generated root-URL/host-key shape and fix that demonstrated path without changing profile host selection or URL precedence.
- Add regression coverage for the actual reproducer and preserve the existing conflicting-root/host behavior.
Automated hermes-sweeper review.
| try: | ||
| path = resolve_config_path() | ||
| if path.exists(): | ||
| raw = json.loads(path.read_text(encoding="utf-8")) |
There was a problem hiding this comment.
defaultHost is evaluated before the active-profile lookup, so a coder profile without HERMES_HONCHO_HOST would silently use this shared host. Current main derives host keys from the active profile; please preserve that isolation unless a new documented profile-routing design is intended.
| @@ -452,7 +465,9 @@ def from_global_config( | |||
| ) | |||
|
|
|||
| base_url = ( | |||
| raw.get("baseUrl") | |||
| host_block.get("baseUrl") | |||
There was a problem hiding this comment.
Current main explicitly tests that baseUrl is root-level and must win over a host-block URL (tests/honcho_plugin/test_client.py:256-265); this precedence change would fail that contract. The setup wizard also writes its self-hosted URL at the root.
|
Addressed the review feedback in eb12310b0.
Tested with: |
|
Hi maintainers — just checking in on this PR. Is there a planned merge timeline, or is there an alternative solution being considered? We are running this patch locally and would love to get it into main so we can safely update Hermes without losing the fix. Happy to rebase or address any remaining feedback if needed. |
|
Hi maintainers, this PR has been open for a while and is currently showing as mergeable but blocked. Is there anything still needed from our side, or is a merge planned in the near future? We would love to be able to update hermes-agent without breaking our local Honcho setup. Thanks for your time! |
Fixes Honcho client initialization for setup-generated configs that store
connection details in a named host block (e.g. "local"). Previously:
- base_url was only read from flat config root, not from host_block.
- resolve_active_host() ignored defaultHost and always used the Hermes
profile key ("hermes"), so the host block lookup returned {} and the
api_key was also lost.
Fixes NousResearch#61661
eb12310 to
1409bed
Compare
|
Friendly bump after rebasing both PRs onto current Just rebased this branch and re-ran the test suite: The branch is now conflict-free and mergeable. If there is anything else blocking review/merge, please let me know and I will address it promptly. Otherwise, would appreciate a review when you have a moment. |
|
Merged via #66052 (rebase-merge) — both your commits landed on main. Note: they were authored under a local identity (pi@hermes.local), so GitHub can't link them to your profile, but the AUTHOR_MAP credits them to you. Thanks @Elektrofussel! |
Fixes Honcho client initialization for setup-generated configs that store connection details in a named host block (e.g. "local"). Previously base_url was only read from the flat config root and resolve_active_host() ignored defaultHost, causing the SDK to send an empty API key and fail to reach self-hosted Honcho instances.\n\nFixes #61661