From de4959420d7ce63bc19aebcd3fcc97afeb3b5e13 Mon Sep 17 00:00:00 2001 From: hannesrudolph Date: Tue, 29 Jul 2025 09:28:55 -0600 Subject: [PATCH] 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. --- src/core/task/Task.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index 71b86c22af..76e2c2ae57 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -558,7 +558,10 @@ export class Task extends EventEmitter { 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() }