feat(sisyphus-task): inherit parent model for categories and show fallback warning

- Change model priority: user override > parent model > category default
- Add ModelFallbackInfo to track model resolution type
- Show warning toast when category uses inherited or default model
- Add tests for model fallback info in task toast
This commit is contained in:
Nguyen Khac Trung Kien
2026-01-13 08:58:47 +07:00
parent dbe51e4253
commit 16c38d7230
8 changed files with 130 additions and 9 deletions
+11 -1
View File
@@ -1,5 +1,5 @@
import type { PluginInput } from "@opencode-ai/plugin"
import type { TrackedTask, TaskStatus } from "./types"
import type { TrackedTask, TaskStatus, ModelFallbackInfo } from "./types"
import type { ConcurrencyManager } from "../background-agent/concurrency"
type OpencodeClient = PluginInput["client"]
@@ -25,6 +25,7 @@ export class TaskToastManager {
isBackground: boolean
status?: TaskStatus
skills?: string[]
modelInfo?: ModelFallbackInfo
}): void {
const trackedTask: TrackedTask = {
id: task.id,
@@ -34,6 +35,7 @@ export class TaskToastManager {
startedAt: new Date(),
isBackground: task.isBackground,
skills: task.skills,
modelInfo: task.modelInfo,
}
this.tasks.set(task.id, trackedTask)
@@ -105,6 +107,14 @@ export class TaskToastManager {
const lines: string[] = []
// 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)"
lines.push(`${icon} Model: ${newTask.modelInfo.model}${suffix}`)
lines.push("")
}
if (running.length > 0) {
lines.push(`Running (${running.length}):${concurrencyInfo}`)
for (const task of running) {