Skip to content

The open source coding agent.

TypeScript

fix: support cancelled task state (#775)

Robb Curralla2fa7ffa425b
diff --git a/packages/opencode/src/tool/todo.ts b/packages/opencode/src/tool/todo.ts
index 941564605ea..8a330c2d64d 100644
--- a/packages/opencode/src/tool/todo.ts
+++ b/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"),
})
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.go
index 3414a77d551..fe34ad5ab97 100644
--- a/packages/tui/internal/components/chat/message.go
+++ b/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: