/
Alex_Ural
/
opencode
Обзор
Документация
Войти
/
Alex_Ural
/
opencode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/app/src/context/local-agent.test.ts
29 строк
955 B
Brendan Allan
fix(app): show selector for custom agents (#37198)
16 июл 2026, 03:44
Не верифицирован
16 июл 2026, 03:44
4a760b5
Код
Авторство
О чём код?
import { describe, expect, test } from "bun:test" import { hasCustomAgent, resolveAgent } from "./local-agent" describe("hasCustomAgent", () => { test("detects explicitly custom agents", () => { expect(hasCustomAgent([{ native: true }, { native: false }])).toBe(true) }) test("ignores built-in and unclassified agents", () => { expect(hasCustomAgent([{ native: true }, {}])).toBe(false) }) }) describe("resolveAgent", () => { const agents = [{ name: "plan" }, { name: "build" }, { name: "custom" }] test("uses the requested available agent", () => { expect(resolveAgent(agents, "custom")?.name).toBe("custom") }) test("defaults to build", () => { expect(resolveAgent(agents)?.name).toBe("build") expect(resolveAgent(agents, "missing")?.name).toBe("build") }) test("uses the first agent when build is unavailable", () => { expect(resolveAgent([{ name: "custom" }], "missing")?.name).toBe("custom") }) })