fix(agent): preserve explicit recipient sessions#101507
Conversation
Co-authored-by: vincentkoc <[email protected]> Co-authored-by: pingfanfan <[email protected]>
Co-authored-by: vincentkoc <[email protected]> Co-authored-by: pingfanfan <[email protected]>
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(agent): preserve explicit recipient sessions This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Land-ready proof for exact head
Before: explicit Known proof gap: no authenticated live Chatwoot/Instagram bridge was available. Coverage instead exercises the shared Gateway/embedded entry points, outbound routing, cancellation/idempotency, SecretRef scoping, and bundled provider route contracts, with exact-head hosted CI green. |
|
Merged via squash.
|
* fix(agent): honor recipient session routing Co-authored-by: vincentkoc <[email protected]> Co-authored-by: pingfanfan <[email protected]> * fix(agent): preserve canonical recipient routes * fix(agent): require exact recipient routes Co-authored-by: vincentkoc <[email protected]> Co-authored-by: pingfanfan <[email protected]> * fix(agent): harden recipient route resolution * fix(imessage): require canonical recipient handles * fix(agent): refine provider recipient exactness * fix(agent): bound direct alias session routing * fix(signal): preserve direct alias route type * fix(agent): honor binding-scoped recipient sessions * fix(routing): honor configured main session aliases * fix(clickclack): align account-owned session routes * fix(twitch): preserve canonical recipient sessions * fix(routing): isolate stable outbound identities * chore: defer recipient session changelog * fix(sms): use dedicated channel SDK facade --------- Co-authored-by: vincentkoc <[email protected]> Co-authored-by: pingfanfan <[email protected]>
* fix(agent): honor recipient session routing Co-authored-by: vincentkoc <[email protected]> Co-authored-by: pingfanfan <[email protected]> * fix(agent): preserve canonical recipient routes * fix(agent): require exact recipient routes Co-authored-by: vincentkoc <[email protected]> Co-authored-by: pingfanfan <[email protected]> * fix(agent): harden recipient route resolution * fix(imessage): require canonical recipient handles * fix(agent): refine provider recipient exactness * fix(agent): bound direct alias session routing * fix(signal): preserve direct alias route type * fix(agent): honor binding-scoped recipient sessions * fix(routing): honor configured main session aliases * fix(clickclack): align account-owned session routes * fix(twitch): preserve canonical recipient sessions * fix(routing): isolate stable outbound identities * chore: defer recipient session changelog * fix(sms): use dedicated channel SDK facade --------- Co-authored-by: vincentkoc <[email protected]> Co-authored-by: pingfanfan <[email protected]>
What Problem This Solves
Fixes #41483.
openclaw agent --agent ... --channel ... --to ...currently selects the agent main session before the explicit recipient can participate in routing, so configured DM isolation is ignored.This is a maintainer replay of #73403 and the earlier focused #41557 because the current PR branch cannot be updated by maintainers.
Why This Change Was Made
session.dmScope, binding-level scope,identityLinks, configuredmainKey, provider-native target forms, and account identity; do not hard-code a new scope or break the shippedmaindefault.--session-keyand--session-idprecedence.Canonical recipient keys use the same session-key format already used for inbound routing. Direct aliases are accepted only when configuration deliberately shares the selected main session and no binding can isolate peers. Stable outbound-only identities must be provider-namespaced and isolated from the agent main session; Synology Chat uses that form because Chat API recipient IDs and incoming-webhook sender IDs are separate namespaces.
User Impact
Configured shared-inbox isolation now applies consistently to Gateway-backed and embedded
openclaw agentruns. Existing installations usingsession.dmScope: "main"keep main-session continuity where the provider can prove the direct-chat contract; isolated scopes produce canonical provider-owned keys. Public-channel aliases and ambiguous recipient identities no longer select a potentially unrelated session.Evidence
d385eb76355: Blacksmith Testbox passed 889 assertions across all 32 changed test files in 21 Vitest shards; the final commits only remove the release-owned changelog line and move the SMS helper import onto the current dedicated SDK facade.oxfmt --checkand fresh local-patch Codex autoreview are clean.pnpm check:changedgreen, including core/core-test/extension typechecks, changed-file lint, docs/changelog, import-cycle, storage, runtime, and repository guards.Co-authored-by: vincentkoc [email protected]
Co-authored-by: pingfanfan [email protected]