From de76ad506cd8331fd189544bae9d955b246471f1 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 28 Apr 2026 02:30:29 +0100 Subject: [PATCH] test: stabilize release live e2e lanes --- src/agents/live-model-filter.ts | 39 ++++++++++++----------- src/agents/model-compat.test.ts | 13 ++++++++ src/commands/onboard-channels.e2e.test.ts | 21 +++--------- 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/src/agents/live-model-filter.ts b/src/agents/live-model-filter.ts index 745d5e88bdc..32d4b94a5aa 100644 --- a/src/agents/live-model-filter.ts +++ b/src/agents/live-model-filter.ts @@ -35,15 +35,26 @@ const HIGH_SIGNAL_LIVE_MODEL_PRIORITY = [ export const DEFAULT_HIGH_SIGNAL_LIVE_MODEL_LIMIT = HIGH_SIGNAL_LIVE_MODEL_PRIORITY.length; const DEFAULT_HIGH_SIGNAL_LIVE_EXCLUDED_PROVIDERS = new Set(["codex", "codex-cli", "openai-codex"]); +const CURATED_ONLY_HIGH_SIGNAL_LIVE_PROVIDERS = new Set(["fireworks", "openrouter", "xai"]); const HIGH_SIGNAL_LIVE_MODEL_PRIORITY_INDEX = new Map( HIGH_SIGNAL_LIVE_MODEL_PRIORITY.map((key, index) => [key, index]), ); -const OPENROUTER_HIGH_SIGNAL_LIVE_MODEL_IDS = new Set( - HIGH_SIGNAL_LIVE_MODEL_PRIORITY.filter((key) => key.startsWith("openrouter/")).map((key) => - key.slice("openrouter/".length), - ), -); +const HIGH_SIGNAL_LIVE_MODEL_IDS_BY_PROVIDER = new Map>(); +for (const key of HIGH_SIGNAL_LIVE_MODEL_PRIORITY) { + const separatorIndex = key.indexOf("/"); + if (separatorIndex < 0) { + continue; + } + const provider = key.slice(0, separatorIndex); + const id = key.slice(separatorIndex + 1); + const bucket = HIGH_SIGNAL_LIVE_MODEL_IDS_BY_PROVIDER.get(provider); + if (bucket) { + bucket.add(id); + } else { + HIGH_SIGNAL_LIVE_MODEL_IDS_BY_PROVIDER.set(provider, new Set([id])); + } +} function isHighSignalClaudeModelId(id: string): boolean { const normalized = id.replace(/[_.]/g, "-"); @@ -126,18 +137,11 @@ function isOldGlmLiveModelRef(id: string): boolean { return /^glm-4(?:$|[.\-p])/.test(modelName); } -function isUnsupportedFireworksLiveModelRef(provider: string, id: string): boolean { - if (provider !== "fireworks") { +function isUnsupportedCuratedProviderLiveModelRef(provider: string, id: string): boolean { + if (!CURATED_ONLY_HIGH_SIGNAL_LIVE_PROVIDERS.has(provider)) { return false; } - return !HIGH_SIGNAL_LIVE_MODEL_PRIORITY_INDEX.has(`${provider}/${id}`); -} - -function isUnsupportedOpenRouterLiveModelRef(provider: string, id: string): boolean { - if (provider !== "openrouter") { - return false; - } - return !OPENROUTER_HIGH_SIGNAL_LIVE_MODEL_IDS.has(id); + return !(HIGH_SIGNAL_LIVE_MODEL_IDS_BY_PROVIDER.get(provider)?.has(id) ?? false); } export function isModernModelRef(ref: ModelRef): boolean { @@ -175,10 +179,7 @@ export function isHighSignalLiveModelRef(ref: ModelRef): boolean { if (isUnsupportedOpenAiLiveModelRef(provider, id)) { return false; } - if (isUnsupportedFireworksLiveModelRef(provider, id)) { - return false; - } - if (isUnsupportedOpenRouterLiveModelRef(provider, id)) { + if (isUnsupportedCuratedProviderLiveModelRef(provider, id)) { return false; } if (isOldMiniMaxLiveModelRef(id)) { diff --git a/src/agents/model-compat.test.ts b/src/agents/model-compat.test.ts index 48dfd17f088..8e7a7eba8a1 100644 --- a/src/agents/model-compat.test.ts +++ b/src/agents/model-compat.test.ts @@ -585,6 +585,19 @@ describe("isHighSignalLiveModelRef", () => { ).toBe(false); }); + it("keeps only curated xAI routes in the default live matrix", () => { + providerRuntimeMocks.resolveProviderModernModelRef.mockReturnValue(true); + + expect(isHighSignalLiveModelRef({ provider: "xai", id: "grok-4-1-fast-non-reasoning" })).toBe( + true, + ); + expect(isHighSignalLiveModelRef({ provider: "xai", id: "grok-3" })).toBe(false); + expect(isHighSignalLiveModelRef({ provider: "xai", id: "grok-4-fast-non-reasoning" })).toBe( + false, + ); + expect(isHighSignalLiveModelRef({ provider: "xai", id: "grok-4-1-fast" })).toBe(false); + }); + it("keeps DeepSeek V4 models in the default live matrix when the provider marks them modern", () => { providerRuntimeMocks.resolveProviderModernModelRef.mockImplementation(({ provider, context }) => provider === "deepseek" && context.modelId.startsWith("deepseek-v4") ? true : undefined, diff --git a/src/commands/onboard-channels.e2e.test.ts b/src/commands/onboard-channels.e2e.test.ts index 8b57d6fec02..2ca1d588d0b 100644 --- a/src/commands/onboard-channels.e2e.test.ts +++ b/src/commands/onboard-channels.e2e.test.ts @@ -869,18 +869,10 @@ describe("setupChannels", () => { }); it("treats installed external plugin channels as installed without reinstall prompts", async () => { - setActivePluginRegistry(createEmptyPluginRegistry()); + setActivePluginRegistry( + createTestRegistry([createMSTeamsPluginRegistryEntry({ includeSetupWizard: true }) as never]), + ); catalogMocks.listChannelPluginCatalogEntries.mockReturnValue([createMSTeamsCatalogEntry()]); - manifestRegistryMocks.loadPluginManifestRegistry.mockReturnValue({ - plugins: [ - { - id: "@openclaw/external-chat-plugin", - channels: ["external-chat"], - } as never, - ], - diagnostics: [], - }); - mockMSTeamsRegistrySnapshot({ includeSetupWizard: true }); let channelSelectionCount = 0; const select = vi.fn(async ({ message }: { message: string }) => { @@ -900,12 +892,7 @@ describe("setupChannels", () => { await runSetupChannels({} as OpenClawConfig, prompter); expect(ensureChannelSetupPluginInstalled).not.toHaveBeenCalled(); - expect(loadChannelSetupPluginRegistrySnapshotForChannel).toHaveBeenCalledWith( - expect.objectContaining({ - channel: "external-chat", - pluginId: "@openclaw/external-chat-plugin", - }), - ); + expect(loadChannelSetupPluginRegistrySnapshotForChannel).not.toHaveBeenCalled(); expect(multiselect).not.toHaveBeenCalled(); });