Repository navigation
fix(sessions-send): normalize sourceSessionKey to dmScope-resolved canonical key - #107469
ChengKe771 wants to merge 1 commit into
Conversation
|
@clawsweeper re-review,pls |
|
Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 7:34 AM ET / 11:34 UTC. Summary PR surface: Source +26. Total +26 across 1 file. Reproducibility: no. live current-main reproduction was established during this review, but the source path and linked production report provide a high-confidence source reproduction: stale DM provenance directs replies to a different persisted session key. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Use a shared structural session-route classifier that recognizes every supported legacy DM key shape, canonicalize only those routes under Do we have a high-confidence way to reproduce the issue? No live current-main reproduction was established during this review, but the source path and linked production report provide a high-confidence source reproduction: stale DM provenance directs replies to a different persisted session key. Is this the best way to solve the issue? No. Canonicalizing legacy DM requesters at the Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f7a665aaa14d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +26. Total +26 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (2 earlier review cycles)
|
…esolved canonical key Parse the requester key and only canonicalize when the rest contains a "direct" peer-kind segment (legacy per-peer / per-channel-peer / per-account-channel-peer DM keys). Group, cron, hook, subagent, and other non-DM callers preserve their exact session key for correct routing, watch registration, and A2A ping-pong bookkeeping. Fixes openclaw#107399
a0c14ad to
83f0190
Compare
|
@clawsweeper re-review,pls |
|
Thank you, @ChengKe771, for identifying and working on this fix. The issue is now resolved by #115756, merged as 81171d0. Your contribution is credited in the landed commit with a |
What Problem This Solves
When
session.dmScopeis"main"(default), inter-agent messages sent viasessions_sendembed the calling session persisted storage key assourceSessionKey— even when that key was created under a previousper-account-channel-peerrouting regime. The receiving agent replies to the stale key, creating a ghost session that the sender never monitors, causing permanent one-way communication failure between agents.Split path:
buildAgentPeerSessionKey()withdmScope="main"→ lands inagent:{id}:main✓sourceSessionKeyfrom provenance → lands inagent:{id}:{channel}:{account}:direct:{peer}(stale format) ✗Two different session keys → two different sessions → the agent in session A never sees replies delivered to session B.
Why This Change Was Made
The
sessions_sendtool passedopts.agentSessionKeyverbatim intoinputProvenance.sourceSessionKey. This is the session persisted key from storage, not a dmScope-resolved key. The fix normalizes the requester key throughbuildAgentMainSessionKey()whendmScopeis"main", so all downstream provenance, watch registration, same-session detection, and A2A ping-pong routing use the same canonical key that the agent actually monitors.User Impact
Multi-agent setups using
dmScope="main"(the default) with sessions that predate a routing regime change will now correctly route inter-agent replies back to the sender monitored session. No config changes required. Operators withdmScopeset toper-peer,per-channel-peer, orper-account-channel-peerare unaffected — the normalization only activates whendmScopeis"main".Evidence
sessions-send-helpers.test.ts: 10/10 passedsessions-send-tool.a2a.test.ts: 25/25 passedFixes #107399