zai-org / zai-org/feedback

[Bug] Desktop 3.11.2 点击任务完成系统通知后定位到第一个任务,而非完成的任务

Open
#534 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category

UI / 界面体验 · UI / UX

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

影响体验 · Major (功能可用但体验受损 / works but degraded)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description

并行运行多个任务时,某个任务完成会弹出系统通知。点击该通知打开 ZCode 后,界面定位到第一个任务,而不是弹通知的那个已完成的任务。并行任务多时每次都要手动再找一遍目标任务,通知的快速定位作用失效。

复现步骤 · Steps to reproduce
  1. 在工作区并行运行多个任务
  2. 切到其他应用,让 ZCode 保持后台(注:ZCode 前台时不弹系统通知,此 bug 仅在后台收通知时触发)
  3. 等待某个任务完成,弹出系统通知
  4. 点击该系统通知
期望表现 · Expected behavior

打开 ZCode 并定位到发出通知的那个已完成的任务。

实际表现 · Actual behavior

打开 ZCode 后定位到第一个任务,不是完成的任务。

ZCode 版本 · ZCode version

3.11.2.6792

设备 / 系统 / 浏览器 · Device / OS / Browser

Windows 11 (10.0.26200) x64 · Desktop

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs

无截图;以下为基于本机安装包 resources/app.asar(3.11.2.6792, out/main/index.js + renderer bundle)的静态分析,供定位参考:

  • 主进程 dispatchTaskNotification:通知点击后 revealWindow(sender) 并向 sender 窗口发送 IPC zcode:task-notification-click,payload 仅含 taskId
  • 渲染层 Root 的 onTaskNotificationClick:遍历 workspaces,用 taskListCache.find(taskId)activeTaskId === taskId 匹配;命中后按 workspacePath(+ 可选 workspaceIdentity)打开工作区并调用 setActiveTaskId
  • 可疑点:
    1. taskId 在所有工作区的 taskListCache 均未命中且不等于任何 activeTaskId 时,仅记录 warn task not found in any workspace 后静默返回——窗口被聚焦但无跳转,界面停在默认选中(第一个任务)
    2. 命中 activeTaskId === taskIdtaskListCache 未命中该任务时,workspaceIdentity 取值为 undefined,仅按 workspacePath 打开;同一项目路径下多个并行任务/多标签时无法唯一定位
    3. 工作区打开与 setActiveTaskId 之间可能存在竞态:任务列表异步加载完成后的默认选中(第一个任务)可能覆盖此前设置的目标任务
  • 修改建议:click IPC payload 携带完整定位坐标(taskId + workspacePath + workspaceIdentity)做精确路由;cache 未命中时不要静默失败;待任务列表加载完成后再应用目标任务

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the packaged entry points named in the report: out/main/index.js and the renderer bundle, focusing on dispatchTaskNotification and onTaskNotificationClick. Trace the task-notification-click payload through workspace opening and task selection; the fix is complete when clicking a completion notification opens the notifying workspace and selects that completed task, including parallel tasks sharing a path.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.