fix(honcho): align peer-card read and write paths#27979
Closed
cyb0rgk1tty wants to merge 1 commit into
Closed
Conversation
honcho_profile(peer="user") returned an empty card even when Honcho
held a populated peer card for the user. Two independent bugs combined
to produce the symptom:
1. Read path: get_peer_card() called _fetch_peer_card(observer, target=user),
which hits GET /peers/{observer}/card?target={user} — the observer's local
card of the user. On self-hosted Honcho v3 this slot is empty unless writes
also use it. The peer card lives on the user peer itself
(GET /peers/{user}/card). Add a fallback: when the observer-target slot is
empty and a target exists, retry against the target peer's own card.
2. Write path: set_peer_card() resolved only the target peer and called
user_peer.set_card(card). The read path uses the assistant peer as
observer, so writes and reads addressed different Honcho card scopes.
Align set_peer_card() with _resolve_observer_target() so writes go to
assistant_peer.set_card(card, target=user_peer_id), matching the read.
Both paths now use the same observer/target resolution, and the read
path additionally falls back to the target's own card for compatibility
with deployments where cards were written directly to the peer.
Closes: related to NousResearch#13375, NousResearch#17124, NousResearch#20729
Collaborator
|
Duplicate of #17186 (and #20729, #23022). All fix the same Honcho peer-card read/write path misalignment — |
This was referenced May 26, 2026
Contributor
|
Thanks for the bug fix — this has already landed on current Automated hermes-sweeper review evidence:
This matches the duplicate note from @alt-glitch that the PR covered the same Honcho peer-card read/write path misalignment. |
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?
Fixes
honcho_profile(peer="user")returning an empty card even when Honcho has a populated peer card for the user. Two independent bugs combined to produce the symptom:Bug 1 — Read path (related to #17124):
get_peer_card()calls_fetch_peer_card(observer, target=user), which hitsGET /peers/{observer}/card?target={user}— the observer's local card of the user. On self-hosted Honcho v3 this slot is empty unless writes also use it; the peer card lives on the user peer itself (GET /peers/{user}/card).Fix: when the observer-target slot returns empty and a target exists, fall back to
_fetch_peer_card(target)— the target peer's own card.Bug 2 — Write path (related to #20729):
set_peer_card()resolved only the target peer and calleduser_peer.set_card(card). The read path uses the assistant peer as observer, so writes and reads addressed different Honcho card scopes.honcho_profile(card=[...])reported success while a subsequenthoncho_profile()still returned empty.Fix: align
set_peer_card()with_resolve_observer_target()so it writes toassistant_peer.set_card(card, target=user_peer_id), matching the read side.Both fixes together ensure reads and writes use the same scope, and the read-side fallback handles existing deployments where cards were written directly to the peer.
Related issues / PRs
Type of change
Changes made
plugins/memory/honcho/session.pyget_peer_card: add fallback to target peer's own card when observer-target slot is emptyset_peer_card: use_resolve_observer_targetso write scope matches read scopetests/honcho_plugin/test_session.pytest_get_peer_card_falls_back_to_target_peer_own_card: regression test for the read fallbacktest_set_peer_card_uses_observer_target_in_ai_observe_others_mode: regression test for write alignmentValidation
Checklist
pytest tests/honcho_pluginand all tests passruff checkand all checks pass