Repository navigation
fix: scope automatic task notifications to the current session - #554
Merged
Merged
Conversation
x-lixu
approved these changes
Oct 15, 2026
x-lixu
left a comment
Collaborator
There was a problem hiding this comment.
复核通过,感谢修复及回归测试。默认领取范围限定当前 owner/session,保留原会话重连恢复和显式跨会话 opt-in 的 owner 校验;不取消旧任务或删除结果。相关测试本地复跑通过,最新跨平台 CI 和 release-check 全部通过。后台协调 Session 生命周期一致性另行排查,不扩大本 PR 范围。
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.
变更说明
同一 owner 的会话 A 结束后,异步任务完成留下的 pending 通知,会在会话 B 就绪时被自动领取,并把 A 的结果注入 B 的模型播报输入。已用 v2.0.1 的真实 session runtime + 模拟模型边界复现;最新 main 仍有相同默认行为。
将
SessionTaskCoordinator.claimPendingNotifications()的includeOtherSessions默认值设为false,使连接、唤醒和恢复路径默认只领取当前 owner/session 的通知。同一 session 重连仍可恢复待播报结果;可信宿主确认接收人一致后,仍可在代码中显式 opt in 跨 session 领取,owner 校验保持生效。回归覆盖任务在 A 关闭后完成、已领取但未确认播放时关闭、B 不领取且原 A 可恢复、显式 task ID 不绕过 session 限制,以及显式跨 session opt-in 不跨 owner。同步更新中英文协议文档与 Changelog。
Refs #549。该 PR 处理已确认的跨 session 自动领取问题;补充评论中的同会话投递停滞仍需实际事件序列定位,故不自动关闭 issue。
验证
node --test server/test/session-task-coordinator.test.mjs server/test/realtime-session-runtime.test.mjs server/test/announcement-window.test.mjs server/test/task-notification-queue.test.mjs server/test/task-manager.test.mjs— 72/72 通过。npm run lintnpm run buildnpm run audit:release(在release:check中通过)git diff --checknpm test/npm run release:check:本机完整检查未全绿。沙箱外 root suite 为 267 通过、2 跳过、1 失败,失败是复用的本机 Electron 43.6.0 与最新 lockfile 43.7.9 不匹配。openclaw-delegation.test.mjs单独诊断也以 exit 137 终止,未得到断言结果,终止原因未确定。兼容性与安全
兼容性变化:新建 session 不再自动接收旧 session 的结果;恢复原 session 的结果投递保留。不改变任务执行、结果保存、通知确认或网络入口。回滚此提交会恢复旧的跨 session 默认领取行为,同时恢复本 issue 的风险。