fix(sisyphus-task): correct modelInfo.type detection to compare actual resolved model

The previous detection checked if parentModelString exists, but the
resolution uses a ?? chain where default may win over parent. Now
compares actualModel against each source to correctly identify type.

Fixes: model toast incorrectly showing 'inherited' when default was used
This commit is contained in:
Nguyen Khac Trung Kien
2026-01-14 22:15:05 +07:00
parent 16c38d7230
commit 68e63badbd
2 changed files with 133 additions and 9 deletions
+11 -7
View File
@@ -345,13 +345,17 @@ ${textContent || "(No text output)"}`
return `❌ Unknown category: "${args.category}". Available: ${Object.keys({ ...DEFAULT_CATEGORIES, ...userCategories }).join(", ")}`
}
const userHasDefinedCategory = userCategories?.[args.category]?.model !== undefined
if (userHasDefinedCategory) {
modelInfo = { model: resolved.config.model, type: "user-defined" }
} else if (parentModelString) {
modelInfo = { model: parentModelString, type: "inherited" }
} else if (DEFAULT_CATEGORIES[args.category]?.model) {
modelInfo = { model: DEFAULT_CATEGORIES[args.category].model, type: "default" }
// Determine model source by comparing against the actual resolved model
const actualModel = resolved.config.model
const userDefinedModel = userCategories?.[args.category]?.model
const defaultModel = DEFAULT_CATEGORIES[args.category]?.model
if (actualModel === userDefinedModel) {
modelInfo = { model: actualModel, type: "user-defined" }
} else if (actualModel === parentModelString) {
modelInfo = { model: actualModel, type: "inherited" }
} else if (actualModel === defaultModel) {
modelInfo = { model: actualModel, type: "default" }
}
agentToUse = SISYPHUS_JUNIOR_AGENT