From e17c4b748d17335669de3796a1096bfe4513b532 Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Mon, 29 Jun 2026 10:50:31 +0800 Subject: [PATCH] refactor(tool-todo): store the trimmed content, matching the dedupe key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit toTodoList dedupes and length-checks on the trimmed content but stored the raw item.content, so a todo with leading/trailing whitespace was deduped by its trimmed form yet persisted untrimmed — the stored value and the uniqueness key could differ. Store the trimmed content so the persisted list matches what was validated. --- packages/todo/tool-todo/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/todo/tool-todo/src/index.ts b/packages/todo/tool-todo/src/index.ts index 8297bc3acf..cfed58788f 100644 --- a/packages/todo/tool-todo/src/index.ts +++ b/packages/todo/tool-todo/src/index.ts @@ -70,7 +70,7 @@ function toTodoList(raw: { content: string; status: string }[]): TodoItem[] { throw new Error(`invalid todo status ${JSON.stringify(status)}: expected one of ${STATUSES.join(', ')}`) } if (status === 'in_progress') inProgress++ - todos.push({ content: item.content, status }) + todos.push({ content, status }) } if (inProgress > 1) { throw new Error(`invalid todos: at most one task may be in_progress, got ${inProgress}`)