





























@@ -5,15 +5,17 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vite
55import { loadSessionStore, saveSessionStore, type SessionEntry } from "../config/sessions.js";
66import { CURRENT_SESSION_VERSION } from "../config/sessions/version.js";
77import type { OpenClawConfig } from "../config/types.openclaw.js";
8+import type { loadManifestModelCatalog } from "./model-catalog.js";
89910type ProviderModelNormalizationParams = { provider: string; context: { modelId: string } };
11+type LoadManifestModelCatalogParams = Parameters<typeof loadManifestModelCatalog>[0];
10121113const state = vi.hoisted(() => ({
1214cfg: undefined as OpenClawConfig | undefined,
1315workspaceDir: undefined as string | undefined,
1416agentDir: undefined as string | undefined,
1517runAgentAttemptMock: vi.fn(),
16-loadManifestModelCatalogMock: vi.fn(() => []),
18+loadManifestModelCatalogMock: vi.fn((_params: LoadManifestModelCatalogParams) => []),
1719normalizeProviderModelIdWithRuntimeMock: vi.fn(
1820(_params: ProviderModelNormalizationParams) => undefined,
1921),
@@ -57,7 +59,8 @@ vi.mock("../plugins/manifest-contract-eligibility.js", () => ({
5759}));
58605961vi.mock("./model-catalog.js", () => ({
60-loadManifestModelCatalog: (...args: unknown[]) => state.loadManifestModelCatalogMock(...args),
62+loadManifestModelCatalog: (params: LoadManifestModelCatalogParams) =>
63+state.loadManifestModelCatalogMock(params),
6164}));
62656366vi.mock("./provider-model-normalization.runtime.js", () => ({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。