mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:20:43 +00:00
test: narrow live gateway profile signal
This commit is contained in:
@@ -74,6 +74,11 @@ function isPreGemini3ModelId(id: string): boolean {
|
||||
return Number.isFinite(major) && major < 3;
|
||||
}
|
||||
|
||||
function isMutableLatestAliasLiveModelRef(id: string): boolean {
|
||||
const modelName = normalizeLowercaseStringOrEmpty(id).split("/").pop() ?? "";
|
||||
return modelName.endsWith("-latest");
|
||||
}
|
||||
|
||||
function isOpenAiFamilyLiveModel(provider: string, id: string): boolean {
|
||||
const normalized = normalizeLowercaseStringOrEmpty(id);
|
||||
const modelName = normalized.split("/").pop() ?? "";
|
||||
@@ -98,6 +103,9 @@ function isUnsupportedOpenAiLiveModelRef(provider: string, id: string): boolean
|
||||
return false;
|
||||
}
|
||||
const modelName = normalizeLowercaseStringOrEmpty(id).split("/").pop() ?? "";
|
||||
if (provider === "openai" || provider === "openai-codex") {
|
||||
return modelName !== "gpt-5.2";
|
||||
}
|
||||
return !modelName.startsWith("gpt-5.2");
|
||||
}
|
||||
|
||||
@@ -111,6 +119,13 @@ function isOldGlmLiveModelRef(id: string): boolean {
|
||||
return /^glm-4(?:$|[.\-p])/.test(modelName);
|
||||
}
|
||||
|
||||
function isUnsupportedFireworksLiveModelRef(provider: string, id: string): boolean {
|
||||
if (provider !== "fireworks") {
|
||||
return false;
|
||||
}
|
||||
return !HIGH_SIGNAL_LIVE_MODEL_PRIORITY_INDEX.has(`${provider}/${id}`);
|
||||
}
|
||||
|
||||
export function isModernModelRef(ref: ModelRef): boolean {
|
||||
const provider = normalizeProviderId(ref.provider ?? "");
|
||||
const id = normalizeLowercaseStringOrEmpty(ref.id);
|
||||
@@ -140,9 +155,15 @@ export function isHighSignalLiveModelRef(ref: ModelRef): boolean {
|
||||
if (isPreGemini3ModelId(id)) {
|
||||
return false;
|
||||
}
|
||||
if (isMutableLatestAliasLiveModelRef(id)) {
|
||||
return false;
|
||||
}
|
||||
if (isUnsupportedOpenAiLiveModelRef(provider, id)) {
|
||||
return false;
|
||||
}
|
||||
if (isUnsupportedFireworksLiveModelRef(provider, id)) {
|
||||
return false;
|
||||
}
|
||||
if (isOldMiniMaxLiveModelRef(id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -474,6 +474,10 @@ describe("isHighSignalLiveModelRef", () => {
|
||||
expect(isHighSignalLiveModelRef({ provider: "google", id: "gemini-3-flash-preview" })).toBe(
|
||||
true,
|
||||
);
|
||||
expect(isHighSignalLiveModelRef({ provider: "google", id: "gemini-flash-latest" })).toBe(false);
|
||||
expect(isHighSignalLiveModelRef({ provider: "google", id: "gemini-flash-lite-latest" })).toBe(
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps only GPT-5.2 OpenAI-family models in the default live matrix", () => {
|
||||
@@ -492,6 +496,8 @@ describe("isHighSignalLiveModelRef", () => {
|
||||
expect(isHighSignalLiveModelRef({ provider: "openai", id: "gpt-5.1" })).toBe(false);
|
||||
expect(isHighSignalLiveModelRef({ provider: "openai", id: "gpt-5.4" })).toBe(false);
|
||||
expect(isHighSignalLiveModelRef({ provider: "openai", id: "gpt-5.5" })).toBe(false);
|
||||
expect(isHighSignalLiveModelRef({ provider: "openai", id: "gpt-5.2-codex" })).toBe(false);
|
||||
expect(isHighSignalLiveModelRef({ provider: "openai", id: "gpt-5.2-chat-latest" })).toBe(false);
|
||||
expect(isHighSignalLiveModelRef({ provider: "openrouter", id: "openai/gpt-5.1-chat" })).toBe(
|
||||
false,
|
||||
);
|
||||
@@ -499,6 +505,8 @@ describe("isHighSignalLiveModelRef", () => {
|
||||
false,
|
||||
);
|
||||
expect(isHighSignalLiveModelRef({ provider: "openai", id: "gpt-5.2" })).toBe(true);
|
||||
expect(isHighSignalLiveModelRef({ provider: "openai-codex", id: "gpt-5.2" })).toBe(true);
|
||||
expect(isHighSignalLiveModelRef({ provider: "openai-codex", id: "gpt-5.2-codex" })).toBe(false);
|
||||
expect(isHighSignalLiveModelRef({ provider: "openrouter", id: "openai/gpt-5.2-chat" })).toBe(
|
||||
true,
|
||||
);
|
||||
@@ -540,6 +548,18 @@ describe("isHighSignalLiveModelRef", () => {
|
||||
expect(
|
||||
isHighSignalLiveModelRef({ provider: "fireworks", id: "accounts/fireworks/models/glm-5p1" }),
|
||||
).toBe(true);
|
||||
expect(
|
||||
isHighSignalLiveModelRef({
|
||||
provider: "fireworks",
|
||||
id: "accounts/fireworks/models/gpt-oss-120b",
|
||||
}),
|
||||
).toBe(false);
|
||||
expect(
|
||||
isHighSignalLiveModelRef({
|
||||
provider: "fireworks",
|
||||
id: "accounts/fireworks/models/minimax-m2p7",
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("keeps DeepSeek V4 models in the default live matrix when the provider marks them modern", () => {
|
||||
|
||||
Reference in New Issue
Block a user