Skip to content

Commit 1fdb0e7

Browse files
committed
perf(test): isolate models config auth fixtures
1 parent e99b5de commit 1fdb0e7

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

‎src/agents/models-config.applies-config-env-vars.test.ts‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,33 @@ vi.mock("./provider-auth-aliases.js", () => ({
2222
resolveProviderIdForAuth: (provider: string) => provider.trim().toLowerCase(),
2323
}));
2424

25+
// These planner tests exercise no plugin-owned auth policy. Keep their exact
26+
// provider markers local instead of loading the bundled plugin/runtime catalog.
27+
vi.mock("../plugins/provider-runtime.js", () => ({
28+
applyProviderNativeStreamingUsageCompatWithPlugin: () => undefined,
29+
normalizeProviderConfigWithPlugin: () => undefined,
30+
resolveProviderConfigApiKeyWithPlugin: () => undefined,
31+
resolveExternalAuthProfilesWithPlugins: () => [],
32+
resolveProviderSyntheticAuthWithPlugin: () => undefined,
33+
}));
34+
35+
vi.mock("./model-auth-env-vars.js", () => ({
36+
listKnownProviderEnvApiKeyNames: () => [
37+
"GOOGLE_CLOUD_API_KEY",
38+
"OPENAI_API_KEY",
39+
"OPENROUTER_API_KEY",
40+
],
41+
resolveProviderEnvAuthLookupMaps: () => ({
42+
aliasMap: {},
43+
envCandidateMap: {
44+
"google-vertex": ["GOOGLE_CLOUD_API_KEY"],
45+
openai: ["OPENAI_API_KEY"],
46+
openrouter: ["OPENROUTER_API_KEY"],
47+
},
48+
authEvidenceMap: {},
49+
}),
50+
}));
51+
2552
const TEST_ENV_VAR = "OPENCLAW_MODELS_CONFIG_TEST_ENV";
2653

2754
function createImplicitOpenRouterProvider(): ProviderConfig {

0 commit comments

Comments
 (0)