makecindy / makecindy/cindy

功能建议:Claude Code 内部错误应自动重试而非直接崩溃

Open
#2,841 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

**提交人**: 匿名
**客户端版本**: 0.1.50

---

## 使用场景

在 Claude Code 执行长任务、多工具并行返回、大文件读取等场景下,偶发内部 JavaScript 错误导致整个会话中断。每次都需要手动重试,打断工作流。

## 当前痛点

长任务(如多文件批量操作、大型代码库扫描、并行工具调用)频繁出现以下错误后直接中断:

```
Error: Claude Code returned an error result: undefined is not an object (evaluating 'e.includes')
```

根因是 Claude Code 内部工具结果解析器对 null/undefined 值调用了 `.includes()` 方法,缺少 null-safety 检查。该错误与用户输入或网络无关,是宿主代码自身的 bug。

每次遇到都需要手动重试同一操作,在长任务中可能反复出现,极大降低效率。

## 期望结果

当 Claude Code 遇到这类内部偶发错误时,应自动重试而非直接崩溃返回错误信息。

具体建议:
1. 自动重试最多 3 次,每次间隔 1-2 秒
2. 覆盖所有内部偶发错误(非用户输入导致的 JS 运行时错误)
3. 3 次都失败再报错给用户
4. 建议将重试次数做成可配置项(默认 3 次),用户可自行调整

## 补充说明

- 错误复现环境:Windows 10 Pro,Git Bash
- 错误发生时无网络波动,其他 AI 工具正常
- 换模型、换供应商均无法避免(因为错误在宿主解析器层,不在模型层)
- 重试同一操作通常能成功,说明是瞬时竞态/空值问题
---
**版本区域**: CN
**OS**: win32 x64 (10.0.19045)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

No source files, tests, or entry points are named. Start by locating the internal error parsing and session failure handling, then determine which errors are safe to retry and where retry configuration belongs. Done means transient internal errors retry up to the configured limit before the user sees the failure, with tests covering success and exhaustion.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.