Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cli/src/__tests__/agents-detect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,20 @@ describe("detectAgents", () => {
});

describe("returned agent shape", () => {
it("includes the configured MiniMax Claude-compatible models in the Claude picker", () => {
existsSyncMock.mockReturnValue(false);

const agents = detectAgents();
const claude = findAgent(agents, "claude");

expect(claude.models).toEqual(
expect.arrayContaining([
{ id: "MiniMax-M3", label: "MiniMax-M3" },
{ id: "MiniMax-M2.7", label: "MiniMax-M2.7" },
]),
);
});

it("returns all agents from AGENTS array", () => {
existsSyncMock.mockReturnValue(false);

Expand Down
4 changes: 3 additions & 1 deletion cli/src/agents-detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export const AGENTS: AgentDef[] = [
{ id: "claude-opus-4-7", label: "claude-opus-4-7" },
{ id: "claude-sonnet-4-6", label: "claude-sonnet-4-6" },
{ id: "claude-haiku-4-5", label: "claude-haiku-4-5" },
{ id: "MiniMax-M3", label: "MiniMax-M3" },
{ id: "MiniMax-M2.7", label: "MiniMax-M2.7" },
],
},
{
Expand Down Expand Up @@ -386,4 +388,4 @@ export function detectAgents(): DetectedAgent[] {
}
return { ...base, available: false };
});
}
}
44 changes: 44 additions & 0 deletions next/src/lib/agents/__tests__/detect.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { describe, expect, it, vi, beforeEach, afterEach } from "vitest";

const { existsSyncMock } = vi.hoisted(() => ({
existsSyncMock: vi.fn((_path?: string) => false),
}));

vi.mock("node:fs", async () => {
const actual = await vi.importActual<typeof import("node:fs")>("node:fs");
return { ...actual, existsSync: existsSyncMock };
});

import { detectAgents } from "../detect";

function findAgent(
agents: ReturnType<typeof detectAgents>,
id: string,
) {
const agent = agents.find((a) => a.id === id);
if (!agent) throw new Error(`Agent with id "${id}" not found`);
return agent;
}

beforeEach(() => {
existsSyncMock.mockReset();
existsSyncMock.mockReturnValue(false);
});

afterEach(() => {
vi.unstubAllEnvs();
});

describe("detectAgents", () => {
it("includes the configured MiniMax Claude-compatible models in the Claude picker", () => {
const agents = detectAgents();
const claude = findAgent(agents, "claude");

expect(claude.models).toEqual(
expect.arrayContaining([
{ id: "MiniMax-M3", label: "MiniMax-M3" },
{ id: "MiniMax-M2.7", label: "MiniMax-M2.7" },
]),
);
});
});
2 changes: 2 additions & 0 deletions next/src/lib/agents/detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export const AGENTS: AgentDef[] = [
{ id: "claude-opus-4-7", label: "claude-opus-4-7" },
{ id: "claude-sonnet-4-6", label: "claude-sonnet-4-6" },
{ id: "claude-haiku-4-5", label: "claude-haiku-4-5" },
{ id: "MiniMax-M3", label: "MiniMax-M3" },
{ id: "MiniMax-M2.7", label: "MiniMax-M2.7" },
],
},
{
Expand Down