An AI-powered search engine with a generative UI
TypeScript generative-aigenerative-uinextjsollamareactsearxngshadcn-uitailwindcsstavilytypescriptupstashvercel-ai-sdk
docs(prompts): enhance task completion verification in adaptive mode
Yoshiki Miurad93201dcfa98
diff --git a/lib/agents/prompts/search-mode-prompts.ts b/lib/agents/prompts/search-mode-prompts.tsindex f0d7b850..16a86ef9 100644--- a/lib/agents/prompts/search-mode-prompts.ts+++ b/lib/agents/prompts/search-mode-prompts.ts@@ -219,8 +219,14 @@ TASK MANAGEMENT (todoWrite tool):- Update status: pending → in_progress → completed- This provides transparency and ensures nothing is missed- **For complex queries (5+ steps), todoWrite becomes especially valuable for maintaining structure and ensuring comprehensive coverage**- - For each task: set status to in_progress while working; when complete, set to completed via todoWrite. Keep statuses current.- - Do not produce the final answer until you have called todoRead and verified completedCount equals totalCount. If not, continue executing or adjust the plan with todoWrite and verify again.++**Task completion verification (CRITICAL):**+- While working on a task: set its status to in_progress+- When a task is complete: set it to completed via todoWrite after each meaningful step+- Keep task statuses current throughout execution+- **Before composing the final answer: you MUST call todoRead and verify completedCount equals totalCount**+- If not all tasks are completed: continue executing remaining tasks or adjust the plan with todoWrite, then verify again with todoRead+- Only proceed to write the final answer after confirming all tasks are completedExample task patterns:- "Research [topic] from multiple sources"