feat(honcho): add per-platform peer identity routing#15598
Draft
KawaroX wants to merge 1 commit into
Draft
Conversation
7 tasks
This was referenced May 26, 2026
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?
Adds per-platform Honcho user-peer identity routing for gateway contexts.
This is related to #15162 and the Honcho consolidation PR #15381. Those changes add
pinPeerName, which is a good opt-in fix for the common personal deployment case where every gateway should resolve to the configuredpeerName.This PR covers the next step: mixed routing. A personal Hermes deployment may want Telegram and WhatsApp to share one Honcho peer, while keeping WeChat or Discord scoped to the platform-native
user_id.Fix
Adds two config fields:
peerIdentityStrategy: global default strategy, preserving existingruntimebehavior by default.peerIdentities: per-platform override map.Supported rule values:
runtime: use gatewayuser_id, falling back topeerName.configured: usepeerName, falling back to gatewayuser_id.Example:
{ "peerName": "kawarox", "peerIdentityStrategy": "configured", "peerIdentities": { "telegram": "configured", "whatsapp": "configured", "weixin": "runtime", "matrix": "matrix-custom-peer" } }In that setup:
peerName(kawarox)peerName(kawarox)user_idmatrix-custom-peerThe resolved peer is passed into
HonchoSessionManager, so Honcho writes, context injection, dialectic calls, and conclusion/profile operations use the same user peer.Files changed
plugins/memory/honcho/client.pypeer_identity_strategyandpeer_identitiestoHonchoClientConfig.resolve_runtime_peer_name()to resolve global and per-platform rules.peerIdentityStrategyandpeerIdentitiesfrom root or host config.plugins/memory/honcho/__init__.pyHonchoSessionManager.plugins/memory/honcho/README.mdtests/agent/test_memory_user_id.pyRelationship to
pinPeerNameIf maintainers prefer to keep
pinPeerNameas the public API for the all-platform case, this PR can be adjusted to layer per-platform routing on top of it instead of introducing a separate global strategy name:pinPeerName: trueremains the simple global "configured peer wins" mode.peerIdentitiesonly handles per-platform overrides for mixed gateway deployments.I left the branch as a draft because #15162/#15381 may land first, and this PR may need a small rebase or API naming adjustment afterward.
Related issues / PRs
Type of Change
Test plan
venv/bin/python -m pytest tests/agent/test_memory_user_id.py -qResult:
16 passed.Not in scope