makecindy / makecindy/cindy

feat: 任务完成声音提醒 + 后台审批/待操作主动提醒

Open
#3,177 1 comment 0 reactions 0 assignees View on GitHub
feature
Dominant language
TypeScript
Stars
2.7k
Forks
395
Avg merge
21h 48m
Merged PRs (30d)
776

Description

**提交人**: HalFree
**客户端版本**: 0.1.58

---

## 使用场景 / Use case

用户常把 Cindy 放到后台跑长任务(如 Orca worker、/loop 自主任务、等待权限审批的长会话)。任务完成或需要用户审批时,用户不在前台,容易错过。

## 当前痛点 / Pain

- **任务完成无声音提醒**:现有「系统通知」(`apps/desktop/src/renderer/components/settings/NotificationSection.tsx`)仅在 CC Agent session 完成/待回复时弹**桌面 toast**,无声;后台运行且没看屏幕时完全无感。
- **审批态缺主动提醒**:权限确认/审批走确认卡(`previewGate`、`orcaWorkerPermissionConfirmBridge`、`permissionModeControl`),当 Cindy 在后台、确认卡静默等待时,用户不知道「正卡在等我批」,任务就此停滞。
- 现有通知策略 `agent-island/notificationPolicy.ts` 只控制「是否弹 Agent Island 通知」,未涉及声音通道与审批态主动提示。

## 诉求 / Ask

1. **声音提醒**:任务完成(以及其它关键节点)时,除现有 toast 外,播放一段轻提示音;可在设置中开关、可选音效。
2. **审批/待用户操作提醒**:当需要用户审批/确认而 Cindy 处于后台时,主动提醒用户(系统通知 + 声音,最好带任务栏/托盘闪烁或角标),避免任务在后台静默卡死。

## 建议方案 / Proposal

**声音通道**:
- 复用桌面端已有的音频能力(`apps/desktop/src/main/audioFileProtocol.ts`),在通知触发点加一声提示音播放。
- 在 `NotificationSection.tsx` 新增「声音提醒」开关(与现有「桌面通知」并列),并提供默认音效;建议**默认开启**(用户明确表达后台易忘),可一键关闭。
- 区分场景音量/音色:任务完成(轻提示)vs 审批等待(更醒目,可重复/持续至用户响应)。

**审批态主动提醒**:
- 在权限/审批确认卡弹出(尤其 auto-review 不可用、需真人确认)的入口处,若检测到 App 在后台,触发:系统通知 + 声音 + 托盘/任务栏高亮(参考 `notificationPolicy.ts` 的 session 级策略,扩展到「审批待处理」状态)。
- 复用 `useNotificationSettings` 偏好范式,新增 `notifyOnApprovalNeeded` 开关。
- 后台判定:监听窗口可见性 / 焦点,App 隐藏或失焦时,审批等待才升级为强提醒;前台时维持现有确认卡即可,不额外打扰。

**关键约束**:
1. 不重复打扰:同一审批只提醒一次(或限频),用户回到前台/处理后才消除。
2. 声音可降级:系统禁音/勿扰模式下静默失败,不报错阻断。
3. 不绕过现有审批安全门:仅做「提醒」,不改变确认卡本身的授权逻辑。

## 不做 / Out of scope

- ❌ IM 渠道推送(飞书/企微等通知已各自迁移到 IM 机器人页,本 feat 聚焦桌面端本地声音+系统通知)。
- ❌ 自定义上传音效(一期用内置音效,自定义可后续)。
- ❌ 修改审批授权语义,仅增强提醒。

## 关联

- 现有通知: `apps/desktop/src/renderer/components/settings/NotificationSection.tsx`、`useNotificationSettings.ts`
- 通知策略: `apps/desktop/src/main/agent-island/notificationPolicy.ts`
- 音频基础: `apps/desktop/src/main/audioFileProtocol.ts`
- 审批确认: `previewGate.ts`、`orcaWorkerPermissionConfirmBridge.ts`、`permissionModeControl.ts`

## 验收 / Acceptance

- [ ] 任务完成时除 toast 外播放提示音(可在设置关闭)。
- [ ] 声音提醒开关独立于桌面通知,默认开启(待产品确认)。
- [ ] Cindy 后台运行时出现「待审批」,触发系统通知 + 声音 + 任务栏/托盘高亮。
- [ ] 回到前台处理审批后,提醒消除、不重复打扰。
- [ ] 勿扰/禁音环境下静默降级,不报错。
- [ ] 覆盖基础单测(参考 `notificationPolicy`、`NotificationSection` 相关测试)。
---
**版本区域**: CN
**OS**: win32 x64 (10.0.26200)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

Start with NotificationSection.tsx, useNotificationSettings.ts, notificationPolicy.ts, and audioFileProtocol.ts, then trace the approval entry points in previewGate.ts, orcaWorkerPermissionConfirmBridge.ts, and permissionModeControl.ts. Run the related notification policy and NotificationSection tests before changing behavior. Done means the stated completion and approval reminders, settings, deduplication, foreground handling, and silent-failure cases are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, typescript
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.