[Bug]: Usage-limited Claude thread never auto-resumes after subagent failure notifications, and every fix PR was closed unmerged #38497
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
I did find earlier reports. All of them are closed and the bug is still on main, so this issue collects them in one place. The list is at the bottom.
Area#
apps/server
Steps to reproduce#
- Turn on auto-resume for limited threads.
- Start a Claude thread that runs several background subagents.
- Let the thread hit the Claude subscription usage limit while the subagents are still running.
- Each subagent dies on the same limit and sends a "Subagent failed" notification to the parent.
- Wait for the limit to reset.
No live limit is needed to see it in code. On main at f5f8c8d18b, create a thread whose root run fails with a usage_limit error item and a future resetAt. Add a second root run that holds only a notification item and ends completed a few seconds later. getLimitRecoveryCandidates({ autoResume: true }) returns the thread before the second run and nothing after it. @juliusmarminge ran this same test on f03db4fbef and got the same result, see the closing comment on #16815.
Expected behavior#
The thread resumes at the reset time. A notification run that did no work should not cancel the recovery of the run that hit the limit.
Actual behavior#
The thread never resumes. Each notification starts a root run on the idle parent. That run holds one notification item and completes in 30 to 230 ms. It becomes the thread's latest executed run. getLimitRecoveryCandidates, the shell blocked join and usageLimitBlockedRun all require the latest run to be failed, so the limited run drops out. If the thread was not armed yet, it never gets armed. If it was already armed, nothing dispatches limit-resume at the reset. The "Resume at reset" banner disappears too.
Observed on a real 5-hour limit, times in UTC:
| Thread | Limited run | Runs after it | Resumed at the reset |
|---|---|---|---|
| A | fails 02:47:01, reset 04:40 | 5 notification-only runs, completed 02:47:03 to 02:47:16 | No |
| B | fails 02:47:29, armed with autoResume: true | 1 notification-only run, completed 02:47:35 | No |
| C | fails 02:48:05 | none | Yes, 04:40:02 |
Impact#
Major degradation or frequent failure
Overnight runs with subagents are the case auto-resume exists for, and they are the case that breaks. I come back hours later to a thread that sat idle after the reset.
Version or commit#
Code path checked on main @ f5f8c8d18b. Last observed live on 0.1.8-nightly.20261104.4165. Another user reported it on 0.1.9-nightly.20261110.4465 in #32286.
Environment#
macOS (Darwin 27.2.0, arm64), desktop app with its local server, provider claudeAgent, native Claude subagents. #32286 has a Windows x64 report.
Workaround#
Send "continue" by hand after the reset.
Why a new issue#
Every earlier report and every fix is closed, and none of the fixes merged.
Issues:
- #16815, the original report. Closed as not planned on Nov 12 with "could not reproduce", in a comment that also says the added test shows the candidate disappearing.
- #32286, closed as a duplicate of #16815.
- #24232, closed as a duplicate of #16815.
- #36718, same symptom with a failing test, closed as not planned.
Fix PRs, all closed unmerged:
- #17862
- #22775
- #20804, closed for age.
- #31219, mine. Closed as a duplicate of #32454, with a comment saying #32454 is the one being kept.
- #32454. Closed 40 minutes later as a duplicate of #31219, with a comment saying #31219 is the one being kept.
So #31219 and #32454 were each closed in favour of the other, and no open PR is left. I am opening a fresh PR from current main and will link it here.
I tried pinging Maria, Theo and Julius on X about this and got no response anywhere, so I am filing it again here.
tanstack-source added labelsbug
yspreen(GitHub profile, opens in a new tab) linked this to #38498
I tried to reproduce this on the current build and could not.
On origin/main f5f8c8d18b, I re-applied the ProjectionStore test from the earlier #16815 triage (origin/factory/repro-16815, 03cafacd90). It applies cleanly. From apps/server:
vp test run src/orchestration-v2/ProjectionStore.test.ts -t "later wake run that did no work". The test makes a root run fail with a usage_limit error item (code api_error_429, resetAt 4h ahead). getLimitRecoveryCandidates({autoResume:true, snooze:true}) then returns the thread with latestRunId = the limited run, and that assertion passes. The test then adds a second root run that holds only a subagentnotificationitem (outcome failed) and endscompleted2 s later. The same query now returns nothing:AssertionError: expected undefined to not equal undefinedat the afterWake assertion. So no limit-arm or limit-resume would ever be dispatched. The failing test is pushed as factory/repro-38497 (03b618f759). I could not watch it in a running app: it needs a real Claude subscription usage limit with native subagents failing on it, which no VM has. The Replay dev provider has no usage_limit failure path.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
juliusmarminge closed this
Sign in to join this conversation.
Fix PR: #38498. It is #31219 reapplied on current
main.