Skip to content

Commit de49594

Browse files
committed
fix: preserve initialTodos when overwriting cline messages
The todo list was not being rendered in new subtasks because the overwriteClineMessages method was calling restoreTodoListForTask unconditionally, which would overwrite any initialTodos passed during task construction. This fix only restores the todo list from messages if there are no existing todos.
1 parent 85364b8 commit de49594

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/task/Task.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,10 @@ export class Task extends EventEmitter<ClineEvents> {
558558

559559
public async overwriteClineMessages(newMessages: ClineMessage[]) {
560560
this.clineMessages = newMessages
561-
restoreTodoListForTask(this)
561+
// Only restore todo list from messages if we don't already have initialTodos
562+
if (!this.todoList || this.todoList.length === 0) {
563+
restoreTodoListForTask(this)
564+
}
562565
await this.saveClineMessages()
563566
}
564567

0 commit comments

Comments
 (0)