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:
@@ -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("")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user