Repository navigation
fix(desktop-services): 修复 DSH 0.2.2-rc.3 上完成、失败和授权不再提醒(关联 #327) - #328
Merged
Merged
Conversation
DSH 0.2.2-rc.3 removed AgentRegistry.roots(), so every session event threw before it reached DesktopAttention. Completions, failures and approvals never became desktop notifications, tray entries or taskbar/Dock counts; only questions, which arrive through the user-questions hook, still did. Treat a session as a conversation when it has a live agent that DSH did not start as a subagent, the header.origin check upstream uses. The test fakes now offer only methods the Runtime's AgentRegistry has, so an API that DSH removes fails the integration check instead of being masked by the fake.
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.
在 macOS 上测试 #327 时发现:main 升级到 DSH 0.2.2-rc.3(#309)以后,任务完成、任务失败和需要授权都不再提醒,只有提问还会提醒。系统通知、托盘里的待处理项和 #327 的任务栏/Dock 计数都受影响,不分平台。
原因
rc.3 的
@deepseek-ai/dsh-agent删掉了AgentRegistry.roots()。dsh-plugins/desktop-services/lib/attention.js用它判断会话是不是用户自己的会话,在 rc.3 上每个会话事件都在这里抛错,完成、失败、授权都记不进来。提问走user-questions/request钩子,不经过这里,所以还能提醒。CI 没有发现,是因为测试里假的 agents 服务自己带了roots()。改动
attention.js:用户会话改为“有存活的 agent,且不是 DSH 以子智能体身份启动的会话”,和 rc.3 上游一样看session.header.origin。rc.3 的subagent和subagent_fork都写origin: "subagent";普通 fork、侧边讨论、ACP 会话和恢复后的会话仍算用户会话,范围和原来一致。attention-host.test.mjs:假的 agents 服务只能提供当前 Runtime 的AgentRegistry上真有的方法,DSH 再删接口时这里会直接失败。补充断言:子智能体和没有存活 agent 的会话不产生待处理项,fork 出的会话产生。验证:macOS 27.0.1 arm64
attention-host.test.mjs在 rc.3 和 rc.1 的 Runtime 上都是 4 项通过。反向验证:换回旧写法,两个 Runtime 上 4 项全部失败;去掉来源判断或存活判断,各有 1 项失败;假服务加回roots,在 rc.3 上失败。用 main(
1d1174a)本机构建 0.4.13-dev.20261116.1,改成独立的 QA 应用,由合成模型在后台会话里触发。本 PR 一列是把本 PR 的attention.js换进同一个包、重新签名后的结果:本 PR 依次触发四项后,Dock 显示 4,Host 同步给桌面端的待处理项依次是 completed、failed、approval、question。
Windows 未实测;改动在 Host 插件里,不分平台。
未处理
subagents.rootOf()的运行时归属,另做。