normalize cursor todo items (#1473)

This commit is contained in:
Solomon
2025-12-09 10:54:21 +00:00
committed by GitHub
parent e83e0ee169
commit 1ee05ea862
2 changed files with 18 additions and 2 deletions

View File

@@ -872,7 +872,7 @@ impl CursorToolCall {
.iter()
.map(|t| TodoItem {
content: t.content.clone(),
status: t.status.clone(),
status: normalize_todo_status(&t.status),
priority: None, // CursorTodoItem doesn't have priority field
})
.collect()
@@ -921,6 +921,16 @@ impl CursorToolCall {
}
}
fn normalize_todo_status(status: &str) -> String {
match status.to_lowercase().as_str() {
"todo_status_pending" => "pending".to_string(),
"todo_status_in_progress" => "in_progress".to_string(),
"todo_status_completed" => "completed".to_string(),
"todo_status_cancelled" => "cancelled".to_string(),
other => other.to_string(),
}
}
/* ===========================
Typed tool results for Cursor
=========================== */