anthropics / anthropics/claude-code
Auto-continue at usage limit never arms when the limit kills only background subagents
- Ngôn ngữ chính
- Python
- Star
- 145k
- Fork
- 23.1k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
**What happened**
Two background agents died with `Agent terminated early due to an API error: You've hit your session limit · resets 12am`. The main thread was idle ("Waiting for 1 background agent to finish") and had no in-flight request. At the reset, nothing resumed — no auto-continue, no "press enter to continue" notice.
**Expected**
Since 2.1.234, auto-continue at usage limit is on by default. I expected the session to pick up after the reset. Instead the work was simply lost until I noticed hours later.
**Why (from the 2.1.241 bundle)**
Arming has exactly one entry point: the main REPL stream handler, on an assistant message with `isApiErrorMessage && error === "rate_limit" && quotaLimits`. The quota-rejected subscriber that handles re-arms also requires an active turn claim and returns early unless the rejection origin is `main_thread`. So a quota rejection that only lands on subagents can never arm — and if the main thread happens to be idle at that moment, the whole episode is silently dropped.
**Why it matters**
For delegation-heavy workflows most tokens are spent in subagents, which is exactly the case the feature doesn't cover. The workaround is to keep a prompt queued so the main thread also takes a rejection, which isn't discoverable.
**Suggestion**
Treat a subagent quota rejection as an arming trigger when the main thread is idle. At minimum, arm the "press enter to continue" (stale) path so the session isn't silently abandoned. Ideally the continuation prompt should also name the agents that were killed mid-work, so the main loop relaunches them rather than guessing at "continue".
Version: 2.1.241 · Linux
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 tracing the main REPL stream handler and the quota-rejected subscriber described in the 2.1.241 bundle, then compare rejection handling for the main thread and background subagents. Reproduce a session where only subagents hit the usage limit while the main thread is idle. Done means the session arms an auto-continue or stale prompt instead of silently dropping the rejection.
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
- cli
- 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