From 81a2317f51446d2fa59bc70e77cf58e822d202d3 Mon Sep 17 00:00:00 2001 From: edxeth Date: Sun, 1 Feb 2026 15:49:46 +0100 Subject: [PATCH] fix(doctor): display user-configured variant in model resolution output OmoConfig interface was missing variant property, causing doctor to show variants from ModelRequirement fallback chain instead of user's config. - Add variant to OmoConfig agent/category entries - Add userVariant to resolution info interfaces - Update getEffectiveVariant to prioritize user variant - Add tests verifying variant capture --- .../doctor/checks/model-resolution.test.ts | 40 +++++++++++++++++++ src/cli/doctor/checks/model-resolution.ts | 6 +++ 2 files changed, 46 insertions(+) diff --git a/src/cli/doctor/checks/model-resolution.test.ts b/src/cli/doctor/checks/model-resolution.test.ts index 0932a4e7..e00964f0 100644 --- a/src/cli/doctor/checks/model-resolution.test.ts +++ b/src/cli/doctor/checks/model-resolution.test.ts @@ -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", () => { diff --git a/src/cli/doctor/checks/model-resolution.ts b/src/cli/doctor/checks/model-resolution.ts index b6ee904b..8599803c 100644 --- a/src/cli/doctor/checks/model-resolution.ts +++ b/src/cli/doctor/checks/model-resolution.ts @@ -51,6 +51,7 @@ export interface AgentResolutionInfo { name: string requirement: ModelRequirement userOverride?: string + userVariant?: string effectiveModel: string effectiveResolution: string } @@ -59,6 +60,7 @@ export interface CategoryResolutionInfo { name: string requirement: ModelRequirement userOverride?: string + userVariant?: string effectiveModel: string effectiveResolution: string } @@ -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), } @@ -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), }