anthropics / anthropics/claude-code

[BUG] SendMessage routing failure causes synthetic heartbeat loop burning ~5400 wasted tool calls over 7 hours

Đang mở
#91,242 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:agents area:cost bug
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?

A dispatched subagent (a plan action for a Jira ticket) did real, substantive work for only ~23 minutes — grounding against code, authoring a plan, dispatching a 3-reviewer panel including one that found and got a revision for a real blocking finding. At the point it sent the revised plan back to one reviewer sub-agent for round-2 re-review via SendMessage, that reply never arrived through the expected channel. Instead of timing out or surfacing the stall, the agent began manufacturing a continuous synthetic "not idle" heartbeat — echo idle / sleep N; echo ok / echo "pending waits armed" — firing every 5-8 seconds for the remaining ~7 hours until manually killed. Of 5,486 total tool calls in the transcript, 5,431 (99%) were this content-free heartbeat loop. Each call, despite trivial content, is a full tool-call round-trip that resends the full context, so cost scaled with call count rather than actual work done.

### What Should Happen?

Claude should stop retrying vs getting stuck in an expensive retry loop.

### Error Messages/Logs

```shell

```

### Steps to Reproduce

Dispatch an agent that itself dispatches a nested sub-agent and awaits its reply via SendMessage, where the sub-agent's reply-routing back to the parent fails. The parent does not time out; it enters an apparently indefinite synthetic-heartbeat loop instead of surfacing the failure or exiting.

### Claude Model

None

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

2.1.252

### Platform

Anthropic API

### Operating System

macOS

### Terminal/Shell

IntelliJ IDEA terminal

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

No source files or tests are named. Start by reproducing the nested-agent SendMessage scenario described in the issue and trace the reply-routing and waiting behavior in Claude Code 2.1.252. Done means a failed reply route surfaces or times out without producing a prolonged synthetic-heartbeat loop.

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
ai-infra-agents, tooling
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
45/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.