[Bug]: An armed usage-limit resume still runs a delegated child after its parent is settled, and reopens the parent #30144
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
- From a parent thread, start a delegated task with
delegate_taskon a Claude account near its usage limit, with Resume after usage limits on. - The child fails on the usage limit. Its failure reads only "Claude API rate limit reached. Try again later.", names no
limit-resume:id, andt3_queueon the child thread is empty. A resume is armed for the reset anyway. - Replace the work with a new
delegate_taskon another account. Let it finish and merge. - Settle the parent thread.
- Wait for the first account's reset.
Expected behavior#
Settling a thread puts away its work: an armed usage-limit resume of a delegated child of a settled parent is cancelled, or skipped when it fires, and the parent stays settled.
Actual behavior#
At the reset the armed resume starts the superseded child. When it finishes, the delegated-completion wake reopens the settled parent and starts a new run on it.
Observed twice on one parent thread, on 0.1.7-nightly.20261101.4016 (macOS desktop):
| Child | Failed | Resume fired (from its limit-arm: id) |
|---|---|---|
| Account F builder | 30 Oct | 3 Nov 03:00 UTC |
| Account A builder | 30 Oct | 3 Nov 12:00 UTC |
Each resumed child found its work already merged by its replacement and changed nothing, but each completion reopened the parent.
#27951 stops arming new recoveries for children of settled parents, and says its resume branch is unchanged: "a recovery that was already armed for the child's latest failed run still resumes at its reset." These resumes were armed when each child failed, while the parent was still open, so that branch is the one that runs them. #21091's fix covers task_cancel, so the only workaround today is to cancel the original task at the moment it is replaced.
Settling a parent could cancel the armed recoveries of its delegated children, or the resume branch could apply the same settled-parent check before it dispatches.
Impact#
Major degradation or frequent failure
Version or commit#
0.1.7-nightly.20261101.4016
Environment#
macOS, T3 Code desktop (Nightly), Claude Agent provider on several accounts
tanstack-source added labelsbug
Sign in to join this conversation.