You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: A recurring scheduled task keeps starting turns on a usage-limited thread, sending a failure notification every occurrence #44755
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
Bind a recurring scheduled task (for example every 30 minutes) to a thread.
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).
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.
Activity