makecindy / makecindy/cindy

claude-code worker 连续 7 次派发全部零 token 终止,同环境 codex worker 全部正常

Open
#2,788 1 comment 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.49

---

## 现象

Orca 多 worker 协同中,`agent_kind: claude-code` 的 worker **连续 7 次派发全部零输出终止**——会话记录里只有 lead 发出的消息,没有任何 assistant 输出、tool_use 或 thinking。UI 提示「worker 异常终止 (no output captured)」。

同一会话、同一时间段内的 **6 个 `codex` worker 全部正常工作**,完成了文章图片管线、质量闸修复、跨仓审核等真实任务。

界面上先后出现过三种不同错误:

1. `Not logged in · Please run /login`
2. `Claude Opus is not available with the Claude Pro plan. If you have updated your subscription plan recently, run /logout and /login for the plan to take effect.`
3. `API Error: 400 {'error': 'anthropic_messages: Invalid model name passed in model=claude-fable-5. Call /v1/models to view available models for your key.'}`

## 复现步骤

1. 在已连接 Anthropic(Claude.ai 订阅,Max)的环境中开启 Orca team
2. `create_worker({role, agent: "claude-code", model: "claude-opus-5" 或 "claude-fable-5", label, initial_task})`
3. 返回正常:`dispatch_outcome.dispatched=true, wakeKind=queued`
4. worker 随即零 token 终止;`read_worker` 返回 `result: ""`
5. `get_chat_history(session_ids=[worker_session_id])` 只见 lead 消息,无任何 assistant 行

把 `agent` 换成 `codex`、任务内容不变,可正常完成。

## 期望行为

claude-code worker 能像 codex worker 一样正常启动并产出输出;若确实存在凭据或权限问题,失败原因应可通过工具链查到,而不是只出现在界面上。

## 实际行为

worker 静默终止,零 token。**失败原因不在 `get_chat_history` 里**——通过工具只能看到「零输出」,真实错误只出现在 UI。排障时无法自查根因,只能依赖人工转述界面文字。

## 关键矛盾:所有可见的凭据来源都显示 Max,worker 却报 Pro

| 检查项 | 实际值 |
|---|---|
| 用户终端 `claude auth status` | `loggedIn: true`, `authMethod: "claude.ai"`, `subscriptionType: "max"` |
| `~/.claude.json` | `oauthAccount.organizationType = "claude_max"` |
| `~/.claude/settings.json` 的 `env` 段 | 空对象,无 `apiKeyHelper`、无认证类环境变量 |
| 设置 → 模型供应商 → Anthropic | 「Claude.ai 订阅」,11 个模型(**含 `claude-fable-5`**) |
| `list_available_models(agent="claude-code")` | 返回 `claude-fable-5`、`claude-opus-5` 等,均标 `tier: standard` |
| worker 实际报 | Pro plan / invalid model name |

用户账号自安装起一直是 Max 订阅,从未降级到 Pro。

## 复现频率

7/7,必现。跨两个模型(`claude-opus-5`、`claude-fable-5`)、跨新旧会话(一个会话复用 3 次 + 3 个全新会话)均复现。

## 已尝试

- `claude auth login`:终端显示成功,worker 无变化
- `claude setup-token`:worker 无变化
- `claude auth logout` + `claude auth login`:`~/.claude/.credentials.json`(原为两个月前的旧文件)确实被删除、keychain 条目已刷新,**worker 行为仍无任何变化**
- 确认无 `ANTHROPIC_API_KEY` / `CLAUDE_CODE_OAUTH_TOKEN` / `ANTHROPIC_AUTH_TOKEN` 环境变量,无 `CLAUDE_CONFIG_DIR` 覆盖,系统内只有一个 `claude` 可执行文件

三轮 logout/login 之后 worker 行为完全不变,强烈提示 **worker 进程读取的凭据源与用户终端所修改的那一份不是同一个**。

## 次要观察:模型清单与实际权限不一致

`list_available_models` 返回 `claude-fable-5`,而 API 以「invalid model name for your key」拒绝。模型清单似乎没有对着实际凭据的权限做校验,调用方无法据此判断可用性——这会让选型直接踩空。
---
**OS**: darwin arm64 (27.0.0)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

Start by tracing the create_worker, read_worker, get_chat_history, and list_available_models entry points for the claude-code path. Compare the worker process credential source with the user's Claude CLI and ~/.claude files, then reproduce the zero-output case. Done means the worker starts with valid credentials or exposes the underlying authentication/model error through the available tool results.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.