anthropics / anthropics/claude-code

Cloud routine (CCR) session 卡死在 "Claude Code process started" 之後,即使不使用任何 MCP 工具

オープン
#88,799 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:routines bug has repro
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

透過 remote-trigger API 建立雲端排程(routine),連續 4 次獨立執行全部卡死在同一位置,包含完全不掛載任何 MCP 連接器、只要求回覆一行文字的最簡單任務。

- 環境 ID:env_01Pjn4vNDVVxWozdsQmvrDcD
- 卡住的 session:
- cse_01S3zYjckExLzA5aZ396x4Mt
- cse_0141UPvPc9HBCgDTTRSUR6hi
- cse_01A5uQkXTv7wHhvpes87vGCD
- cse_01BLqDjdSRQxE1ZUHVnT7HRM
- 現象:sandbox 分配、環境啟動、Claude Code process started 都正常出現在事件紀錄中,但之後完全沒有任何 assistant 回應或工具呼叫,卡死超過 40 分鐘沒有變化
- 已排除:MCP 連接器權限問題(無連接器仍卡住)、執行緩慢(40 分鐘無進展)、單次偶發(4 次獨立 session 皆同樣卡住)

### What Should Happen?

Session: cse_01S3zYjckExLzA5aZ396x4Mt

[2026-08-22T09:58:29.002621Z] env[info]: Allocating sandbox
[2026-08-22T09:58:32.334944Z] env[info]: Environment runner started
[2026-08-22T09:58:32.428962Z] env[info]: No sources configured
[2026-08-22T09:58:33.158929Z] env[info]: No setup script configured
[2026-08-22T09:58:33.243779Z] env[info]: Starting Claude Code
[2026-08-22T09:58:33.251464Z] env[info]: Claude Code process started

--- Log stops here. No further events, no error, no assistant response, no tool calls.
--- Checked again 40+ minutes later: still no change. worker_status remained "idle".

Same exact stop point observed in 3 other independent sessions:
cse_0141UPvPc9HBCgDTTRSUR6hi, cse_01A5uQkXTv7wHhvpes87vGCD, cse_01BLqDjdSRQxE1ZUHVnT7HRM

### Error Messages/Logs

```shell
Session: cse_01S3zYjckExLzA5aZ396x4Mt

[2026-08-22T09:58:29.002621Z] env[info]: Allocating sandbox
[2026-08-22T09:58:32.334944Z] env[info]: Environment runner started
[2026-08-22T09:58:32.428962Z] env[info]: No sources configured
[2026-08-22T09:58:33.158929Z] env[info]: No setup script configured
[2026-08-22T09:58:33.243779Z] env[info]: Starting Claude Code
[2026-08-22T09:58:33.251464Z] env[info]: Claude Code process started

--- Log stops here. No further events, no error, no assistant response, no tool calls.
--- Checked again 40+ minutes later: still no change. worker_status remained "idle".

Same exact stop point observed in 3 other independent sessions:
cse_0141UPvPc9HBCgDTTRSUR6hi, cse_01A5uQkXTv7wHhvpes87vGCD, cse_01BLqDjdSRQxE1ZUHVnT7HRM
```

### Steps to Reproduce

1. 使用 remote-trigger API(POST /v1/code/triggers)建立一個雲端排程(routine),job_config.ccr.environment_id 設為預設環境,session_context.events 帶一個簡單的 user 訊息(例如「請直接回覆一行文字:測試成功。不需要使用任何工具。」)
2. 呼叫該 routine 的 run 端點(POST /v1/code/triggers/{trigger_id}/run)立即觸發執行
3. 透過 get_run_log(GET /v1/code/sessions/{session_id}/events)追蹤該次執行的事件紀錄
4. 觀察到事件紀錄依序出現:Allocating sandbox → Environment runner started → No sources configured → No setup script configured → Starting Claude Code → Claude Code process started
5. 在「Claude Code process started」之後,事件紀錄完全停止,等待 40 分鐘以上仍無任何變化——沒有 assistant 回應、沒有工具呼叫、也沒有任何錯誤訊息
6. 重複步驟 1-5 共 4 次(含一次完全不掛載任何 MCP 連接器的最簡版本),皆出現一模一樣的卡死現象

### Claude Model

None

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

2.1.239 (Claude Code)

### Platform

Anthropic API

### Operating System

macOS

### Terminal/Shell

Terminal.app (macOS)

### Additional Information

Image

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Reproduce the routine through POST /v1/code/triggers and POST /v1/code/triggers/{trigger_id}/run, then inspect events with GET /v1/code/sessions/{session_id}/events. Start at the transition after “Claude Code process started” and compare the four session logs. Done means the run emits an assistant response or tool call, or reports a useful error instead of remaining idle for over 40 minutes.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
macos
領域
api, cloud
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。