Skip to content

[Bug]: A recurring scheduled task keeps starting turns on a usage-limited thread, sending a failure notification every occurrence #44755

Backlog

Description

@vitalyiegorov

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

  1. Bind a recurring scheduled task (for example every 30 minutes) to a thread.
  2. Let the thread's latest run fail with a provider usage limit that reports a reset time in the future (for example a Claude weekly limit with resetAt a day away).
  3. Leave the thread idle and wait for the next occurrences.

Expected behavior

While the thread's provider is out of usage, occurrences are skipped quietly and the schedule moves on. The first occurrence after the reset (or after the thread is switched to another account) sends normally.

Actual behavior

Every occurrence starts a new turn on the limited account. The turn fails about 1.5 seconds later with the same usage limit, and each failure sends a "thread failed" push to the phone and a desktop popup. A 30-minute task produced 25 failed runs and 25 notifications in 12 hours on one thread.

The queue already refuses to start automatic work behind a usage limit (usageLimitHoldsQueue in Orchestrator.startNextQueuedRun). A scheduled send to an idle thread never goes through the queue, though. With no active run to queue behind, message.dispatch starts it at once, and the scheduler's only pre-send check (queuedOccurrence in ScheduledTaskService.runTask) looks for an earlier queued occurrence, not for a limit.

Impact

Major degradation or frequent failure

Version or commit

main @ 68bb7b7

Environment

Linux, desktop server, Claude provider (weekly limit reached), recurring interval task bound to a thread in fresh-session mode.

Logs or stack traces

# runs on the bound thread (ordinal, status, requested_at, completed_at)
1930|failed|2026-11-28T06:06:41.226Z|2026-11-28T06:06:42.680Z
1929|failed|2026-11-28T05:36:40.687Z|2026-11-28T05:36:41.779Z
1928|failed|2026-11-28T05:06:40.175Z|2026-11-28T05:06:41.604Z
...
1906|failed|2026-11-27T18:06:01.844Z|2026-11-27T18:06:03.746Z

# each run's terminal error item
{"class":"usage_limit","message":"Claude API rate limit reached. Try again later.","code":"api_error_429","retryable":true,"resetAt":"2026-11-29T15:00:00.000Z"}

Workaround

Pause the scheduled task until the limit resets, or switch the thread to another account.

Activity

  1. added
    vouch:trusted
    on Nov 28, 2026
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

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions