anthropics / anthropics/claude-code

[BUG] RemoteTrigger routine stalls silently after "Claude Code process started" — no tool calls, session stuck active/idle (same symptom as closed #54260)

Đang mở
#87,904 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:routines bug has repro stale
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

### 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?

Same symptom as [#54260](https://github.com/anthropics/claude-code/issues/54260) ("Code Routines: cron fires but cloud containers never execute prompts"), closed as "not planned" in April 2026 — but still reproducing as of August 2026. That issue is locked to collaborators so I can't comment there directly; filing fresh with new reproduction evidence.

A RemoteTrigger routine reproducibly fails to execute its prompt. The cloud environment provisions correctly and the Claude Code process starts, but no further activity ever occurs — no tool calls, no completion, session stays in status: active / worker_status: idle indefinitely.

Reproduction (2/2 failures, 100% reproducible on this environment):

Trigger trig_01FcM49NKnk6GyUg36k5ghiu, scheduled run 2026-08-19 07:01:52 UTC
Session: cse_01FqfcpMh9deqNWd3TqaLfQS
Log stops after: [07:01:57.484088Z] env[info]: Claude Code process started
No events after that point.
Diagnostic re-test, trigger trig_01SxapPMmaoWUbdAvG5ssDst, fired 2026-08-19 09:06:21 UTC (same environment_id, same job_config)
Session: cse_01DBDPjLqzYZSeWMgTJDWxS6
Identical log pattern, stops after: [09:06:26.332504Z] env[info]: Claude Code process started
No events after that point.

Environment: env_01YD8XsmtTLiUrLkZumGrnUV

Expected: The prompt is processed, tools are called, the session completes.
Actual: Environment provisioning completes normally (sandbox allocated, environment initialized, Claude Code process started), then the session never progresses — no prompt processing, no tool calls, no error, no completion event.

Impact: A scheduled content-publishing routine that ran fine when created is now silently non-functional — nothing surfaces as an error, so the only way to detect the failure is checking the target system directly for missing output.

### What Should Happen?

The prompt should be processed and the routine should execute normally: the cloud container connects to Claude Code, the prompt is picked up, tool calls are made (reading/writing files, API calls as instructed in the routine's system prompt), and the session completes with a result — the same way it worked when this routine was first created and ran successfully.

Instead, the container provisions correctly and the Claude Code process starts, but execution never begins: no tool calls, no output, no error — the session just sits idle indefinitely.

### Error Messages/Logs

```shell
Run 1 (trig_01FcM49NKnk6GyUg36k5ghiu, session cse_01FqfcpMh9deqNWd3TqaLfQS):
[2026-08-19T07:01:52.122414Z] env[info]: Allocating sandbox
[2026-08-19T07:01:55.900773Z] env[info]: Environment runner started
[2026-08-19T07:01:56.020627Z] env[info]: Initializing environment
[2026-08-19T07:01:56.037281Z] env[info]: No sources configured
[2026-08-19T07:01:57.309694Z] env[info]: No setup script configured
[2026-08-19T07:01:57.435697Z] env[info]: Parallel initialization completed
[2026-08-19T07:01:57.451006Z] env[info]: Claude Code executor created
[2026-08-19T07:01:57.470225Z] env[info]: Starting Claude Code
[2026-08-19T07:01:57.484088Z] env[info]: Claude Code process started
— no further events —

Run 2 (trig_01SxapPMmaoWUbdAvG5ssDst, session cse_01DBDPjLqzYZSeWMgTJDWxS6):
identical pattern, stops after "Claude Code process started" at 09:06:26.332504Z
```

### Steps to Reproduce

1. Create a RemoteTrigger routine via POST /v1/code/triggers with job_config.ccr.environment_id set to an existing environment, session_context with model/allowed_tools/system_prompt/prompt, and a cron_expression.
2. Wait for the cron to fire (or trigger manually via the run action).
3. Check the run session log via GET /v1/code/sessions/{session_id}/events.
4. Observe: provisioning events complete normally, "Claude Code process started" logs, then no further events ever appear. Session status stays "active", worker_status "idle" indefinitely.

### Claude Model

Sonnet (default)

### Is this a regression?

I don't know

### Last Working Version

Unknown / N/A

### Claude Code Version

Unknown

### Platform

Other

### Operating System

macOS

### Terminal/Shell

Terminal.app (macOS)

### Additional Information

_No response_

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start by reproducing the RemoteTrigger through POST /v1/code/triggers, then inspect the run with GET /v1/code/sessions/{session_id}/events and the manual run action. Trace the flow after the “Claude Code process started” event, using the two provided session logs as comparisons. Done means the prompt is processed, tool calls and output appear, and the session completes instead of remaining active and idle.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
api, backend, cloud
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.