Skip to content

Commit dbe1b25

Browse files
committed
feat(todo-continuation): show remaining tasks list in continuation prompt
Include the list of incomplete todos with their status in the continuation prompt so the agent knows exactly what tasks remain.
1 parent 6bcc3c3 commit dbe1b25

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/hooks/todo-continuation-enforcer.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,16 @@ export function createTodoContinuationEnforcer(
231231
return
232232
}
233233

234-
const prompt = `${CONTINUATION_PROMPT}\n\n[Status: ${todos.length - freshIncompleteCount}/${todos.length} completed, ${freshIncompleteCount} remaining]`
234+
const incompleteTodos = todos.filter(t => t.status !== "completed" && t.status !== "cancelled")
235+
const todoList = incompleteTodos
236+
.map(t => `- [${t.status}] ${t.content}`)
237+
.join("\n")
238+
const prompt = `${CONTINUATION_PROMPT}
239+
240+
[Status: ${todos.length - freshIncompleteCount}/${todos.length} completed, ${freshIncompleteCount} remaining]
241+
242+
Remaining tasks:
243+
${todoList}`
235244

236245
try {
237246
log(`[${HOOK_NAME}] Injecting continuation`, { sessionID, agent: agentName, model, incompleteCount: freshIncompleteCount })

0 commit comments

Comments
 (0)