test: stabilize release live e2e lanes

This commit is contained in:
Peter Steinberger
2026-04-28 02:30:29 +01:00
parent d9411f9dc1
commit de76ad506c
3 changed files with 37 additions and 36 deletions

View File

@@ -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<string, number>(
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<string, Set<string>>();
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)) {

View File

@@ -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,

View File

@@ -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();
});