Skip to content

Commit 9f98767

Browse files
authored
Merge pull request #12 from gitcommit90/fix/exhaust-fallback-route
Route until a usable upstream response
2 parents 1e17164 + 0cc90d0 commit 9f98767

6 files changed

Lines changed: 453 additions & 70 deletions

File tree

docs/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ The router supports:
8585
- `fallback`: members are attempted in their configured order.
8686
- `round-robin`: each request rotates the starting member, then retains fallback behavior through the remaining members.
8787

88-
Timeouts, `408`, `429`, `5xx`, and provider/model capability incompatibilities such as an unsupported model can advance fallback. Capability failures do not create account cooldown locks. The per-member timeout defaults to 60 seconds. An explicit route stops immediately on other non-retryable failures; a later account lock cannot replace that terminal response.
88+
Named routes and OAuth account pools continue through every untried target until an upstream returns a usable `2xx` response. Any non-`2xx` status advances fallback regardless of error type. A `2xx` response that contains an immediate stream error, ends without usable output, has no response body, contains invalid JSON, or carries an explicit error payload also advances fallback. Failure classification controls account cooldown locks and diagnostics; it never stops routing. Capability failures do not create account cooldown locks. The per-member timeout defaults to 60 seconds. Caller cancellation stops immediately, and a stream cannot be transparently rerouted after output has already reached the client.
8989

9090
OAuth providers add an account-pool layer beneath model routing. Accounts receive monotonic, never-reused aliases (`oauth1`, `oauth2`, ...). Model discovery advertises one canonical pooled id such as `chatgpt/gpt-5.4`; account-qualified ids such as `chatgpt/oauth2/gpt-5.4` and legacy stored-account ids remain resolvable but are not advertised. Quota failures create an account-wide lock using provider reset hints when available; authentication and transient failures use shorter model-scoped cooldowns. Early streaming quota events are inspected before the client stream starts so fallback can still occur. Selection, failure, fallback, locked-account skips, and terminal exhaustion are written as structured logs.
9191

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@gitcommit90/rerouted",
33
"productName": "ReRouted",
4-
"version": "0.5.0",
4+
"version": "0.5.1",
55
"description": "A local AI router for connected accounts, models, named routes, and automatic fallback.",
66
"author": "gitcommit90",
77
"license": "MIT",

0 commit comments

Comments
 (0)