feat(routing): add per-account-channel-peer session scope#3095
Merged
obviyus merged 2 commits intoJan 28, 2026
Conversation
Adds a new dmScope option that includes accountId in session keys, enabling isolated sessions per channel account for multi-bot setups. - Add 'per-account-channel-peer' to DmScope type - Update session key generation to include accountId - Pass accountId through routing chain - Add tests for new routing behavior (13/13 passing) Closes openclaw#3094 Co-authored-by: Sebastian Almeida <[email protected]>
obviyus
force-pushed
the
feat/per-account-channel-peer-scope
branch
from
January 28, 2026 06:12
08ff474 to
914b0c1
Compare
Contributor
|
Correction: SHAs below (previous comment had literal vars). Thanks @jarvis-sam! |
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Jan 31, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Jan 31, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Jan 31, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Jan 31, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Jan 31, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Jan 31, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Jan 31, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Jan 31, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Jan 31, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Feb 1, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Feb 1, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Feb 1, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Feb 1, 2026
YuriNachos
pushed a commit
to YuriNachos/clawdbot-fork
that referenced
this pull request
Feb 1, 2026
bestNiu
pushed a commit
to bestNiu/clawdbot
that referenced
this pull request
Feb 5, 2026
Closed
3 tasks
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
ogt-redknie
pushed a commit
to ogt-redknie/OPENX
that referenced
this pull request
May 2, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 9, 2026
7 tasks
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.
Summary
Adds a new
dmScopeoption:per-account-channel-peerthat includes theaccountIdin session keys, enabling isolated sessions per channel account.Problem
When running multiple Telegram bots (or other channel accounts) pointing to the same agent, all DMs from the same user merge into a single session. This breaks:
Solution
New session key format that includes accountId:
agent:main:telegram:dm:123456agent:main:telegram:tasks:dm:123456Configuration
{ "session": { "dmScope": "per-account-channel-peer" } }Changes
src/config/types.base.ts— Add new scope to DmScope typesrc/config/zod-schema.session.ts— Add to zod schemasrc/routing/session-key.ts— Include accountId in key generationsrc/routing/resolve-route.ts— Pass accountId through routingsrc/infra/outbound/outbound-session.ts— Extract accountId from delivery contextsrc/routing/resolve-route.test.ts— Add tests (13/13 passing)Testing
npm test -- src/routing/resolve-route.test.tsAll 13 tests pass, including 2 new tests for per-account-channel-peer routing.
Closes #3094