Repository navigation
feat: retry gating, quarantine, and relaxed model-key regex - #29
Open
Oren-Schmerling wants to merge 2 commits into
Open
Oren-Schmerling wants to merge 2 commits into
Oren-Schmerling wants to merge 2 commits into
Conversation
Oren-Schmerling
marked this pull request as draft
October 21, 2026 03:37
Oren-Schmerling
marked this pull request as ready for review
October 22, 2026 00:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds retry gating, post-fallback quarantine, and the relaxed model-key regex (folded in from #28) so a single merge makes all permanent.
Relaxed model-key regex (from #28)
Model IDs may contain dots, tildes, colons, and extra slashes:
/^[a-zA-Z0-9_-]{1,100}\/[a-zA-Z0-9._~\/:-]{1,200}$/Accepts
openrouter/openrouter/free,openrouter/~deepseek/deepseek-flash-latest,openrouter/anthropic/claude-3.5-sonnet,local/qwen3:32b. Previously these were rejected, which dropped entire agent fallback chains (agentCount: 0) and caused sessions to stall on quota errors.Retry gating (
retriesBeforeFallback)Default 0. With N, the first N retry attempts defer fallback; attempt N+1 falls back. Missing attempt falls back immediately.
Quarantine (
quarantineAfterFallbackMs)Default 0 (disabled). After any fallback the model left behind is quarantined for the duration: excluded from fallback selection, preemptively redirected away from, and shown with a countdown in
fallback-status.Config
{ "defaults": { "retriesBeforeFallback": 3, "quarantineAfterFallbackMs": 21600000 } }Verification
bun test— see CItsc --noEmit— 0 errors