mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 17:51:22 +00:00
test: drop pre-Gemini 3 from live model matrix
This commit is contained in:
@@ -10,7 +10,7 @@ export type ModelRef = {
|
||||
const HIGH_SIGNAL_LIVE_MODEL_PRIORITY = [
|
||||
"anthropic/claude-opus-4-6",
|
||||
"google/gemini-3.1-pro-preview",
|
||||
"google/gemini-2.5-flash",
|
||||
"google/gemini-3-flash-preview",
|
||||
"minimax/minimax-m2.7",
|
||||
"openai/gpt-5.2",
|
||||
"openai-codex/gpt-5.2",
|
||||
@@ -52,6 +52,16 @@ function isHighSignalClaudeModelId(id: string): boolean {
|
||||
return minor >= 6;
|
||||
}
|
||||
|
||||
function isPreGemini3ModelId(id: string): boolean {
|
||||
const normalized = normalizeLowercaseStringOrEmpty(id);
|
||||
const match = normalized.match(/(?:^|\/)gemini-(\d+)(?:[.-]|$)/);
|
||||
if (!match) {
|
||||
return false;
|
||||
}
|
||||
const major = Number.parseInt(match[1] ?? "0", 10);
|
||||
return Number.isFinite(major) && major < 3;
|
||||
}
|
||||
|
||||
export function isModernModelRef(ref: ModelRef): boolean {
|
||||
const provider = normalizeProviderId(ref.provider ?? "");
|
||||
const id = normalizeLowercaseStringOrEmpty(ref.id);
|
||||
@@ -77,6 +87,9 @@ export function isHighSignalLiveModelRef(ref: ModelRef): boolean {
|
||||
if (!isModernModelRef(ref) || !id) {
|
||||
return false;
|
||||
}
|
||||
if (isPreGemini3ModelId(id)) {
|
||||
return false;
|
||||
}
|
||||
return isHighSignalClaudeModelId(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -462,6 +462,20 @@ describe("isHighSignalLiveModelRef", () => {
|
||||
isHighSignalLiveModelRef({ provider: "opencode", id: "claude-3-5-haiku-20241022" }),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("drops Gemini families older than major version 3 from the default live matrix", () => {
|
||||
providerRuntimeMocks.resolveProviderModernModelRef.mockReturnValue(true);
|
||||
|
||||
expect(isHighSignalLiveModelRef({ provider: "google", id: "gemini-2.5-flash-lite" })).toBe(
|
||||
false,
|
||||
);
|
||||
expect(isHighSignalLiveModelRef({ provider: "openrouter", id: "google/gemini-2.5-pro" })).toBe(
|
||||
false,
|
||||
);
|
||||
expect(isHighSignalLiveModelRef({ provider: "google", id: "gemini-3-flash-preview" })).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("selectHighSignalLiveItems", () => {
|
||||
@@ -469,7 +483,7 @@ describe("selectHighSignalLiveItems", () => {
|
||||
const items = [
|
||||
{ provider: "anthropic", id: "claude-opus-4-6" },
|
||||
{ provider: "google", id: "gemini-3.1-pro-preview" },
|
||||
{ provider: "google", id: "gemini-2.5-flash" },
|
||||
{ provider: "google", id: "gemini-3-flash-preview" },
|
||||
{ provider: "openai", id: "gpt-5.2" },
|
||||
{ provider: "opencode", id: "big-pickle" },
|
||||
];
|
||||
@@ -484,7 +498,7 @@ describe("selectHighSignalLiveItems", () => {
|
||||
).toEqual([
|
||||
{ provider: "anthropic", id: "claude-opus-4-6" },
|
||||
{ provider: "google", id: "gemini-3.1-pro-preview" },
|
||||
{ provider: "google", id: "gemini-2.5-flash" },
|
||||
{ provider: "google", id: "gemini-3-flash-preview" },
|
||||
{ provider: "openai", id: "gpt-5.2" },
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -73,7 +73,6 @@ const GATEWAY_LIVE_HEARTBEAT_MS = Math.max(
|
||||
toInt(process.env.OPENCLAW_LIVE_GATEWAY_HEARTBEAT_MS, 30_000),
|
||||
);
|
||||
const GATEWAY_LIVE_STRIP_SCAFFOLDING_MODEL_KEYS = new Set([
|
||||
"google/gemini-2.5-flash",
|
||||
"google/gemini-3-flash-preview",
|
||||
"google/gemini-3-pro-preview",
|
||||
"google/gemini-3.1-flash-lite-preview",
|
||||
@@ -387,7 +386,7 @@ describe("maybeStripAssistantScaffoldingForLiveModel", () => {
|
||||
expect(
|
||||
maybeStripAssistantScaffoldingForLiveModel(
|
||||
"<final>Visible</final>",
|
||||
"google/gemini-2.5-flash",
|
||||
"google/gemini-3-flash-preview",
|
||||
),
|
||||
).toBe("Visible");
|
||||
expect(
|
||||
@@ -414,12 +413,6 @@ describe("maybeStripAssistantScaffoldingForLiveModel", () => {
|
||||
"google/gemini-3.1-pro-preview-customtools",
|
||||
),
|
||||
).toBe("Visible");
|
||||
expect(
|
||||
maybeStripAssistantScaffoldingForLiveModel(
|
||||
"<think>hidden</think>Visible",
|
||||
"google/gemini-2.5-flash",
|
||||
),
|
||||
).toBe("Visible");
|
||||
});
|
||||
|
||||
it("strips scaffolding for known OpenAI transcript wrappers", () => {
|
||||
@@ -631,7 +624,7 @@ describe("getHighSignalLiveModelPriorityIndex", () => {
|
||||
getHighSignalLiveModelPriorityIndex({ provider: "google", id: "gemini-3.1-pro-preview" }),
|
||||
).toBe(1);
|
||||
expect(
|
||||
getHighSignalLiveModelPriorityIndex({ provider: "google", id: "gemini-2.5-flash" }),
|
||||
getHighSignalLiveModelPriorityIndex({ provider: "google", id: "gemini-3-flash-preview" }),
|
||||
).toBe(2);
|
||||
expect(getHighSignalLiveModelPriorityIndex({ provider: "opencode", id: "big-pickle" })).toBe(
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user