mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-19 13:23:50 +03:00
fix(antigravity): canonicalize tiered flash quota (#13809)
Co-authored-by: ginettododo <117327638+ginettododo@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5de6c5108b
commit
03c1f7545a
@@ -126,10 +126,29 @@ export function selectAntigravityQuotaWindowNames(
|
||||
? ["claude_gpt_weekly"]
|
||||
: [];
|
||||
|
||||
const exactWindows = quotaNames.filter((windowName) => {
|
||||
let exactWindows = quotaNames.filter((windowName) => {
|
||||
const bare = windowName.replace(/^(antigravity|agy)\//, "");
|
||||
return bare === bareModel;
|
||||
});
|
||||
|
||||
// Live Antigravity discovery can expose a stable public Flash id while quota
|
||||
// telemetry is keyed by the technical `-tiered` upstream id. Only fall back
|
||||
// to that technical bucket when the exact public bucket is absent, so an
|
||||
// unrelated Gemini sibling can never dilute exact-model exhaustion. This is
|
||||
// intentionally version-agnostic for newly discovered Gemini Flash releases.
|
||||
if (exactWindows.length === 0) {
|
||||
const flashMatch = bareModel.match(
|
||||
/^(gemini-\d+(?:\.\d+)*-flash)(?:-(?:high|medium|low))?$/
|
||||
);
|
||||
if (flashMatch) {
|
||||
const technicalTieredModel = `${flashMatch[1]}-tiered`;
|
||||
exactWindows = quotaNames.filter((windowName) => {
|
||||
const bare = windowName.replace(/^(antigravity|agy)\//, "");
|
||||
return bare === technicalTieredModel;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const aggregateWindows = familyAggregates.filter((key) => quotaNames.includes(key));
|
||||
const scoped = [...exactWindows, ...aggregateWindows];
|
||||
if (scoped.length > 0) return scoped;
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
import { selectAntigravityQuotaWindowNames } from "../../open-sse/services/antigravityQuotaFamily.ts";
|
||||
|
||||
test("public Gemini Flash scopes to the matching technical tiered quota window", () => {
|
||||
assert.deepEqual(
|
||||
selectAntigravityQuotaWindowNames(
|
||||
["gemini-3.8-flash-tiered", "gemini-pro-agent"],
|
||||
"antigravity/gemini-3.8-flash"
|
||||
),
|
||||
["gemini-3.8-flash-tiered"]
|
||||
);
|
||||
});
|
||||
|
||||
test("technical tiered Flash quota is retained alongside the Gemini family aggregate", () => {
|
||||
assert.deepEqual(
|
||||
selectAntigravityQuotaWindowNames(
|
||||
["gemini-3.8-flash-tiered", "gemini-pro-agent", "gemini_weekly"],
|
||||
"gemini-3.8-flash"
|
||||
),
|
||||
["gemini-3.8-flash-tiered", "gemini_weekly"]
|
||||
);
|
||||
});
|
||||
|
||||
test("an exact public Flash quota window still wins over the technical tiered alias", () => {
|
||||
assert.deepEqual(
|
||||
selectAntigravityQuotaWindowNames(
|
||||
["gemini-3.8-flash", "gemini-3.8-flash-tiered", "gemini_weekly"],
|
||||
"antigravity/gemini-3.8-flash"
|
||||
),
|
||||
["gemini-3.8-flash", "gemini_weekly"]
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user