Skip to content

feat(routing): sticky hold on whichever quota window blocks the request (OpenCode 1, Pi) - #470

Merged
ualtinok merged 2 commits into
mainfrom
fix/sticky-hold-any-window
Oct 24, 2026
Merged

ualtinok merged 2 commits into
mainfrom
fix/sticky-hold-any-window

Conversation

@antauth-alfonso

Copy link
Copy Markdown

Ufuk ruled the plugin's standalone sticky-balanced hold follows the shared routing rule. decideStickyQuotaFailure now looks at every exhausted window that blocks the requested model (5h, 7d, the model's scoped window); the blocking reset is the latest of them. Hold when that reset is known and within 15 minutes (same per-session jittered Retry-After); otherwise, or with any unknown reset, move. OpenCode 1 and Pi use it now, with generalized hold messages. OpenCode 2 does not hold yet: common-auth's retry contract has no same-account delay; OAIAUTH is adding it. Red-first tests per window and host; mutation rows for "7d always moves" and the latest-reset rule.

Use the latest known future reset across every exhausted window blocking the requested model. Preserve retain decisions and deterministic jitter, and report the window responsible for each hold or migration.

Generalize OC1 and Pi messages and add red-first per-window coverage. Parameterizing the existing OC1 test preserves its original five-hour hold, transient-failure retention, and far-reset migration assertions while adding weekly and model-scoped cases. OC2 remains unchanged pending the common-auth retry-delay contract.
Add seven-day-always-migrate and first-reset-only controls beside the Core routing rows, including full-package broad audit settings. Both exact named tests are CAUGHT through the pinned ckdev-mutate 0.12.5 runner and Bun wrapper.
@ualtinok
ualtinok merged commit fd42b79 into main Oct 24, 2026
20 checks passed
@ualtinok
ualtinok deleted the fix/sticky-hold-any-window branch October 24, 2026 12:06
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