fix: expand override.category and explicit reasoningEffort priority (#1219) (#1235)

* fix: expand override.category and explicit reasoningEffort priority (#1219)

Two bugs fixed:

1. createBuiltinAgents(): override.category was never expanded into concrete
   config properties (model, variant, reasoningEffort, etc.). Added
   applyCategoryOverride() helper and applied it in the standard agent loop,
   Sisyphus path, and Atlas path.

2. Prometheus config-handler: reasoningEffort/textVerbosity/thinking from
   direct override now use explicit priority chains (direct > category)
   matching the existing variant pattern, instead of relying on spread
   ordering.

Priority order (highest to lowest):
  1. Direct override properties
  2. Override category properties
  3. Resolved variant from model fallback chain
  4. Factory base defaults

Closes #1219

* fix: use undefined check for thinking to allow explicit false
This commit is contained in:
YeonGyu-Kim
2026-01-29 19:46:34 +09:00
committed by GitHub
parent d9c325da36
commit d48641055c
4 changed files with 314 additions and 26 deletions
+124
View File
@@ -280,3 +280,127 @@ describe("Prometheus category config resolution", () => {
expect(config?.tools).toEqual({ tool1: true, tool2: false })
})
})
describe("Prometheus direct override priority over category", () => {
test("direct reasoningEffort takes priority over category reasoningEffort", async () => {
// #given - category has reasoningEffort=xhigh, direct override says "low"
const pluginConfig: OhMyOpenCodeConfig = {
sisyphus_agent: {
planner_enabled: true,
},
categories: {
"test-planning": {
model: "openai/gpt-5.2",
reasoningEffort: "xhigh",
},
},
agents: {
prometheus: {
category: "test-planning",
reasoningEffort: "low",
},
},
}
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-5",
agent: {},
}
const handler = createConfigHandler({
ctx: { directory: "/tmp" },
pluginConfig,
modelCacheState: {
anthropicContext1MEnabled: false,
modelContextLimitsCache: new Map(),
},
})
// #when
await handler(config)
// #then - direct override's reasoningEffort wins
const agents = config.agent as Record<string, { reasoningEffort?: string }>
expect(agents.prometheus).toBeDefined()
expect(agents.prometheus.reasoningEffort).toBe("low")
})
test("category reasoningEffort applied when no direct override", async () => {
// #given - category has reasoningEffort but no direct override
const pluginConfig: OhMyOpenCodeConfig = {
sisyphus_agent: {
planner_enabled: true,
},
categories: {
"reasoning-cat": {
model: "openai/gpt-5.2",
reasoningEffort: "high",
},
},
agents: {
prometheus: {
category: "reasoning-cat",
},
},
}
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-5",
agent: {},
}
const handler = createConfigHandler({
ctx: { directory: "/tmp" },
pluginConfig,
modelCacheState: {
anthropicContext1MEnabled: false,
modelContextLimitsCache: new Map(),
},
})
// #when
await handler(config)
// #then - category's reasoningEffort is applied
const agents = config.agent as Record<string, { reasoningEffort?: string }>
expect(agents.prometheus).toBeDefined()
expect(agents.prometheus.reasoningEffort).toBe("high")
})
test("direct temperature takes priority over category temperature", async () => {
// #given
const pluginConfig: OhMyOpenCodeConfig = {
sisyphus_agent: {
planner_enabled: true,
},
categories: {
"temp-cat": {
model: "openai/gpt-5.2",
temperature: 0.8,
},
},
agents: {
prometheus: {
category: "temp-cat",
temperature: 0.1,
},
},
}
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-5",
agent: {},
}
const handler = createConfigHandler({
ctx: { directory: "/tmp" },
pluginConfig,
modelCacheState: {
anthropicContext1MEnabled: false,
modelContextLimitsCache: new Map(),
},
})
// #when
await handler(config)
// #then - direct temperature wins over category
const agents = config.agent as Record<string, { temperature?: number }>
expect(agents.prometheus).toBeDefined()
expect(agents.prometheus.temperature).toBe(0.1)
})
})