[Bug]: "Resume at reset" never fires: banner shows "Cancel auto-resume" but the thread is not resumed after the usage limit resets #17808
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#
- Run a Claude thread until the account hits its 5-hour session limit. The run fails with
usage_limitand the composer shows Usage limit reached · Resets 6:50 PM. - Click Resume at reset. The button changes to Cancel auto-resume.
- Wait past the reset time.
The backend (t3 serve, separate process) had been running for 31 hours. This happened to 5 threads at once. I have not reproduced it on demand.
Expected behavior#
Within a few seconds of the reset, UsageLimitRecoveryWorker dispatches Continue where you left off. and the thread runs again.
Actual behavior#
Nothing happened on any of the 5 threads for 37 minutes after the reset, until I continued them by hand:
- No run was created for those threads between the reset (11:50:00Z) and my manual
continue(12:28Z). - No message with a
limit-resume:id exists anywhere in this backend'sstatev2.sqlite. Auto-resume has never fired on this install. - The backend log has no
orchestration-v2.limit-recovery.dispatch-failedand noScheduler source failed.
What I checked#
- Each thread's last run was
failed, with a root error itemfailure.class = "usage_limit"andfailure.resetAt = "2026-10-10T11:50:00.000Z". There were no pending runtime requests, no unfinished older runs, and the sessionlastErrorwas null. - I copied one thread's rows into a scratch database, restored the pre-reset state with
limitRecovery = { runId: <failed run>, resetAt: "2026-10-10T11:50:00.000Z", autoResume: true }, and ran the SQL fromgetLimitRecoveryCandidates. It returns nothing at 11:49Z and returns the thread at 11:50:05Z. The query is fine. - The shared scheduler loop was alive: the
scheduled-taskssource ran a fixed-time task on time at 02:00Z the same day.
Suspected cause (not proven)#
In apps/server/src/scheduling/Scheduler.ts, each source runs under permit.withPermitsIfAvailable(1). If one usage-limit-recovery sweep never completes (a getLimitRecoveryCandidates read or a threads.dispatch that never returns), the permit stays held. Every later 5-second tick then skips the source without a log until the backend restarts. The other explanation is that the stored recovery choice was lost before the reset. The sweep leaves no trace either way, so I could not tell these apart. Recovery state only survives as the current projection; orchestration_v2_events was empty.
Suggested fix#
- Put a deadline on each sweep so a stuck run cannot hold the permit forever, and log when a source has been skipped for more than N ticks because its previous run is still going.
- Emit a span or debug log per sweep: candidate count, and the reason
limitRecoveryCommandreturnednullfor each candidate. - Optional: show "Auto-resume overdue" in the banner when
autoResumeis set and the reset passed more than a minute ago, with a Resume button.
Impact#
Major degradation or frequent failure
Version or commit#
T3 Code (Nightly) 0.0.46-nightly.20261008.2819, desktop AppImage and t3 serve backend on the same version. Scheduler.ts and UsageLimitRecoveryWorker.ts look the same in 0.0.46-nightly.20261009.2861.
Environment#
Arch Linux 6.19, Hyprland (Wayland), desktop app connected to a separate local backend, orchestrator v2, Claude Agent provider with several Claude provider instances.
Logs or stack traces#
09:00Z-09:28Z runs fail with usage_limit, failure.resetAt 2026-10-10T11:50:00.000Z
(before reset) "Resume at reset" clicked; banner shows "Cancel auto-resume"
11:50:00Z reset passes; no limit-resume dispatch, no warning logged
12:27:27Z I restart the desktop app (backend keeps running)
12:28:19Z-12:28:48Z I send "continue" by hand in each thread; all run normally
Workaround#
Send a message by hand after the reset.
Edit: the first version of this issue said Send and Resume did nothing until the desktop app restarted. That was my misreading of the logs. Auto-resume at reset is what failed. I can't say whether a manual send would have worked before the restart.
B-EtterDigital(GitHub profile, opens in a new tab) changed the title
Follow-up with new evidence. It makes the "stuck sweep holds the scheduler permit" theory above unlikely:
- None of the 252 rows in
orchestration_v2_projection_threadshas alimitRecoverykey, not even a stale one. Other optional fields are kept (pinnedAt,titleRegeneration,unsettledAt, …). - I found no code path in 2819 that clears
limitRecoveryonce it is set. New runs, provider switches and visits all spread the stored thread. - The backend (
t3 serve) ran without a restart from 2026-10-09 05:24Z until after the incident, so no migration or rebuild rewrote the rows.
So when the reset passed, the sweep had no stored choice to act on, although the banner showed "Cancel auto-resume". I could not find out whether the choice was never written or was overwritten later.
I also checked the plain path on 0.0.46-nightly.20261009.2861. A runtime-layer test sends the banner's exact
thread.metadata.updatepayload, visits the thread and moves the clock past the reset.getLimitRecoveryCandidatesthen returns the thread. The plain path works there.Two silent paths that would explain a missed resume and are worth logging:
- The thread fails again before the reset, for example on a queued message. The choice stays on the older run, and the sweep skips it unless the global auto-resume setting is on. The banner falls back to "Resume at reset".
- The
usageLimitContinuationOfRunIdguard in the orchestrator acknowledges a declined continuation without any log, for example when the thread's provider instance changed.
Happy to share the test if useful.
- None of the 252 rows in
juliusmarminge added labelsneeds more info
juliusmarminge removed labelsneeds more info
tanstack-source added labelsbug
@B-EtterDigital Between clicking "Resume at reset" and the reset time, did anything else happen on those five threads? For example a queued or sent message, a background-task or notification wake that started a run, a provider or account switch, settling or snoozing, or another client (desktop, web or mobile) connected to the same backend. And was the statev2.sqlite you inspected the one in the
t3 servehome that the desktop app was actually connected to?juliusmarminge added labelsneeds more info
Closing: no reply in 7 days after we asked for more information. Comment with the missing details and we will reopen.
juliusmarminge closed this
Sign in to join this conversation.
Corrected the report. Auto-resume at reset is what failed: the "Resume at reset" choice was set, the banner showed "Cancel auto-resume", and the backend never dispatched the resume. The first version blamed the composer send guard, which the evidence does not support. Title and body are updated with the scheduler findings.