test(cli): align librarian fallback expectations with actual resolution
This commit is contained in:
@@ -281,7 +281,7 @@ describe("generateOmoConfig - model fallback system", () => {
|
||||
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
|
||||
const config: InstallConfig = {
|
||||
hasClaude: true,
|
||||
@@ -297,8 +297,8 @@ describe("generateOmoConfig - model fallback system", () => {
|
||||
// #when generating config
|
||||
const result = generateOmoConfig(config)
|
||||
|
||||
// #then librarian should use opencode/minimax-m2.5-free
|
||||
expect((result.agents as Record<string, { model: string }>).librarian.model).toBe("opencode/minimax-m2.5-free")
|
||||
// #then librarian should use ZAI model
|
||||
expect((result.agents as Record<string, { model: string }>).librarian.model).toBe("zai-coding-plan/glm-4.7")
|
||||
// #then Sisyphus uses Claude (OR logic)
|
||||
expect((result.agents as Record<string, { model: string }>).sisyphus.model).toBe("anthropic/claude-opus-4-6")
|
||||
})
|
||||
|
||||
@@ -480,7 +480,7 @@ describe("generateModelConfig", () => {
|
||||
})
|
||||
|
||||
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
|
||||
const config = createConfig({
|
||||
hasClaude: true,
|
||||
@@ -491,18 +491,18 @@ describe("generateModelConfig", () => {
|
||||
const result = generateModelConfig(config)
|
||||
|
||||
// #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)
|
||||
const config = createConfig({ hasClaude: true })
|
||||
|
||||
// #when generateModelConfig is called
|
||||
const result = generateModelConfig(config)
|
||||
|
||||
// #then librarian should use opencode/minimax-m2.5-free (always first in chain)
|
||||
expect(result.agents?.librarian?.model).toBe("opencode/minimax-m2.5-free")
|
||||
// #then librarian should use generic chain result when chain providers are unavailable
|
||||
expect(result.agents?.librarian?.model).toBe("anthropic/claude-sonnet-4-5")
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user