fix: honor agent variant overrides (#1394)

* fix(shared): honor agent variant overrides

* test(shared): use model in fallback chain to verify override precedence

Address PR review: test now uses claude-opus-4-5 (which has default
variant 'max' in sisyphus chain) to properly verify that agent override
'high' takes precedence over the fallback chain's default variant.
This commit is contained in:
YeonGyu-Kim
2026-02-02 21:07:10 +09:00
committed by GitHub
parent d165a6821d
commit 5c68ae3bee
2 changed files with 32 additions and 9 deletions
+17
View File
@@ -83,6 +83,23 @@ describe("applyAgentVariant", () => {
})
describe("resolveVariantForModel", () => {
test("returns agent override variant when configured", () => {
// given - use a model in sisyphus chain (claude-opus-4-5 has default variant "max")
// to verify override takes precedence over fallback chain
const config = {
agents: {
sisyphus: { variant: "high" },
},
} as OhMyOpenCodeConfig
const model = { providerID: "anthropic", modelID: "claude-opus-4-5" }
// when
const variant = resolveVariantForModel(config, "sisyphus", model)
// then
expect(variant).toBe("high")
})
test("returns correct variant for anthropic provider", () => {
// given
const config = {} as OhMyOpenCodeConfig