Skip to content

Commit b891dbb

Browse files
committed
test: curate openrouter live profile signal
1 parent 837c4c5 commit b891dbb

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

src/agents/live-model-filter.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const HIGH_SIGNAL_LIVE_MODEL_PRIORITY = [
2020
"minimax/minimax-m2.7",
2121
"openai/gpt-5.2",
2222
"openai-codex/gpt-5.2",
23+
"openrouter/openai/gpt-5.2-chat",
24+
"openrouter/minimax/minimax-m2.7",
2325
"opencode-go/glm-5",
2426
"openrouter/ai21/jamba-large-1.7",
2527
"xai/grok-4-1-fast-non-reasoning",
@@ -37,6 +39,11 @@ const DEFAULT_HIGH_SIGNAL_LIVE_EXCLUDED_PROVIDERS = new Set(["codex", "codex-cli
3739
const HIGH_SIGNAL_LIVE_MODEL_PRIORITY_INDEX = new Map<string, number>(
3840
HIGH_SIGNAL_LIVE_MODEL_PRIORITY.map((key, index) => [key, index]),
3941
);
42+
const OPENROUTER_HIGH_SIGNAL_LIVE_MODEL_IDS = new Set(
43+
HIGH_SIGNAL_LIVE_MODEL_PRIORITY.filter((key) => key.startsWith("openrouter/")).map((key) =>
44+
key.slice("openrouter/".length),
45+
),
46+
);
4047

4148
function isHighSignalClaudeModelId(id: string): boolean {
4249
const normalized = id.replace(/[_.]/g, "-");
@@ -126,6 +133,13 @@ function isUnsupportedFireworksLiveModelRef(provider: string, id: string): boole
126133
return !HIGH_SIGNAL_LIVE_MODEL_PRIORITY_INDEX.has(`${provider}/${id}`);
127134
}
128135

136+
function isUnsupportedOpenRouterLiveModelRef(provider: string, id: string): boolean {
137+
if (provider !== "openrouter") {
138+
return false;
139+
}
140+
return !OPENROUTER_HIGH_SIGNAL_LIVE_MODEL_IDS.has(id);
141+
}
142+
129143
export function isModernModelRef(ref: ModelRef): boolean {
130144
const provider = normalizeProviderId(ref.provider ?? "");
131145
const id = normalizeLowercaseStringOrEmpty(ref.id);
@@ -164,6 +178,9 @@ export function isHighSignalLiveModelRef(ref: ModelRef): boolean {
164178
if (isUnsupportedFireworksLiveModelRef(provider, id)) {
165179
return false;
166180
}
181+
if (isUnsupportedOpenRouterLiveModelRef(provider, id)) {
182+
return false;
183+
}
167184
if (isOldMiniMaxLiveModelRef(id)) {
168185
return false;
169186
}

src/agents/model-compat.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,29 @@ describe("isHighSignalLiveModelRef", () => {
528528
);
529529
});
530530

531+
it("keeps only curated OpenRouter routes in the default live matrix", () => {
532+
providerRuntimeMocks.resolveProviderModernModelRef.mockReturnValue(true);
533+
534+
expect(isHighSignalLiveModelRef({ provider: "openrouter", id: "openai/gpt-5.2-chat" })).toBe(
535+
true,
536+
);
537+
expect(isHighSignalLiveModelRef({ provider: "openrouter", id: "minimax/minimax-m2.7" })).toBe(
538+
true,
539+
);
540+
expect(isHighSignalLiveModelRef({ provider: "openrouter", id: "ai21/jamba-large-1.7" })).toBe(
541+
true,
542+
);
543+
expect(
544+
isHighSignalLiveModelRef({ provider: "openrouter", id: "allenai/olmo-3.1-32b-instruct" }),
545+
).toBe(false);
546+
expect(isHighSignalLiveModelRef({ provider: "openrouter", id: "amazon/nova-lite-v1" })).toBe(
547+
false,
548+
);
549+
expect(isHighSignalLiveModelRef({ provider: "openrouter", id: "amazon/nova-micro-v1" })).toBe(
550+
false,
551+
);
552+
});
553+
531554
it("drops GLM 4.x models from the default live matrix while keeping GLM 5", () => {
532555
providerRuntimeMocks.resolveProviderModernModelRef.mockReturnValue(true);
533556

0 commit comments

Comments
 (0)