From 1bb5a3a037a00a4d9b8555534cb884769bd14766 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 14 Feb 2026 19:07:04 +0900 Subject: [PATCH] fix: prefer id matching when deleting todos (Cubic feedback) - When deleting tasks, prefer matching by id if present - Fall back to content matching only when todo has no id - Prevents deleting unrelated todos with same subject --- src/tools/task/todo-sync.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/tools/task/todo-sync.ts b/src/tools/task/todo-sync.ts index 0a4d32d1..0f5e63fd 100644 --- a/src/tools/task/todo-sync.ts +++ b/src/tools/task/todo-sync.ts @@ -108,11 +108,16 @@ export async function syncTaskTodoUpdate( }); const currentTodos = extractTodos(response); const taskTodo = syncTaskToTodo(task); - const nextTodos = currentTodos.filter((todo) => - taskTodo - ? !todosMatch(todo, taskTodo) - : todo.content !== task.subject - ); + const nextTodos = currentTodos.filter((todo) => { + if (taskTodo) { + return !todosMatch(todo, taskTodo); + } + // Deleted task: match by id if present, otherwise by content + if (todo.id) { + return todo.id !== task.id; + } + return todo.content !== task.subject; + }); const todo = taskTodo; if (todo) {