Просмотр исходного кода

fix: support cancelled task state (#775)

Robb Currall 7 месяцев назад
Родитель
Сommit
a2fa7ffa42

+ 1 - 1
packages/opencode/src/tool/todo.ts

@@ -5,7 +5,7 @@ import { App } from "../app/app"
 
 const TodoInfo = z.object({
   content: z.string().min(1).describe("Brief description of the task"),
-  status: z.enum(["pending", "in_progress", "completed"]).describe("Current status of the task"),
+  status: z.enum(["pending", "in_progress", "completed", "cancelled"]).describe("Current status of the task"),
   priority: z.enum(["high", "medium", "low"]).describe("Priority level of the task"),
   id: z.string().describe("Unique identifier for the todo item"),
 })

+ 2 - 0
packages/tui/internal/components/chat/message.go

@@ -422,6 +422,8 @@ func renderToolDetails(
 					switch todo["status"] {
 					case "completed":
 						body += fmt.Sprintf("- [x] %s\n", content)
+					case "cancelled":
+						body += fmt.Sprintf("- [~] %s\n", content)
 					// case "in-progress":
 					// 	body += fmt.Sprintf("- [ ] %s\n", content)
 					default: