Skip to content
Merged
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
40 changes: 40 additions & 0 deletions src/cli/doctor/checks/model-resolution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,46 @@ describe("model-resolution check", () => {
expect(sisyphus!.effectiveResolution).toContain("Provider fallback:")
expect(sisyphus!.effectiveResolution).toContain("anthropic")
})

it("captures user variant for agent when configured", async () => {
const { getModelResolutionInfoWithOverrides } = await import("./model-resolution")

//#given User has model with variant override for oracle agent
const mockConfig = {
agents: {
oracle: { model: "openai/gpt-5.2", variant: "xhigh" },
},
}

//#when getting resolution info with config
const info = getModelResolutionInfoWithOverrides(mockConfig)

//#then Oracle should have userVariant set
const oracle = info.agents.find((a) => a.name === "oracle")
expect(oracle).toBeDefined()
expect(oracle!.userOverride).toBe("openai/gpt-5.2")
expect(oracle!.userVariant).toBe("xhigh")
})

it("captures user variant for category when configured", async () => {
const { getModelResolutionInfoWithOverrides } = await import("./model-resolution")

//#given User has model with variant override for visual-engineering category
const mockConfig = {
categories: {
"visual-engineering": { model: "google/gemini-3-flash-preview", variant: "high" },
},
}

//#when getting resolution info with config
const info = getModelResolutionInfoWithOverrides(mockConfig)

//#then visual-engineering should have userVariant set
const visual = info.categories.find((c) => c.name === "visual-engineering")
expect(visual).toBeDefined()
expect(visual!.userOverride).toBe("google/gemini-3-flash-preview")
expect(visual!.userVariant).toBe("high")
})
})

describe("checkModelResolution", () => {
Expand Down
6 changes: 6 additions & 0 deletions src/cli/doctor/checks/model-resolution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface AgentResolutionInfo {
name: string
requirement: ModelRequirement
userOverride?: string
userVariant?: string
effectiveModel: string
effectiveResolution: string
}
Expand All @@ -59,6 +60,7 @@ export interface CategoryResolutionInfo {
name: string
requirement: ModelRequirement
userOverride?: string
userVariant?: string
effectiveModel: string
effectiveResolution: string
}
Expand Down Expand Up @@ -152,10 +154,12 @@ export function getModelResolutionInfoWithOverrides(config: OmoConfig): ModelRes
const agents: AgentResolutionInfo[] = Object.entries(AGENT_MODEL_REQUIREMENTS).map(
([name, requirement]) => {
const userOverride = config.agents?.[name]?.model
const userVariant = config.agents?.[name]?.variant
return {
name,
requirement,
userOverride,
userVariant,
effectiveModel: getEffectiveModel(requirement, userOverride),
effectiveResolution: buildEffectiveResolution(requirement, userOverride),
}
Expand All @@ -165,10 +169,12 @@ export function getModelResolutionInfoWithOverrides(config: OmoConfig): ModelRes
const categories: CategoryResolutionInfo[] = Object.entries(CATEGORY_MODEL_REQUIREMENTS).map(
([name, requirement]) => {
const userOverride = config.categories?.[name]?.model
const userVariant = config.categories?.[name]?.variant
return {
name,
requirement,
userOverride,
userVariant,
effectiveModel: getEffectiveModel(requirement, userOverride),
effectiveResolution: buildEffectiveResolution(requirement, userOverride),
}
Expand Down