fix(desktop): 自动任务失败红点可处理,系统中止不再粘红 - #3291
Conversation
|
| Filename | Overview |
|---|---|
| packages/maker-scheduler/src/engine/scheduler.ts | 在自动和手动运行的取消收尾路径中为 aborted 结果写入 readAt,并补充对应生命周期测试。 |
| apps/desktop/src/renderer/features/scheduler/lib/runUnread.ts | 统一定义运行未读及失败未读判定,使 aborted 不再进入未读集合。 |
| apps/desktop/src/renderer/features/cc-agent/hooks/useAutomationScheduleSessionIndex.ts | 扩展自动任务会话索引,向侧栏和会话视图提供失败未读运行及最新失败运行信息。 |
| apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx | 将未读失败运行横幅接入既有错误和中断处理界面,并支持仅处理当前失败运行。 |
| apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsx | 接入自动任务组级“标为已读”操作,并协调运行未读与会话告警状态。 |
| apps/desktop/src/renderer/features/cc-agent/sidebar/AutomationSessionGroupItem.tsx | 增加组头更多菜单和右键入口,并在折叠红点状态下选择对应运行。 |
| apps/desktop/src/main/scheduler-host/storage.ts | 在侧栏轻量运行索引中补充 firedAt,以支持稳定的失败运行排序与选择。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[自动任务运行结束] --> B{运行状态}
B -->|success| C[打开后自动标为已读]
B -->|failed / interrupted| D[侧栏红点与会话横幅]
D --> E[用户显式标为已读]
B -->|aborted| F[生而已读,不显示红点]
C --> G[刷新侧栏索引]
E --> G
F --> G
Reviews (5): Last reviewed commit: "fix(desktop): 会话横幅只清当前失败 run,并等待标记结果" | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8b3ec5305
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3a8eff14c9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@dashhuang 👋 这个 PR 还有 1 条 review conversation 没 resolve(apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
3a8eff1 to
5b870ab
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b870abd72
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@dashhuang 👋 这个 PR 还有 2 条 review conversation 没 resolve(apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
5b870ab to
9631a03
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9631a03c3f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@dashhuang 👋 这个 PR 还有 2 条 review conversation 没 resolve(apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
|
命中 UI 路径(apps/desktop/src/renderer/components/chat/InterruptedTurnBanner.tsx / apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx / apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsx 等)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范 |
把「标为已读」放到自动任务组头菜单;失败/中断打开后出横幅; 暂停、删除或切账号造成的 aborted 生而已读,不再留下消不掉的红点。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Automation 不带「任务」;这条横幅说的是 schedule run,按命名规则用有前缀的「定时任务」。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
markScheduleRunsReadAndSync 用 allSettled 吞掉单条 IPC 失败后, 原先仍按请求数提示已读。现在返回 processed/failed,只对成功条数 toast。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
继续/忽略中断或错误横幅时一并 mark 该会话的未读失败 run,避免再弹出第二条横幅。 会话视图改为订阅侧栏已发布的索引,不再各自拉全量 listSidebarIndexRuns。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
持久 session 上可能叠了多条未读失败。横幅和中断处置只 mark 最近一次; 标记失败时不隐藏原横幅。清整组仍走组菜单。 Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
9631a03 to
61ecdfa
Compare
MagicLizi
left a comment
There was a problem hiding this comment.
按维护者指示批准;合并仍需通过 review-pr 的代码审查与其余安全门。
|
合了。失败红点现在能被用户处理掉,系统自己中止的也不会一直粘着——侧栏终于不用靠猜了。 |
这次改了什么
摘要
自动任务侧栏红点有两套逻辑:失败未读会涂红,但点进任务后往往没有可忽略的横幅;组头点击还一律打开最新一次运行。账号切换或暂停计划把进行中的 run 掐成
aborted时,红点会一直粘着。这次把「标为已读」放到自动任务组头的更多菜单(有未读才出现),失败/中断打开后给出横幅;系统主动中止的
aborted生而已读,不再当失败未读。变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
⋯/ 整行右键提供「标为已读」,只清这一组failed/interrupted未读打开后出现「这次自动任务没有完成」横幅,点「标为已读」才消红aborted时带上readAt;存量未读aborted也不再涂红sessionAttentionStore(避免污染 Dock)UI 变化
Desktop 侧栏自动任务组头菜单,以及任务输入框上方的失败未读横幅。未附截图。
docs/design-rules/DESIGN.md§2 Semantic & Accent:横幅复用已有 error token(--error-bg/--error-border/--error-fg/--error-fg-strong),与中断横幅同组,不新增语义色docs/design-rules/DESIGN.md§10 Theme System:颜色只走 token,Light / Dark 随主题切换docs/design-rules/DESIGN.md§1 Extreme content restraint:失败横幅只有一句说明 + 一个「标为已读」,没有「继续」DropdownMenu与组头 pill 行,不再用 0 尺寸隐形 trigger怎么验证的
自动验证
手工验证
不涉及。未启动 Desktop 实机点选组菜单 / 横幅(worktree 改动不会热更到正在跑的实例)。
未执行的验证
Desktop Light / Dark 实机目检未做。横幅与菜单复用已有 themed 组件和 error token,双模式实现已落地,但未目检。
风险
风险分类
影响与回滚
aborted落库带readAtaborted.readAt只让那些 run 保持已读,不影响后续失败未读提交前检查
git commit -s,见 DCO)