Repository navigation
Description
Problem
When a primary provider's weekly quota is exhausted (e.g., Codex at 0% remaining returning exceeded retry limit, last status: 429 Too Many Requests), autonomous work stops across both scheduled tasks and active threads even when other providers on the same T3 server (e.g., Claude, Antigravity) have full quota remaining and fallbackModelSelection is configured.
Today, fallbackModelSelection (packages/contracts/src/settings.ts) is only consulted for implicit new threads via resolveNewThreadModelSelection (packages/shared/src/usageLimits.ts). Two high-impact paths still leave threads stuck as Limited:
-
Unbound scheduled tasks bypass both
fallbackModelSelectionandThreadMessageIntake:- In
apps/server/src/scheduledTasks/ScheduledTaskService.ts(active.threadId === null), scheduled task execution callsthreadLaunch.launch({ modelSelection: active.modelSelection, ... })directly rather than going throughThreadMessageIntake.launchThreador checkingresolveNewThreadModelSelection. - As a result, every scheduled fire continues launching on the exhausted provider—and even with PR feat: continue on another account with usage left when one runs out #28595 (
fallbackToAvailableAccountsinThreadMessageIntake), unbound scheduled tasks would still bypass fallback unlessScheduledTaskServiceroutes through the same fallback resolver (or supports a per-task fallback / "follow server default + fallback" mode). - (Note: Scheduled tasks bound to a thread should be able to follow the thread's current model instead of pinning one #34148 fixed bound scheduled tasks reverting a thread's model after a manual switch, which helps once a human switches the thread—but unbound scheduled tasks and untouched bound threads still hit the exhausted provider first.)
- In
-
No opt-in automatic failover to
fallbackModelSelectionon terminalusage_limitfailures (especially whenresetAtis missing):- When a run ends with
failure.class === "usage_limit"andresetAt: null(common for Codex retry exhaustion / proxied 429s), neither "Resume at reset" norfallbackModelSelectionrecovers the thread. - PR feat: continue on another account with usage left when one runs out #28595 moves this forward via
fallbackToAvailableAccountsinUsageLimitRecoveryWorker, but it requires providers that report live usage bars to T3 and only looks back 10 minutes. Users who have configured an explicitfallbackModelSelection(e.g., Codex → Claude or Antigravity) also benefit from an opt-in server/task setting to transiently fail over tofallbackModelSelectionon terminalusage_limit(using the existingthread.model-selection.set+ContextHandoffServicepath) without permanently overwriting the task's preferred model once quota resets.
- When a run ends with
Requested Behavior
- Scheduled tasks: Before dispatching an unbound scheduled task (or a bound task whose current thread provider is known exhausted), honor the server's configured
fallbackModelSelection(andfallbackToAvailableAccountsif feat: continue on another account with usage left when one runs out #28595 lands), transiently for that run so the task returns to its preferred model once usage resets. Optionally allow a scheduled task to opt out (pinModel: true) or specify a task-level fallback. - Terminal
usage_limitfailover: AllowUsageLimitRecoveryWorker(behind an opt-in server setting, or unified with feat: continue on another account with usage left when one runs out #28595'sfallbackToAvailableAccounts) to fall back tofallbackModelSelectionwhen the failing provider hits terminalusage_limit—even whenresetAtis absent—bounded to a single hop per failed turn and respecting concurrent user stops/edits atomically inside the orchestrator.
Related Issues & PRs
- feat: continue on another account with usage left when one runs out #28595 —
feat: continue on another account with usage left when one runs out(coversThreadMessageIntake+UsageLimitRecoveryWorker, does not touchScheduledTaskService.ts) - fix(server): delegated tasks without a target use the configured fallback model #34861 / MCP delegated tasks bypass the configured fallback model #28203 —
MCP delegated tasks bypass the configured fallback model - fix(server): Codex retries on HTTP 429 count as usage limits #30376 —
fix(server): Codex retries on HTTP 429 count as usage limits - Scheduled tasks bound to a thread should be able to follow the thread's current model instead of pinning one #34148 (closed) —
Scheduled tasks bound to a thread should be able to follow the thread's current model instead of pinning one
Activity
juliusmarminge commentedon Nov 23, 2026
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.