Skip to content

Usage-limit auto-resume continues delegated children, then the resumed parent re-prompts them too #40495

Closed as not planned

Description

@Bishi

What happened

When a usage limit hits a thread that has delegated agents, at the reset T3 Code sends "Continue where you left off." to the main thread AND to each delegated child thread. The resumed main agent then sends its own "continue" prompt to each child as well, so every child gets two continue prompts (the second arrives as a steer on a run that is already going).

Diagnosis

Read from statev2.sqlite and mapped to the v0.1.11 source.

  1. A child fails on the limit. The parent gets a delegated-completion wake that says only "[failed]: Claude API rate limit reached. Try again later." It does not say that a usage-limit resume is already scheduled for that child (the child's thread has limitRecovery with autoResume: true).
  2. At the reset, UsageLimitRecoveryWorker dispatches a limit-resume: "Continue where you left off." to every candidate thread on its own: the parent and both children within 0.5 s. The candidate query (ProjectionStore.getLimitRecoveryCandidates) and limitRecoveryCommand do not consider whether a thread is a delegated child whose parent is also resuming.
  3. The resumed parent still believes its children failed, so it reasonably re-prompts them via MCP ~20 s later.

Either the parent should own the resume of its delegated children (skip children whose parent is also armed and let the parent decide), or the parent's failure wake / resume context should say that the child will resume on its own at the reset.

Steps to reproduce

  1. Turn on auto-resume for usage-limited threads.
  2. In a Claude thread, start 2 delegated tasks with delegate_task on the same Claude account.
  3. Let the account hit its 5-hour limit while the parent and children run (all fail with usage_limit; the parent gets "[failed]: Claude API rate limit reached" wakes).
  4. Wait for the reset.
  5. Each child receives "Continue where you left off." from T3 Code, then a second "the rate limit has reset, so continue…" message from the parent agent.

Version

0.1.11 (local server reports 0.1.11)

Environment

Windows 10 Pro 19045 x64, Node v26.13.1, Claude Agent provider (parent and children), auto-resume of limited threads on

Evidence

User messages, 2026-11-21 UTC (ids shortened):
18:36:29 parent  server  delegated-completion: child <c2> [failed]: Claude API rate limit reached. Try again later. (resets 8pm)
19:00:01.448 parent  server  "Continue where you left off."   (limit-resume)
19:00:01.623 <c2>    server  "Continue where you left off."   (limit-resume)
19:00:01.884 <c1>    server  "Continue where you left off."   (limit-resume)
19:00:22.959 <c1>    mcp     "The rate limit has reset, so continue. ..."   (from parent agent)
19:00:25.031 <c2>    mcp     "The rate limit has reset, so continue. ..."   (from parent agent)

Both children had limitRecovery {resetAt: 2026-11-21T19:00:00Z, autoResume: true} armed.
Same pattern at the earlier 14:00 UTC reset on the same parent.

Related issues

#30144 (armed child resume runs after parent is settled) and #31057 (children resume on limited account after parent moved) are about child resumes too, but not the parent+server double resume of the same child.

Fix applied or workaround

None applied. Possible: turn off auto-resume of limited threads (also stops the parent resuming), or instruct the parent agent not to re-prompt limited children.

Filed by

Claude Code (claude-opus-5-5) via t3 triage

Activity

  1. juliusmarminge commented on Nov 21, 2026

    @juliusmarminge
    Member

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

    Commit fcf5097 (origin/main). A real Claude usage limit is not available on the VMs, so I could not run the app end to end. I ran the real server pipeline instead: a scratch copy of apps/server/src/mcp/TaskCancelUsageLimit.integration.test.ts with the real OrchestratorV2, effect worker, OrchestratorMcpService and UsageLimitRecoveryWorker (autoResumeLimitedThreads: true), plus a fake Claude adapter. Steps: the parent thread starts a turn and delegates a task with delegated_task.request (completionWake 'always'). The child's turn ends with turn.terminal failure {class: usage_limit, resetAt: now+1m}. Then the parent's own turn ends with the same usage_limit and resetAt. I ran the recovery sweep (both threads armed), advanced TestClock 1 minute and ran the sweep again. Result: the same sweep dispatched limit-resume 'Continue where you left off.' to both the parent (limit-resume:thread:task-cancel-limit-parent:...) and the child (limit-resume:thread:delegated-task:delegate:...). The parent's subagents list held the original task with result 'Claude usage limit reached.' and nothing else: no word that T3 Code would resume the child at the reset. It also held a new follow-up task with result null, created by the child's server-side resume. The reporter's second half, the resumed parent agent re-prompting the children through MCP, is model behaviour and needs a real limited Claude account, which no worker has.

    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.

  2. Bishi commented on Nov 21, 2026

    @Bishi
    Author

    Thanks for running it. Your result reproduces the part T3 Code controls: one sweep resumes both the parent and the
    child, and the parent's view of the child says only "Claude usage limit reached." with no word that T3 Code will
    resume it at the reset.

    The re-prompt isn't hypothetical. The Evidence section is from a real limited Claude account on 0.1.11 (Windows): each
    child got the server's limit-resume at 19:00:01, then the resumed parent sent "The rate limit has reset, so
    continue…" through MCP to each child at 19:00:22 and 19:00:25. Same thing at the earlier 14:00 UTC reset on the same
    parent. The screenshot below is one of the child threads: T3 Code's "Continue where you left off." followed by the
    parent's steer on the already-running turn. Any parent that reads "[failed]: rate limit reached" and isn't told about
    the auto-resume will reasonably do this.

    The fix doesn't need a live limit to verify. Either have the parent's view of a usage-limited child say it will
    auto-resume at resetAt (your test can assert that), or skip auto-resuming a child whose parent is also armed and let
    the parent decide. Also note that open PR #31083 tells the parent to resume limited children itself, which would make
    this more common unless it mentions the auto-resume.

    Could you reopen?

    2026-11-21 20_35_00
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

    via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions