From 388f82f22f1617f0824263de9182d724b237e44e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 5 Apr 2026 13:54:20 +0100 Subject: [PATCH] test: stabilize provider auth discovery cases --- src/agents/models-config.e2e-harness.ts | 9 +-------- .../models-config.providers.auth-provenance.test.ts | 2 +- src/agents/models-config.providers.chutes.test.ts | 2 ++ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/agents/models-config.e2e-harness.ts b/src/agents/models-config.e2e-harness.ts index ed6adb14859..9eca2d352d5 100644 --- a/src/agents/models-config.e2e-harness.ts +++ b/src/agents/models-config.e2e-harness.ts @@ -179,7 +179,7 @@ const TEST_PROVIDER_ENV_TO_PROVIDER_IDS: Record = { HF_TOKEN: ["huggingface"], HUGGINGFACE_HUB_TOKEN: ["huggingface"], KILOCODE_API_KEY: ["kilocode"], - KIMI_API_KEY: ["moonshot"], + KIMI_API_KEY: ["moonshot", "kimi"], KIMICODE_API_KEY: ["kimi-coding"], MINIMAX_API_KEY: ["minimax"], MINIMAX_OAUTH_TOKEN: ["minimax"], @@ -290,13 +290,6 @@ async function inferImplicitProviderTestPluginIds(params: { providerIds.add(pluginId); } } - const legacyGrokApiKey = ( - params.config?.tools?.web?.search as { grok?: { apiKey?: unknown } } | undefined - )?.grok?.apiKey; - if (legacyGrokApiKey !== undefined && params.config?.plugins?.entries?.xai?.enabled !== false) { - providerIds.add("xai"); - } - if (providerIds.size === 0) { // No config/env/auth hints: keep ambient local auto-discovery focused on the // one provider that is expected to probe localhost in tests. diff --git a/src/agents/models-config.providers.auth-provenance.test.ts b/src/agents/models-config.providers.auth-provenance.test.ts index cd05c95d024..22d8bffdae3 100644 --- a/src/agents/models-config.providers.auth-provenance.test.ts +++ b/src/agents/models-config.providers.auth-provenance.test.ts @@ -81,7 +81,7 @@ describe("models-config provider auth provenance", () => { expect(providers?.together?.apiKey).toBe(NON_ENV_SECRETREF_MARKER); }); - it("keeps oauth compatibility markers for minimax-portal", async () => { + it("keeps oauth compatibility markers for minimax-portal", { timeout: 240_000 }, async () => { const agentDir = mkdtempSync(join(tmpdir(), "openclaw-test-")); await writeFile( join(agentDir, "auth-profiles.json"), diff --git a/src/agents/models-config.providers.chutes.test.ts b/src/agents/models-config.providers.chutes.test.ts index 9bd2fe48556..79089613f9a 100644 --- a/src/agents/models-config.providers.chutes.test.ts +++ b/src/agents/models-config.providers.chutes.test.ts @@ -129,6 +129,8 @@ describe("chutes implicit provider auth mode", () => { const providers = await resolveImplicitProvidersForTest({ agentDir, env: { + VITEST: "true", + NODE_ENV: "test", CHUTES_API_KEY: "env-chutes-api-key", } as NodeJS.ProcessEnv, });