Skip to content

Commit a2fa7ff

Browse files
authored
fix: support cancelled task state (anomalyco#775)
1 parent f7d6175 commit a2fa7ff

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

packages/opencode/src/tool/todo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { App } from "../app/app"
55

66
const TodoInfo = z.object({
77
content: z.string().min(1).describe("Brief description of the task"),
8-
status: z.enum(["pending", "in_progress", "completed"]).describe("Current status of the task"),
8+
status: z.enum(["pending", "in_progress", "completed", "cancelled"]).describe("Current status of the task"),
99
priority: z.enum(["high", "medium", "low"]).describe("Priority level of the task"),
1010
id: z.string().describe("Unique identifier for the todo item"),
1111
})

packages/tui/internal/components/chat/message.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ func renderToolDetails(
422422
switch todo["status"] {
423423
case "completed":
424424
body += fmt.Sprintf("- [x] %s\n", content)
425+
case "cancelled":
426+
body += fmt.Sprintf("- [~] %s\n", content)
425427
// case "in-progress":
426428
// body += fmt.Sprintf("- [ ] %s\n", content)
427429
default:

0 commit comments

Comments
 (0)