test: narrow agents bind and provider auth cases

This commit is contained in:
Peter Steinberger
2026-04-17 08:04:01 +01:00
parent 824b5e4d91
commit ab726235bd
2 changed files with 5 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createBindingResolverTestPlugin } from "../test-utils/channel-plugins.js";
import {
loadFreshAgentsCommandModuleForTest,
loadFreshAgentsBindCommandModuleForTest,
readConfigFileSnapshotMock,
resetAgentsBindTestHarness,
runtime,
@@ -51,14 +51,14 @@ vi.mock("../channels/plugins/index.js", async () => {
};
});
let agentsBindCommand: typeof import("./agents.js").agentsBindCommand;
let agentsBindingsCommand: typeof import("./agents.js").agentsBindingsCommand;
let agentsUnbindCommand: typeof import("./agents.js").agentsUnbindCommand;
let agentsBindCommand: typeof import("./agents.commands.bind.js").agentsBindCommand;
let agentsBindingsCommand: typeof import("./agents.commands.bind.js").agentsBindingsCommand;
let agentsUnbindCommand: typeof import("./agents.commands.bind.js").agentsUnbindCommand;
describe("agents bind/unbind commands", () => {
beforeEach(async () => {
({ agentsBindCommand, agentsBindingsCommand, agentsUnbindCommand } =
await loadFreshAgentsCommandModuleForTest());
await loadFreshAgentsBindCommandModuleForTest());
resetAgentsBindTestHarness();
});

View File

@@ -1329,24 +1329,6 @@ describe("onboard (non-interactive): provider auth", () => {
key: "xai-test-key",
expectedModel: "xai/grok-4",
},
{
options: {
mistralApiKey: "mistral-test-key", // pragma: allowlist secret
},
profileId: "mistral:default",
provider: "mistral",
key: "mistral-test-key",
},
{
options: {
authChoice: "ai-gateway-api-key",
aiGatewayApiKey: "gateway-test-key", // pragma: allowlist secret
},
profileId: "vercel-ai-gateway:default",
provider: "vercel-ai-gateway",
key: "gateway-test-key",
expectedModel: "vercel-ai-gateway/anthropic/claude-opus-4.6",
},
{
options: {
modelstudioApiKey: "modelstudio-test-key", // pragma: allowlist secret
@@ -1413,13 +1395,6 @@ describe("onboard (non-interactive): provider auth", () => {
it("fails fast when ref mode receives explicit provider keys without env and does not leak keys", async () => {
const scenarios = [
{
name: "anthropic",
authChoice: "apiKey",
optionKey: "anthropicApiKey",
flagName: "--anthropic-api-key",
envVar: "ANTHROPIC_API_KEY",
},
{
name: "openai",
authChoice: "openai-api-key",
@@ -1427,13 +1402,6 @@ describe("onboard (non-interactive): provider auth", () => {
flagName: "--openai-api-key",
envVar: "OPENAI_API_KEY",
},
{
name: "openrouter",
authChoice: "openrouter-api-key",
optionKey: "openrouterApiKey",
flagName: "--openrouter-api-key",
envVar: "OPENROUTER_API_KEY",
},
] as const;
await withOnboardEnv("openclaw-onboard-ref-flag-", async () => {