fix(honcho): use profile_host_key in peers display (dot vs underscore host-key mismatch) - #64405
fix(honcho): use profile_host_key in peers display (dot vs underscore host-key mismatch)#64405loveruncaged wants to merge 1 commit into
Conversation
hermes honcho peers showed (not set) for the user peer and the raw host
key (e.g. hermes.kristi) for the AI peer on non-default profiles, because
_all_profile_host_configs() built the host key with a dot separator
(f"{HOST}.{p.name}") while the runtime resolver profile_host_key() uses an
underscore + sanitization (hermes_kristi). The mismatched key missed the
real config block and fell back to defaults.
Use profile_host_key() so the display matches the runtime resolution.
Cosmetic-only: workspace isolation, peer identity, and memory routing were
always correct; only the peers summary view misreported.
teknium1
left a comment
There was a problem hiding this comment.
Thanks for identifying the display/runtime key drift. The canonical-key premise is confirmed on current main: plugins/memory/honcho/cli.py:1010-1011 builds a dot-form key, while plugins/memory/honcho/client.py:36-41 resolves canonical underscore-form keys.
Problems
- The unchanged direct lookup at
plugins/memory/honcho/cli.py:1011would bypass_host_block(). That helper deliberately retains legacyhermes.<profile>compatibility inplugins/memory/honcho/client.py:44-51, and the runtime behavior is covered bytests/honcho_plugin/test_client.py:530-543. After this change,honcho peerswould misreport legacy configurations that runtime resolution still accepts.
Suggested changes
- Look up the new canonical key with
_host_block(cfg, h)rather thanhosts.get(h, {});_host_blockis already imported atplugins/memory/honcho/cli.py:14. - Add a CLI regression test covering both canonical/sanitized and legacy dot-form profile blocks.
This is an automated hermes-sweeper review.
| # with an underscore separator and sanitization (e.g. "hermes_kristi"), | ||
| # not a dot ("hermes.kristi"), so a naive f"{HOST}.{p.name}" misses | ||
| # the real block and falsely shows "(not set)" / the raw host key. | ||
| h = profile_host_key(p.name) |
There was a problem hiding this comment.
Please preserve the legacy dot-key fallback when looking up this canonical key: use _host_block(cfg, h) in the append below. Runtime config resolution intentionally supports legacy hermes.<profile> blocks via plugins/memory/honcho/client.py:44-51; direct hosts.get(h, {}) would make peers misreport those still-supported configurations.
|
Heads up: I independently landed the identical fix in #76455 before finding this PR (2.5 weeks senior — deferring to yours). One thing yours doesn't carry: regression coverage. I've written If you'd like it, the file is at |
SummaryTwo open PRs address Issue #76414 by replacing the incorrect dot-form profile host key with the canonical key resolver. #64405 makes only that lookup-key change, while #76455 also preserves legacy dot-form configuration compatibility through Related pull requests
Duplicates#64405 and #76455 implement the same canonical Suggested consolidationKeep #76455 open with its complete fix and regression suite as the recorded best fix for #76414; its current diff addresses the visible contributor keep_open review by routing lookup through Cross-PR triage: Reviewed 2 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 7 kB of PR diffs, 8 kB of issue/PR text, 6 kB of discussion (8 comments), 2 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Bug Report:
hermes honcho peersshows wrong host block for non-default profilesSummary
hermes honcho peersdisplays(not set)for the user peer and the rawhost key (e.g.
hermes.kristi) for the AI peer on any non-defaultprofile, even when that profile's
honcho.jsonblock is correctlypopulated. The runtime uses the correct block — this is a display-only
bug in the
peerscommand caused by a host-key separator mismatch.Environment
defaultandkristi, each with its own Honcho workspaceRoot cause
Two different host-key derivations exist in
plugins/memory/honcho/:client.py::profile_host_key()sanitizes and joinswith an underscore:
cli.py::_all_profile_host_configs()joined with adot:
Because the real config block is written under
hermes_kristi(underscore)by the runtime resolver, the display command's
hosts.get("hermes.kristi", {})returns an empty dict and falls back to
(not set)/ the raw host key.Reproduction
hermes profile create kristi --clonekristi memory setup→ provider honcho, peerKristi, workspacekristikristi honcho peers(orhermes honcho peers)Expected:
kristi Kristi Edna MillayActual:
kristi (not set) hermes.kristiConfirm the block is actually correct:
Fix
In
plugins/memory/honcho/cli.py::_all_profile_host_configs(), use the sameresolver the runtime uses instead of hand-building the key:
for p in profiles: if p.name == "default": continue - h = f"{HOST}.{p.name}" + # Match the runtime resolver (underscore + sanitization), not a dot, + # so the display reads the real host block instead of falling back + # to "(not set)" / the raw host key. + h = profile_host_key(p.name) results.append((p.name, h, hosts.get(h, {}))) return resultsprofile_host_keyis already imported at the top ofcli.py, so no newimport is needed.
python -m py_compilepasses.Impact
only the
peerssummary view is wrong.meant to confirm per-profile identity is the screen that misreports it.
Suggested test
Add a unit test asserting
_all_profile_host_configs()returns the blockkeyed by
profile_host_key(name)for a profile with a non-trivial name(e.g. one requiring sanitization), guarding against the dot/underscore drift.