Skip to content

feat(honcho): support per-LID peer routing#21539

Closed
mrlufepines wants to merge 1 commit into
NousResearch:mainfrom
mrlufepines:feat/honcho-peer-by-lid
Closed

feat(honcho): support per-LID peer routing#21539
mrlufepines wants to merge 1 commit into
NousResearch:mainfrom
mrlufepines:feat/honcho-peer-by-lid

Conversation

@mrlufepines

@mrlufepines mrlufepines commented May 7, 2026

Copy link
Copy Markdown

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 peerByLid support:

  1. plugins/memory/honcho/client.py: add a peer_by_lid config field loaded from honcho.json.
  2. plugins/memory/honcho/session.py: resolve a known LID from the session key before falling back to existing peer resolution.
  3. plugins/memory/honcho/__init__.py: when user_id contains 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.py
  • plugins/memory/honcho/session.py
  • plugins/memory/honcho/__init__.py

Verification

  • Syntax checked with python3 -m py_compile on the three touched files.
  • Suggested follow-up: add unit tests for two configured LIDs and the empty-config fallback.

@alt-glitch alt-glitch added type/feature New feature or request comp/plugins Plugin system and bundled plugins platform/whatsapp WhatsApp Business adapter P3 Low — cosmetic, nice to have labels May 7, 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.
@mrlufepines mrlufepines force-pushed the feat/honcho-peer-by-lid branch from ab015a8 to ce3f4c8 Compare May 30, 2026 15:34
@mrlufepines mrlufepines changed the title feat(honcho): per-sender peer routing via WhatsApp LID feat(honcho): support per-LID peer routing May 30, 2026
@mrlufepines mrlufepines deleted the feat/honcho-peer-by-lid branch May 30, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/whatsapp WhatsApp Business adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants