refactor(sisyphus-task): use dynamic model fallback from OpenCode config

- Remove hardcoded "anthropic/claude-sonnet-4-5" fallback
- Fetch systemDefaultModel from client.config.get() at tool boundary
- Add 'category-default' and 'system-default' fallback types
- Use switch(actualModel) for cleaner type detection
- Add guard clauses and fail-loud validation for invalid models
- Wrap config fetch in try/catch for graceful degradation
- Update toast messages with typed suffixMap
This commit is contained in:
Kenny
2026-01-14 14:45:01 -05:00
parent 68e63badbd
commit 3f0fe3b29b
5 changed files with 153 additions and 49 deletions
+6 -1
View File
@@ -110,7 +110,12 @@ export class TaskToastManager {
// Show model fallback warning for the new task if applicable
if (newTask.modelInfo && newTask.modelInfo.type !== "user-defined") {
const icon = "⚠️"
const suffix = newTask.modelInfo.type === "inherited" ? " (inherited)" : " (default)"
const suffixMap: Partial<Record<ModelFallbackInfo["type"], string>> = {
inherited: " (inherited)",
"category-default": " (category default)",
"system-default": " (system default)",
}
const suffix = suffixMap[newTask.modelInfo.type] ?? ""
lines.push(`${icon} Model: ${newTask.modelInfo.model}${suffix}`)
lines.push("")
}