Repository navigation
fix(host): Host 客户端模式下默认表单新建自动化不再被桌面通知拒绝 - #15923
Conversation
- 🐛 the Desktop automation form has no desktop-notification control and always sends `notify.desktop: true`, which the Host scheduler refused, so default automations failed to save in Host client mode; store only the routes this Host can deliver, as project rows already do Signed-off-by: Kros Dai <xdanger@gmail.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a24865-af3b-71ae-97df-f814b2481f3b
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Confidence Score: 5/5
[Medium impact] 本次修改看起来可以安全合并,未发现需要修复的问题。
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the Host automation creation fix.
No open issues 🎉
What changed in this PR
修复 Host 客户端模式下,桌面表单默认开启桌面通知导致普通自动化无法创建的问题,延续自动化由 Host 调度器处理的设计。
Changes:
- 本机创建非项目计划时,将桌面通知关闭,保留其他字段;远程链路及更新、恢复行为不变。
- 新增真实调度器与 SQLite 回归用例,验证默认表单载荷可成功保存。
| File | Description |
|---|---|
| apps/host/src/ipc-bindings/batch5a-scheduler.test.mjs | 验证默认表单创建成功、桌面通知关闭且写入一条计划。 |
| apps/host/src/agent/scheduler.ts | 在 Host 本机创建通道中按设备能力关闭桌面通知。 |
Review effort: Balanced
Findings无 P0/P1。逐项核验要点(均通过):
已知但不构成阻断的范围边界(PR 已明确声明): Rule coverage
Verification
Intent alignment原目标(PR 标题/正文):修复 Host 客户端模式下用桌面端表单默认值新建普通自动化被桌面通知校验直接拒绝、什么都不保存的缺陷。初始实现与最终 diff 为同一单提交(c255acd),无后续改写。逐项复核:① 仅本机窗口 Overallpass(没有 P0/P1)。改动面窄、收敛点选在能力持有方(Host)且与既有项目计划/MCP 缺省值处理口径一致,回归测试经生产通道覆盖真实保存行为,远程链路保持原拒绝语义,PR 对遗留的 update 路径边界作了如实披露。 |
这次改了什么
摘要
#15872 把桌面窗口的自动化读写接到 Host 调度器后,Host 客户端模式下用桌面端表单的默认值新建普通自动化会直接失败、什么都不保存:
useScheduleForm把notifyDesktop初始化为true,buildScheduleInput总会发出notify.desktop: true,表单里也没有桌面通知的开关;而 Host 的scheduleUnavailableMessage()对非项目计划拒绝notify.desktop(supportsScheduleDesktopNotification = false),Scheduler.create()在写入前就返回INVALID_PARAMS。现在 Host 本机窗口的创建通道(
localOperationsFor的maker:schedule:create)对请求桌面通知的非项目计划,按 Host 实际能送达的方式保存(桌面通知记为关闭),其他字段原样传递。这与 #14006 处理伙伴项目计划的做法一致(project-automation-loader.ts只保存设备能送达的通知路由),也与 MCP 创建路径对缺省值的处理一致。远程设备链路仍拒绝显式请求桌面通知,行为不变。选 Host 侧而不是让渲染层感知能力:表单里这个值不是用户可见的选择,改在保存时收敛不会覆盖用户的明确决定;渲染层方案需要新增一条把 Host 能力下发给桌面窗口的通道,目前不存在。
变更类型
fix缺陷修复范围
xdanger/cindy同步主干(chore(nara): sync upstream/main (b0ff6ed86d) xdanger/cindy#206)时 codex review 扫出的 P1,与 GitHub Codex 审阅结论一致apps/host/src/agent/scheduler.ts本机窗口创建通道;一条回归用例update/resume。旧版本机 Desktop 以desktop: true保存的计划在 Host 客户端模式下编辑仍会被拒,改写会静默去掉本机 Desktop 能送达的通知,留作后续单独讨论UI 变化
怎么验证的
自动验证
测试价值:
batch5a-scheduler.test.mjs新增maker-schedule: production local create saves the Desktop form default this Host can run。生产入口为createHostScheduler(...).localWriteOperations['maker:schedule:create'],背后是真实调度器与 SQLite;输入为表单真实生成的载荷(notify: { desktop: true, feishu: false, wecomGroup: false }),断言保存成功且notify.desktop === false、写入一行。单文件约 3s。手工验证
不涉及(以生产通道 + 真实 SQLite 的确定性用例覆盖)。
未执行的验证
风险
风险分类
影响与回滚
maker:schedule:create;不涉及 wire 协议、SQLite schema 或迁移。提交前检查
git commit -s,见 DCO)apps/docs或说明自动同步会从哪些来源更新。(无入口变化)