Skip to content

Conserve low coding credits across Auto routes and retries - #505

Merged
BunsDev merged 6 commits into
mainfrom
credit-routing
Nov 12, 2026
Merged

BunsDev merged 6 commits into
mainfrom
credit-routing

Conversation

@BunsDev

@BunsDev BunsDev commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

When CLI-reported credits or allowance run low, Auto now conserves usage with configurable 20% allowance / 10 provider-credit-unit thresholds, the least expensive suitable model tier, capped effort and standard speed. Account-bound quota reads stay inside the installed CLIs; coding continues through those CLIs.

Every automatic model or account replacement rechecks the actual account quota, catalogue and task capability requirement before coding. Enabled Claude rotation can skip exhausted fresh-thread accounts; replacements share the original premium admission, account-scoped cooldowns avoid cross-account contamination, and conservation avoids a separate paid naming turn. Unknown balances remain explicit; affirmative credit availability is usable without inventing an amount.

An independent efficiency review found four integration defects, each reproduced and repaired with a behavioral regression. Local qualification on integrated runtime f682cdf: build and typechecks passed; 216 focused tests passed; the full unit suite passed 2,530 cases with 36 explicit skips; desktop UI passed 518 cases with 11 explicit skips; all seven site cases passed. Installed Codex 0.167.2 supplied metadata with zero inference turns. The final documentation commit records those receipts without changing runtime code.

Efficiency uses model tiers, effort, quota headroom and cache reuse because the CLIs do not expose token prices. Exact dollar savings, live billing/coding and installed-release acceptance are not claimed. See docs/reviews/2026-11-12-credit-conservation-delivery.md for the review repairs and qualification boundaries.

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Nov 12, 2026 9:29am UTC

Request Review

@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

main 0e4e212 credit-routing d9ed72d +/-
66% 66% 0%
View coverage of the 10 most impacted files.
File main 0e4e212 credit-routing d9ed72d +/-
apps/desktop/sr...ngine/runner.ts 98% 98% 0%
apps/desktop/sr...kends/claude.ts 98% 98% 0%
apps/desktop/sr...ckends/codex.ts 97% 97% 0%
apps/desktop/sr...ccount-codex.ts 92% 92% 0%
apps/desktop/sr...ckends/types.ts 100% 100% 0%
apps/desktop/sr...tion-binding.ts 100% 100% 0%
apps/desktop/sr...ng/decisions.ts 100% 100% 0%
apps/desktop/sr...uting/policy.ts 99% 100% +1%
apps/desktop/sr.../routing/jev.ts 90% 96% +6%
apps/desktop/sr...outing/quota.ts 0% 100% +100%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@BunsDev
BunsDev added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 8059acc Nov 12, 2026
13 checks passed
@BunsDev
BunsDev deleted the credit-routing branch November 12, 2026 10:41

This branch was successfully deployed

1 active deployment
Preview — d9ed72dd Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant