makecindy / makecindy/cindy

无权限账号仍自动启用对话记录语义索引并无限重试 embedding,后台持续刷 400 错误日志

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

Description

**提交人**: 板栗
**客户端版本**: 0.1.27

---

## 现象

无权限使用「对话记录语义索引」的账号,Cindy 仍会自动启用该功能并持续尝试 embedding,后台无限重试失败,持续刷错误日志。

## 复现步骤

1. 使用一个没有「Chat embedding」权限的 Cindy 账号登录
2. 观察日志:启动时出现 `[PERMISSION_DENIED] Chat embedding requires a Cindy account`
3. 但 Cindy 仍自动开启「对话记录语义索引」,使用 `voyage/voyage-4` 模型开始 embedding
4. XD Gateway 返回 `400 INVALID_MODEL`(模型不可用/无权限)
5. embedding worker 每约 5 秒重试一次,无休止刷 `embeddingWorker.batch.failed` 错误
6. `embedding_jobs` 表堆积 1900+ 失败任务

## 期望行为

- 账号无权限时,不应自动启用「对话记录语义索引」,或至少不应启动 embedding worker
- 权限不足 / 模型不可用时,应停止重试而不是无限循环刷日志
- 设置界面开关默认状态应与账号实际权限一致

## 实际行为

- 权限检查(`PERMISSION_DENIED`)与 embedding worker 启动逻辑脱节:权限不足时 worker 照常启动
- embedding 失败后无退避/停止机制,每 5 秒无限重试
- 今天单日累计 700+ 次 `embeddingWorker.batch.failed` 错误日志,堆积 1900+ 失败任务
- 用户需手动到设置里关闭「启用对话记录语义索引」开关才能停止

## 环境补充

- 该功能开关在设置中位于「功能开关」(Functional toggles) 分组,标签为「启用对话记录语义索引」(Enable chat semantic indexing)
- 错误模型:`voyage/voyage-4`,错误码 `INVALID_MODEL`
- 日志路径:`~/Library/Application Support/Cindy/logs/main-*.log`
---
**版本区域**: CN
**OS**: darwin arm64 (24.2.0)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

Start by tracing the permission check that emits [PERMISSION_DENIED] and the embedding worker that logs embeddingWorker.batch.failed; the issue does not name source files or tests. Compare worker startup with the Functional toggles setting for chat semantic indexing, then reproduce with an account lacking Chat embedding permission. Done means the feature stays disabled or the worker does not start, and INVALID_MODEL or permission failures no longer retry indefinitely.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, authentication, backend
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.