fix: merge模式下新item接受任意status,不再限制pending/in_progress

全量替换模式保持原有限制。merge语义就是信任agent传入的状态。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
oudecheng 2026-06-12 16:12:54 +08:00
parent c4d10c6413
commit 0b190b717c

View File

@ -297,7 +297,8 @@ impl Tool for TodoWriteTool {
continue;
}
}
if !is_valid_new_status(&new_status) {
// merge 模式:接受任意状态;全量替换模式:必须是 pending 或 in_progress
if !merge_mode && !is_valid_new_status(&new_status) {
validation_errors.push(format!(
"Item '{}': new items must start as 'pending' or 'in_progress', got '{}'",
content, status_str
@ -339,7 +340,8 @@ impl Tool for TodoWriteTool {
continue;
}
}
if !is_valid_new_status(&new_status) {
// merge 模式:接受任意状态;全量替换模式:必须是 pending 或 in_progress
if !merge_mode && !is_valid_new_status(&new_status) {
validation_errors.push(format!(
"Item '{}': new items must start as 'pending' or 'in_progress', got '{}'",
content, status_str