hermes-agent/tests/honcho_plugin
David Doan 1800a1c796 fix(honcho): align peer-card read and write paths
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 #13375, #17124, #20729
2026-05-27 10:49:33 -07:00
..
__init__.py
test_async_memory.py
test_cli.py fix(honcho): cover pinUserPeer + aiPeer edge cases in setup, clone, and gateway cache 2026-05-27 10:49:33 -07:00
test_client.py fix(tests): exercise profile-mode HERMES_HOME for honcho fallback 2026-05-13 22:53:01 -07:00
test_empty_profile_hint.py
test_pin_peer_name.py fix(honcho): cover pinUserPeer + aiPeer edge cases in setup, clone, and gateway cache 2026-05-27 10:49:33 -07:00
test_session.py fix(honcho): align peer-card read and write paths 2026-05-27 10:49:33 -07:00