fix(honcho): fallback to durable peer cards for profiles#17124
fix(honcho): fallback to durable peer cards for profiles#17124stephenschoettler wants to merge 1 commit into
Conversation
|
Related to #13375 — this PR is a minimal scoped subset of that broader honcho profile fallback + backfill PR. |
|
CI audit after opening #17124:
Current CI red checks appear unrelated to this PR:
Passing CI checks: |
|
Updated against current green What changed on the branch:
Focused local validation:
Current CI notes:
|
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
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
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
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
#AI commit#
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
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
|
@teknium1 quick follow-up after #24847 landed. I refreshed this branch against current This is adjacent to #24847, not the same fix. #24847 made Honcho startup fail open; this branch fixes the runtime profile lookup once Honcho is available. Focused validation is clean: The branch is mergeable again. The remaining red check is inherited from current |
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
(cherry picked from commit 5d450df256695b86477ad319148cf6c84c76f285)
83c5fec to
6a0e22c
Compare
What does this PR do?
Fixes
honcho_profile(peer="user")returning an empty profile hint when Honcho already has a durable peer card for the user.The lookup keeps the existing assistant observer-target card check first. If that is empty, it falls back to the target peer's own card. For the current user peer only, it also tries migrated default-session cards stored as
user-default-<peer>.Related to #13375. This PR keeps the scope to the minimal peer-card fallback path and does not include the broader memory-file backfill work from #13375.
Related Issue
No linked GitHub issue.
Related PR: #13375
Type of Change
Changes Made
plugins/memory/honcho/session.pyuser-default-<peer>cards.tests/honcho_plugin/test_session.pyHow to Test
Run the focused regression tests:
python -m pytest \ tests/honcho_plugin/test_session.py::TestPeerLookupHelpers::test_get_peer_card_uses_direct_peer_lookup \ tests/honcho_plugin/test_session.py::TestPeerLookupHelpers::test_get_peer_card_falls_back_to_target_peer_own_card \ tests/honcho_plugin/test_session.py::TestPeerLookupHelpers::test_get_peer_card_falls_back_to_legacy_default_user_peer_id \ -q -o 'addopts='Run the session test module:
python -m pytest tests/honcho_plugin/test_session.py -q -o 'addopts='Run the Honcho plugin suite:
python -m pytest tests/honcho_plugin -q -o 'addopts='Optional live check with local Honcho:
Validation Status
python -m pytest tests/honcho_plugin/test_session.py -q -o 'addopts=': 117 passed.python -m pytest tests/honcho_plugin -q -o 'addopts=': 268 passed.honcho_profile(peer="user")with an anonymized local test user.test,nix (ubuntu-latest),nix-lockfile-check.nix (macos-latest).pytest tests/ -q/ GitHub checks are not green.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation and Housekeeping
docs/, docstrings) or N/Acli-config.yaml.exampleif I added/changed config keys or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows or N/AFor New Skills
N/A. This PR does not add a skill.
Screenshots / Logs
Live harness result from the original validation: