test(cli): align librarian fallback expectations with actual resolution

This commit is contained in:
YeonGyu-Kim 2026-02-21 03:10:29 +09:00
parent 9059a4fdbc
commit 97a48995b2
2 changed files with 8 additions and 8 deletions

View File

@ -281,7 +281,7 @@ describe("generateOmoConfig - model fallback system", () => {
expect((result.agents as Record<string, { model: string }>).sisyphus).toBeUndefined() expect((result.agents as Record<string, { model: string }>).sisyphus).toBeUndefined()
}) })
test("uses opencode/minimax-m2.5-free for librarian regardless of Z.ai", () => { test("uses ZAI model for librarian when Z.ai is available", () => {
// #given user has Z.ai and Claude max20 // #given user has Z.ai and Claude max20
const config: InstallConfig = { const config: InstallConfig = {
hasClaude: true, hasClaude: true,
@ -297,8 +297,8 @@ describe("generateOmoConfig - model fallback system", () => {
// #when generating config // #when generating config
const result = generateOmoConfig(config) const result = generateOmoConfig(config)
// #then librarian should use opencode/minimax-m2.5-free // #then librarian should use ZAI model
expect((result.agents as Record<string, { model: string }>).librarian.model).toBe("opencode/minimax-m2.5-free") expect((result.agents as Record<string, { model: string }>).librarian.model).toBe("zai-coding-plan/glm-4.7")
// #then Sisyphus uses Claude (OR logic) // #then Sisyphus uses Claude (OR logic)
expect((result.agents as Record<string, { model: string }>).sisyphus.model).toBe("anthropic/claude-opus-4-6") expect((result.agents as Record<string, { model: string }>).sisyphus.model).toBe("anthropic/claude-opus-4-6")
}) })

View File

@ -480,7 +480,7 @@ describe("generateModelConfig", () => {
}) })
describe("librarian agent special cases", () => { describe("librarian agent special cases", () => {
test("librarian uses ZAI when ZAI is available regardless of other providers", () => { test("librarian uses ZAI model when ZAI is available regardless of other providers", () => {
// #given ZAI and Claude are available // #given ZAI and Claude are available
const config = createConfig({ const config = createConfig({
hasClaude: true, hasClaude: true,
@ -491,18 +491,18 @@ describe("generateModelConfig", () => {
const result = generateModelConfig(config) const result = generateModelConfig(config)
// #then librarian should use ZAI_MODEL // #then librarian should use ZAI_MODEL
expect(result.agents?.librarian?.model).toBe("opencode/minimax-m2.5-free") expect(result.agents?.librarian?.model).toBe("zai-coding-plan/glm-4.7")
}) })
test("librarian always uses minimax-m2.5-free regardless of provider availability", () => { test("librarian falls back to generic chain result when no librarian provider matches", () => {
// #given only Claude is available (no ZAI) // #given only Claude is available (no ZAI)
const config = createConfig({ hasClaude: true }) const config = createConfig({ hasClaude: true })
// #when generateModelConfig is called // #when generateModelConfig is called
const result = generateModelConfig(config) const result = generateModelConfig(config)
// #then librarian should use opencode/minimax-m2.5-free (always first in chain) // #then librarian should use generic chain result when chain providers are unavailable
expect(result.agents?.librarian?.model).toBe("opencode/minimax-m2.5-free") expect(result.agents?.librarian?.model).toBe("anthropic/claude-sonnet-4-5")
}) })
}) })