test: stabilize provider auth discovery cases

This commit is contained in:
Peter Steinberger
2026-04-05 13:54:20 +01:00
parent 4e550a873e
commit 388f82f22f
3 changed files with 4 additions and 9 deletions

View File

@@ -179,7 +179,7 @@ const TEST_PROVIDER_ENV_TO_PROVIDER_IDS: Record<string, string[]> = {
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.

View File

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

View File

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