Repository navigation
Stop before paid usage: an opt-in, per-provider switch so agents never fall back to extra usage or credits #38080
vidhatrashukla
started this conversation in
Ideas
Replies: 1 comment
|
Hey I'd love this switch too, I've unintentionally used credits or paid billing before, plus if it stops right at the included limit, compacting active threads right beforehand while caches are still warm avoids an extra ~150K to >1M token cold replay hit after reset. I put up a proposal for that piece in #44039, trading a tiny bit of headroom early to skip the cold hit. Lmk what you think if it fits with what you're picturing here. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
When a subscription plan's included usage runs out, several providers keep going on pay-as-you-go billing:
Each provider has its own setting, in its own account page, and they all work differently. A long agent run or a scheduled task can cross the plan limit unattended and keep spending. T3 already sees most of the signals, but it treats them as display-only. For example, Claude turns that report overage are deliberately allowed to continue.
Proposal
Add a Stop before paid usage switch to each provider instance, off by default:
usage_limitfailure with the plan's reset time. That means T3's existing Resume at reset / Snooze until reset flow handles it, and the thread waits for the plan instead of paying. The banner says "Stopped before paid usage", so it doesn't look like an outage.This is a best-effort guard, not a hard spend cap. T3 can only act on what the provider reports.
What each provider exposes
account/rateLimits/read→ordinaryUsageAllowed,credits.hasCredits,spendControlReached;account/rateLimits/updatedwhile a turn runsrate_limit_event→overageStatus,isUsingOverage,overageInUsecostin the model list (paidopencode/*models bill Zen credits)Prototype
I built a prototype for Claude and Codex on a branch in my fork:
vidhatrashukla/t3code@main...vidhatrashukla:t3code:feat/stop-before-paid-usage
stopBeforePaidUsagein the Claude and Codex instance schemas. It renders in the provider form automatically.ProviderAdapterTurnRefusedErrorlets a refused turn keep itsusage_limitclass instead of becoming a genericprovider_error.account/rateLimits/readbefore each turn and compaction. A confirming read on an exhaustedaccount/rateLimits/updated, then the root and all native child turns are interrupted.Live check on a real Codex Pro account with the plan used up and credits available:
turn/start. The server sent no model requests at all.Known limits
Per CONTRIBUTING, I haven't opened a PR. If you'd like this, I'm happy to open one from the branch, cut it down to whatever scope you prefer, or add OpenCode Zen next.
All reactions