Skip to content

feat(honcho): add per-platform peer identity routing#15598

Draft
KawaroX wants to merge 1 commit into
NousResearch:mainfrom
KawaroX:codex/honcho-peer-identity-resolution-pr
Draft

feat(honcho): add per-platform peer identity routing#15598
KawaroX wants to merge 1 commit into
NousResearch:mainfrom
KawaroX:codex/honcho-peer-identity-resolution-pr

Conversation

@KawaroX

@KawaroX KawaroX commented Apr 25, 2026

Copy link
Copy Markdown

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 configured peerName.

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 existing runtime behavior by default.
  • peerIdentities: per-platform override map.

Supported rule values:

  • runtime: use gateway user_id, falling back to peerName.
  • configured: use peerName, falling back to gateway user_id.
  • any other string: use that string as a custom Honcho peer name for the platform.

Example:

{
  "peerName": "kawarox",
  "peerIdentityStrategy": "configured",
  "peerIdentities": {
    "telegram": "configured",
    "whatsapp": "configured",
    "weixin": "runtime",
    "matrix": "matrix-custom-peer"
  }
}

In that setup:

platform chosen Honcho user peer
Telegram peerName (kawarox)
WhatsApp peerName (kawarox)
WeChat gateway user_id
Matrix matrix-custom-peer

The 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.py
    • Adds peer_identity_strategy and peer_identities to HonchoClientConfig.
    • Adds resolve_runtime_peer_name() to resolve global and per-platform rules.
    • Parses peerIdentityStrategy and peerIdentities from root or host config.
  • plugins/memory/honcho/__init__.py
    • Resolves the runtime Honcho user peer before creating HonchoSessionManager.
  • plugins/memory/honcho/README.md
    • Documents the new config keys and examples.
  • tests/agent/test_memory_user_id.py
    • Adds coverage for default runtime behavior, configured-peer routing, and per-platform custom routing.

Relationship to pinPeerName

If maintainers prefer to keep pinPeerName as 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: true remains the simple global "configured peer wins" mode.
  • peerIdentities only 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

  • Feature (non-breaking opt-in configuration)
  • Tests (adding or improving test coverage)
  • Documentation

Test plan

  • venv/bin/python -m pytest tests/agent/test_memory_user_id.py -q

Result: 16 passed.

Not in scope

  • Migrating existing conclusions/messages between Honcho peers.
  • Removing old runtime peers from existing Honcho sessions.
  • Changing the default multi-user gateway behavior.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers labels Apr 25, 2026
@KawaroX KawaroX changed the title [codex] add configurable Honcho peer identity resolution feat(honcho): add per-platform peer identity routing Apr 25, 2026
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 tool/memory Memory tool and memory providers type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants