fix(delegate-task): category built-in model takes precedence over inherited model

Previously, when using categories like 'quick', the parent session's model
(e.g., Opus 4.5) would override the category's built-in model (e.g., Haiku).

Fixed priority: userConfig.model → category built-in → systemDefault

The inherited model from parent session no longer affects category-based
delegation - categories have their own explicit models.
This commit is contained in:
justsisyphus
2026-01-20 17:05:17 +09:00
parent cf155b173d
commit 533c743c3f
4 changed files with 45 additions and 48 deletions
+6 -9
View File
@@ -122,10 +122,8 @@ describe("buildAgent with category and skills", () => {
// #when
const agent = buildAgent(source["test-agent"], TEST_MODEL)
// #then - DEFAULT_CATEGORIES only has temperature, not model
// Model remains undefined since neither factory nor category provides it
expect(agent.model).toBeUndefined()
expect(agent.temperature).toBe(0.7)
// #then - category's built-in model is applied
expect(agent.model).toBe("google/gemini-3-pro-preview")
})
test("agent with category and existing model keeps existing model", () => {
@@ -142,9 +140,8 @@ describe("buildAgent with category and skills", () => {
// #when
const agent = buildAgent(source["test-agent"], TEST_MODEL)
// #then
// #then - explicit model takes precedence over category
expect(agent.model).toBe("custom/model")
expect(agent.temperature).toBe(0.7)
})
test("agent with category inherits variant", () => {
@@ -247,9 +244,9 @@ describe("buildAgent with category and skills", () => {
// #when
const agent = buildAgent(source["test-agent"], TEST_MODEL)
// #then - DEFAULT_CATEGORIES["ultrabrain"] only has temperature, not model
expect(agent.model).toBeUndefined()
expect(agent.temperature).toBe(0.1)
// #then - category's built-in model and skills are applied
expect(agent.model).toBe("openai/gpt-5.2-codex")
expect(agent.variant).toBe("xhigh")
expect(agent.prompt).toContain("Role: Designer-Turned-Developer")
expect(agent.prompt).toContain("Task description")
})