How I built session checklists in my AI assistant: plans the agent can't quietly rewrite
Описание и применение
Создана система чеклистов для AI‑ассистента, предотвращающая скрытое удаление и переупорядочивание задач, обеспечивающая прозрачность выполнения и сохранение состояния между сессиями.
Задача
Long AI assistant sessions cause the model to forget the plan, leading to incomplete or incorrect task execution.
Результат
The checklist system prevents the assistant from silently deleting or reordering tasks, reduces multi‑round error corrections to single‑round fixes, and preserves plan state across restarts and legacy threads.
Рабочий процесс
- 1. Define write_todos tool to create a checklist with stable IDs and status enum.
- 2. Enforce validation rules: no removal, no reordering, status changes only via updates.
- 3. Store checklist in session file and restore on thread reload.
- 4. Inject current checklist into system prompt each turn with a directive to mark only completed tasks as completed.
- 5. Provide detailed error messages that include current valid state to aid model correction.
- 6. Render checklist in UI for live visibility.
- 7. Reconstruct old plans via todoProgress() for backward compatibility.
Доказательства
The problem with long sessions is simple: the model forgets the plan. It starts three things, finishes one, and cheerfully reports that everything is done.
The tool is deliberately strict ... Existing items can never be replaced or removed.
Before your final reply, use write_todos to mark work actually completed as completed. Leave unfinished work pending or in_progress; do not mark it completed without evidence.
An earlier trace showed the model wasting five write_todos rounds fighting the validation — bad ID, reorder attempt, removal attempt — because each error just said "no".
Checklists are saved with the session file and restored when the thread reloads.
- Дата записи: 2026-10-02T11:55:52.263Z