feat(honcho): support per-LID peer routing#21539
Closed
mrlufepines wants to merge 1 commit into
Closed
Conversation
This was referenced May 26, 2026
Add optional peerByLid configuration so multi-user WhatsApp deployments can map sender LIDs to stable Honcho peer names. The session manager resolves known LIDs before falling back to runtime_user_peer_name and peer_name. Initialization also rewrites the gateway user_id when a known LID is present so the existing runtime peer plumbing sees the resolved peer.
ab015a8 to
ce3f4c8
Compare
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.
Add per-LID peer routing for Honcho memory
Problem
In multi-user WhatsApp deployments, one gateway account can receive messages from multiple senders. The Honcho memory plugin currently resolves identity from a default peer or gateway runtime identity, which is not enough when a deployment needs to map sender LIDs to stable Honcho peer names.
Fix
Add optional
peerByLidsupport:plugins/memory/honcho/client.py: add apeer_by_lidconfig field loaded fromhoncho.json.plugins/memory/honcho/session.py: resolve a known LID from the session key before falling back to existing peer resolution.plugins/memory/honcho/__init__.py: whenuser_idcontains a known LID, rewrite it to the configured peer name before session manager initialization.Example configuration:
{ "hosts": { "your-host": { "peerByLid": { "1234567890": "alice", "9876543210": "bob" } } } }The change is opt-in. Without
peerByLid, the existing fallback behavior is unchanged.Files touched
plugins/memory/honcho/client.pyplugins/memory/honcho/session.pyplugins/memory/honcho/__init__.pyVerification
python3 -m py_compileon the three touched files.