Skip to content

feat: add session.identityLinks for cross-platform DM session linking#1033

Merged
thewilloftheshadow merged 2 commits into
openclaw:mainfrom
rubyrunsstuff:shadow/identity-links
Jan 16, 2026
Merged

feat: add session.identityLinks for cross-platform DM session linking#1033
thewilloftheshadow merged 2 commits into
openclaw:mainfrom
rubyrunsstuff:shadow/identity-links

Conversation

@rubyrunsstuff

Copy link
Copy Markdown
Contributor

Summary

Allows mapping multiple platform IDs to a canonical identity so the same person on different platforms (Telegram, Discord, iMessage, etc.) shares a single DM session when using per-peer or per-channel-peer dmScope.

Config Example

{
  "session": {
    "dmScope": "per-peer",
    "identityLinks": {
      "alice": ["telegram:123456789", "discord:987654321012345678", "imessage:+15551234567"]
    }
  }
}

With this config, messages from any of those platform IDs route to the same session (agent:main:dm:alice) instead of separate sessions per platform.

Changes

  • Add identityLinks to session config schema and types
  • Add resolveLinkedPeerId() helper in session-key.ts
  • Wire identityLinks through resolve-route.ts
  • Add tests for both per-peer and per-channel-peer modes

How it works

  1. When building a DM session key, check if the channel:peerId (e.g. telegram:123456789) matches any entry in identityLinks
  2. If matched, use the canonical name (e.g. alice) as the peerId instead
  3. Unlinked IDs continue to work as before (separate sessions)

Implemented by Codex, cleaned up by Ruby 🐱

rubyrunsstuff and others added 2 commits January 16, 2026 12:27
Allows mapping multiple platform IDs to a canonical identity so the same
person on different platforms (Telegram, Discord, iMessage, etc.) shares
a single DM session when using per-peer or per-channel-peer dmScope.

Config example:
  session.identityLinks = {
    alice: ["telegram:123456", "discord:789012345678901234"]
  }

- Add identityLinks to session config schema and types
- Add resolveLinkedPeerId() to session-key.ts
- Wire through resolve-route.ts
- Add tests for both per-peer and per-channel-peer modes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants