anthropics / anthropics/claude-code

[Bug] Goal cancellation not working - causes infinite loop in agentic execution

Open
#94,370 0 comments 0 reactions 0 assignees View on GitHub
area:agents area:core bug platform:macos
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

Image

**Bug Description**
goal isnt being properly cancellled and spirals claude into an infinite loop

**Environment Info**
- Platform: darwin
- Terminal: xterm-256color
- Version: 2.1.269
- Feedback ID: 188ccbff-256b-452d-888e-5abe2dee15f1

**Errors**
```json
[{"error":"Error: 500 {\"type\":\"error\",\"error\":{\"type\":\"api_error\",\"message\":\"Internal server error\"},\"request_id\":\"req_011Cf183GuTbwTPqrvVJmbuQ\"}\n at generate (/$bunfs/root/chunk-2n2dmkkb.js:11:14493)\n at makeRequest (/$bunfs/root/chunk-2n2dmkkb.js:51:8033)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-09-13T08:28:21.956Z"},{"error":"Error: 500 {\"type\":\"error\",\"error\":{\"type\":\"api_error\",\"message\":\"Internal server error\"},\"request_id\":\"req_011Cf26a2Zdzb8VdavR8eSNA\"}\n at generate (/$bunfs/root/chunk-2n2dmkkb.js:11:14493)\n at makeRequest (/$bunfs/root/chunk-2n2dmkkb.js:51:8033)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-09-13T20:49:42.471Z"}]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is identified in the report. Reproduce the cancellation scenario on darwin with Claude Code 2.1.269, then trace the goal-cancellation behavior around the repeated API 500 errors. Done means cancelling a goal exits cleanly instead of continuing in an infinite loop, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.