Repository navigation
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.
fix(vision-bridge): lock unsupported models on 400 #18271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
fix(vision-bridge): lock unsupported models on 400 #18271
Changes from all commits
07a2c7dc4d1a79a42d4fd867cc6e76565d920d4e2f451e787File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: cheaper-inference/OmniRoute
Length of output: 7648
Script executed:
Repository: cheaper-inference/OmniRoute
Length of output: 32120
Script executed:
Repository: cheaper-inference/OmniRoute
Length of output: 43657
Script executed:
Repository: cheaper-inference/OmniRoute
Length of output: 12743
Use an exact lock for Antigravity model-scoped 400 responses.
The vision bridge calls
lockModeldirectly. For Antigravity, this can lock the rejected model's entire quota family for one hour. Keep the existing quota-family behavior for Codex.Suggested fix
import { isModelScoped400 } from "@omniroute/open-sse/services/modelAccessDenied.ts"; -import { lockModel } from "@omniroute/open-sse/services/accountFallback.ts"; +import { lockExactModel, lockModel } from "@omniroute/open-sse/services/accountFallback.ts"; +import { isAntigravityQuotaProvider } from "@omniroute/open-sse/services/antigravityQuotaFamily.ts"; ... const separator = config.model.indexOf("/"); if (connectionId && separator > 0) { - lockModel( - config.model.slice(0, separator), + const provider = config.model.slice(0, separator); + const model = config.model.slice(separator + 1); + (isAntigravityQuotaProvider(provider) ? lockExactModel : lockModel)( + provider, connectionId, - config.model.slice(separator + 1), + model, "model_capacity", 60 * 60 * 1000 );There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: cheaper-inference/OmniRoute
Length of output: 8588
Script executed:
Repository: cheaper-inference/OmniRoute
Length of output: 22493
Scope the fixed-model lockout check to the caller's permitted connections.
isFixedModelSelectablechecks the key-scoped credential result, butisModelUsableGivenLockoutsdoes not receive the key's allowed connection IDs.getUsableConnectionsForModelreturns every usable connection for the provider, andcollectLockoutConnectionIdsadds every locked connection. An unlocked connection outside the key's allowed set can therefore make the check returntruewhile every permitted connection is locked. The bridge then keeps the rejected fixed model. The describe request goes through the key-scoped self-loop and fails on the locked permitted connection, so the fallback path does not run.Pass the key's allowed connection IDs into the lockout check, and limit the candidate IDs to that set. Apply the same filter to the lockout IDs as to the usable connections. Leave unrestricted keys on the current path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: cheaper-inference/OmniRoute
Length of output: 8574
Script executed:
Repository: cheaper-inference/OmniRoute
Length of output: 14691
Script executed:
Repository: cheaper-inference/OmniRoute
Length of output: 4605
Script executed:
Repository: cheaper-inference/OmniRoute
Length of output: 2791
Resolve compatible-node IDs in the lockout connection lookup.
For a public-prefix model,
hasUsableCredentialsForModelchecks the mapped node ID.getUsableConnectionsForModelchecks only the literal prefix. A 400 lock on one node connection therefore leaves the lockout check with only that locked connection.isFixedModelSelectablethen rejects the fixed model for one hour, even when another connection under the node ID is usable.Query each provider ID from
resolveProviderCredentialIds(provider, prefixToNode)ingetUsableConnectionsForModel, ashasUsableCredentialsForModelalready does. Merge the usable connections from those queries before the lockout check runs.Uh oh!
There was an error while loading. Please reload this page.