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.
This commit is contained in:
hannesrudolph 2025-07-29 09:28:55 -06:00
parent 85364b88c0
commit de4959420d

View file

@ -558,7 +558,10 @@ export class Task extends EventEmitter<ClineEvents> {
public async overwriteClineMessages(newMessages: ClineMessage[]) {
this.clineMessages = newMessages
restoreTodoListForTask(this)
// Only restore todo list from messages if we don't already have initialTodos
if (!this.todoList || this.todoList.length === 0) {
restoreTodoListForTask(this)
}
await this.saveClineMessages()
}