Skip to content

[Bug]: Usage-limited Claude thread never auto-resumes after subagent failure notifications, and every fix PR was closed unmerged #38497

Closed as not planned

Description

@yspreen

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

  1. Turn on auto-resume for limited threads.
  2. Start a Claude thread that runs several background subagents.
  3. Let the thread hit the Claude subscription usage limit while the subagents are still running.
  4. Each subagent dies on the same limit and sends a "Subagent failed" notification to the parent.
  5. 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:

Fix PRs, all closed unmerged:

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.

Activity

  1. yspreen commented on Nov 18, 2026

    @yspreen
    Author

    Fix PR: #38498. It is #31219 reapplied on current main.

  2. juliusmarminge commented on Nov 18, 2026

    @juliusmarminge
    Member

    I tried to reproduce this on the current build and could not.

    On origin/main f5f8c8d, I re-applied the ProjectionStore test from the earlier #16815 triage (origin/factory/repro-16815, 03cafac). 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 subagent notification item (outcome failed) and ends completed 2 s later. The same query now returns nothing: AssertionError: expected undefined to not equal undefined at the afterWake assertion. So no limit-arm or limit-resume would ever be dispatched. The failing test is pushed as factory/repro-38497 (03b618f). 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions