bug: app 主进程无响应需手动重启(对话无反应),系统 spindump 采样到主线程 spin,无崩溃报告
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
### 问题描述 / What happened
## 问题现象 / Actual behavior
Cindy 桌面应用会**周期性无响应**:对话界面突然卡死(输入/发送无反应),随后应用自动重启(窗口关闭后重新拉起),已**多次**遇到(本次为最近一次,2026-08-08 20:44 和 20:47 两次连续重启)。
## 期望行为 / Expected behavior
应用不应在正常使用中无响应或自动重启;即使崩溃也应留下崩溃报告以便定位。
## 系统日志证据(macOS 统一日志 unified log)
无响应窗口期间,系统对 Cindy 主进程触发了两次 **spindump spin 采样**(主线程阻塞):
```
2026-08-08 20:44:35.336 spindump: Cindy [84472]: spin: start
2026-08-08 20:44:35.497 spindump: Cindy [84472]: spin stop
2026-08-08 20:47:01.324 spindump: Cindy [85928]: spin: start
2026-08-08 20:47:01.399 spindump: Cindy [85928]: spin stop
```
同时主进程 PID 从 26604 → 84472 → 85928 变化,即发生了**两次进程重启**;20:43:53 起旧进程与系统服务(CursorUIViewService、Dock、powerd)的 XPC 连接逐一失效(正常退出特征),但 **DiagnosticReports 中没有任何 Cindy 崩溃报告(.ips)**,因此不是常规 crash,疑似主动退出、被杀或自我保护重启。
重启后还会遗留**多个 pi RPC 进程并存**(20:47:25 与 20:47:49 各启动一个 pi,绑定不同 session-dir),旧会话的 pi 未被清理。
### 环境 / Environment
- Cindy 版本 / version or commit: **0.1.37** (CFBundleShortVersionString 0.1.37)
- 平台与操作系统 / platform & OS version: **macOS 26.6 (25G72), Apple Silicon (arm64)**
- 安装方式 / install method: **直接下载安装(/Applications/Cindy.app)**
- 相关运行时: pi 0.83.0(CindyGlobal/pi/0.83.0)、codex 0.145.0
### 复现步骤 / Steps to reproduce
难以稳定复现,属于偶发/周期性问题。观察到的模式:
1. 正常使用 Cindy 进行对话(本机运行 pi RPC agent 会话)
2. 一段时间后(本次为持续使用约 1-2 小时后),对话界面突然无响应:发送消息后无反应
3. 数秒后应用自动重启(窗口关闭并重新拉起),进程 PID 变化(本次 26604 → 84472 → 85928)
4. 重启期间系统 spindump 对主进程做了 spin 采样(主线程阻塞 160ms/75ms)
5. 重启后旧 pi RPC 进程未被清理,出现多个 pi 进程并存
日志确认方式(macOS):
```bash
log show --last 30m --predicate 'process == "spindump"' | grep -i cindy
# 期望看到 "Cindy [PID]: spin: start/stop" 即复现
```
### 日志与截图 / Logs & screenshots
### macOS 统一日志(log show)
```
# 20:43:53 起旧主进程 26604 与系统服务的 XPC 连接逐一失效(正常退出特征)
2026-08-08 20:43:53 CursorUIViewService: invalidated because the client process (pid 26604) either cancelled the connection or exited
2026-08-08 20:44:31 runningboardd: Invalidating assertion ... (target:[app:26604]) from originator Dock.agent
# 20:44:35 与 20:47:01 系统对 Cindy 主线程 spin 采样
2026-08-08 20:44:35 spindump: Cindy [84472]: spin: start
2026-08-08 20:44:35 spindump: Cindy [84472]: spin stop
2026-08-08 20:47:01 spindump: Cindy [85928]: spin: start
2026-08-08 20:47:01 spindump: Cindy [85928]: spin stop
# 20:46:59 新主进程 85928 启动;20:47:25 与 20:47:49 各启动一个 pi RPC 进程(并存)
2026-08-08 20:47:25 pi --mode rpc --session-dir .../pi-agent-home/s...
2026-08-08 20:47:49 pi --mode rpc --session-dir .../pi-agent-home/s...
```
### 说明
- `~/Library/Logs/DiagnosticReports/` 中**无任何 Cindy 崩溃报告(.ips / .diag)**——排除常规 crash。
- 数据库(`~/Library/Application Support/CindyGlobal/cindy-*.db`)在重启后 WAL 仍正常写入,数据未丢失。
Contributor guide
Research direction
Start by collecting the macOS unified logs with the provided `log show` command and correlate the Cindy main-process PID changes with the spindump samples. Trace the restart path and pi RPC session lifecycle; done means the app no longer becomes unresponsive or restarts unexpectedly, and old pi processes are cleaned up.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, macos, typescript
- Domain
- backend, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100