2919ec7256
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
47 lines
1.5 KiB
TypeScript
47 lines
1.5 KiB
TypeScript
import { describe, expect, test } from "bun:test"
|
|
|
|
import { generateModelConfig } from "./model-fallback"
|
|
import type { InstallConfig } from "./types"
|
|
|
|
function createConfig(overrides: Partial<InstallConfig> = {}): InstallConfig {
|
|
return {
|
|
hasClaude: false,
|
|
isMax20: false,
|
|
hasOpenAI: false,
|
|
hasGemini: false,
|
|
hasCopilot: false,
|
|
hasOpencodeZen: false,
|
|
hasZaiCodingPlan: false,
|
|
hasKimiForCoding: false,
|
|
...overrides,
|
|
}
|
|
}
|
|
|
|
describe("generateModelConfig OpenAI-only model catalog", () => {
|
|
test("fills remaining OpenAI-only agent gaps with OpenAI models", () => {
|
|
// #given
|
|
const config = createConfig({ hasOpenAI: true })
|
|
|
|
// #when
|
|
const result = generateModelConfig(config)
|
|
|
|
// #then
|
|
expect(result.agents?.explore).toEqual({ model: "openai/gpt-5.4", variant: "medium" })
|
|
expect(result.agents?.librarian).toEqual({ model: "openai/gpt-5.4", variant: "medium" })
|
|
})
|
|
|
|
test("fills remaining OpenAI-only category gaps with OpenAI models", () => {
|
|
// #given
|
|
const config = createConfig({ hasOpenAI: true })
|
|
|
|
// #when
|
|
const result = generateModelConfig(config)
|
|
|
|
// #then
|
|
expect(result.categories?.artistry).toEqual({ model: "openai/gpt-5.4", variant: "xhigh" })
|
|
expect(result.categories?.quick).toEqual({ model: "openai/gpt-5.3-codex", variant: "low" })
|
|
expect(result.categories?.["visual-engineering"]).toEqual({ model: "openai/gpt-5.4", variant: "high" })
|
|
expect(result.categories?.writing).toEqual({ model: "openai/gpt-5.4", variant: "medium" })
|
|
})
|
|
})
|