makecindy / makecindy/cindy

macOS 受保护目录访问被静默拒绝:agent 子进程 TCC 归因问题,且缺少首启权限引导

Open
#198 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.7k
Forks
401
Avg merge
21h 48m
Merged PRs (30d)
776

Description

**提交人**: forest
**客户端版本**: 0.1.6

---

## 现象

在 agent 会话中读取 `~/Desktop` 下用户明确指定的文件时,系统直接返回 `Operation not permitted`,**没有任何授权弹窗**;让 agent 通过 `osascript` 控制 Finder 也同样静默失败(`-1743 未获得授权将Apple事件发送给Finder`,无弹窗)。用 `tccutil reset SystemPolicyDesktopFolder com.xd.cindycn` / `tccutil reset AppleEvents com.xd.cindycn` 重置后复现依旧,均为无弹窗直接拒绝。

## 已排除

- Info.plist 已包含 `NSAppleEventsUsageDescription`(桌面/文稿目录类无需 usage string 也应出系统通用弹窗)
- entitlements 已包含 `com.apple.security.automation.apple-events`
- 应用未启用 App Sandbox,Developer ID 签名正常(TeamID NTC4BJ542G)

## 推断根因

文件访问由 Cindy → agent(claude 子进程链)层层 spawn 的 shell 子进程发起,TCC 的责任进程(responsible process)归因没有落在 Cindy.app 主进程上,而是落在非 app bundle 的 helper 二进制上——无法展示授权弹窗,macOS 直接静默拒绝。

## 影响

用户让 agent 读桌面/文稿/下载目录里的文件必然失败,且系统无任何提示,用户不知道该去哪授权;最终只能靠人工去系统设置手动给 Cindy 开「完全磁盘访问权限」并重启应用才解决。

## 建议

1. 将受保护路径的文件访问代理到主进程执行(主进程发起 open/read 时归因正确,可正常触发系统授权弹窗)
2. 增加首次启动权限引导 + 设置内「权限状态」页:检测 桌面/文稿/下载/自动化/完全磁盘访问 等权限状态,缺失时一键跳转对应系统设置面板(FDA 无法程序化申请,只能引导)
3. agent 执行遇到 EPERM/TCC 拒绝时,向用户给出明确的授权引导提示,而不是静默失败
---
**OS**: darwin arm64 (25.5.0)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Cindy → agent → shell child-process chain and how the main process handles protected-path reads and osascript calls. Then inspect the first-startup and settings permission entry points, if present, and reproduce the EPERM/TCC and Apple Events failures on macOS. Done means protected access is correctly attributed or clearly guided, with visible status and system-settings guidance for missing permissions.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, macos, typescript
Domain
desktop, operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.