fix(session): clear per-channel origin fields on provider change (fixes #95325)#95329
fix(session): clear per-channel origin fields on provider change (fixes #95325)#95329liuhao1024 wants to merge 2 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the useful session-origin fix is covered by #95332, which handles provider or surface switches and has accepted proof, while this branch is narrower and still lacks real behavior proof. Canonical path: Close this duplicate branch and continue review on the canonical sibling that clears channel-keyed fields on provider or surface changes, then land only one fix for the linked session-origin bug. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this duplicate branch and continue review on the canonical sibling that clears channel-keyed fields on provider or surface changes, then land only one fix for the linked session-origin bug. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current Is this the best way to solve the issue? No, not as submitted. Security review: Security review cleared: The diff only changes session metadata merge logic and tests; no dependency, workflow, secret, package, lockfile, or code-execution surface concern was found. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 7cda58c10993. |
d06673f to
0b007fc
Compare
0b007fc to
084c228
Compare
084c228 to
af47894
Compare
When the message provider changes (e.g. Slack → Telegram DM), the mergeOrigin function now clears platform-specific identity fields (nativeChannelId, nativeDirectUserId, threadId, accountId) before applying new values. Previously, stale cross-channel IDs persisted because mergeOrigin only overwrites fields when the new inbound supplies them — and Telegram DMs don't supply nativeChannelId. Cross-platform fields (label, from, to, surface, chatType) are preserved across provider transitions. Fixes openclaw#95325
af47894 to
a9a113a
Compare
|
Closing as superseded per ClawSweeper evaluation — the fix is already covered by #95332. |
|
Thanks for the submission. We merged #95328, which supersedes this PR. |
What Problem This Solves
When
session.dmScope: "main"is configured and a user messages the same agent across different channels (e.g. Slack DM then Telegram DM), the session'sorigin.nativeChannelIdretains the previous channel's ID becausemergeOriginonly overwrites fields when the new inbound explicitly supplies them. Telegram DMs don't supplynativeChannelId, so the stale Slack channel ID persists indefinitely until the user messages on the original channel again.This affects any cross-channel session metadata —
nativeChannelId,nativeDirectUserId,threadId, andaccountIdcan all go stale.Fix
In
mergeOrigin(src/config/sessions/metadata.ts), when the provider changes, clear per-channel identity fields before applying new values. Cross-platform fields (label,from,to,surface,chatType) are preserved.Real behavior proof
Observed result after fix: mergeOrigin now clears nativeChannelId, nativeDirectUserId, threadId, and accountId when the provider changes. Cross-platform fields are preserved. All 363 session tests pass.
What was not tested: Live cross-channel message delivery (requires multi-platform setup). The fix is verified through source-level inspection and unit tests covering the merge logic.
AI-assisted (Hermes Agent)