Skip to content

TodoList reminder misses turn-end reconciliation (unfinished todos after turn end) #2372

Description

@airudotsh

Problem

The TodoListReminderInjector (packages/agent-core/src/agent/injection/todo-list.ts) only nudges after 10 assistant turns since the last TodoList write (and 10 since the last reminder).

This misses a common case: the agent finishes the actual work, ends the turn, but forgets to mark todos done. The turn is over in well under 10 turns, so no reminder ever fires — the todo list stays stale (pending/in_progress) with nothing to reconcile it.

Expected behavior

When a turn ends (the latest assistant step made no tool calls) with unfinished todos and no TodoList write on the way out, the next step should get a reminder right away instead of waiting out the full cadence:

  • If the work is actually complete → mark items done / clear the stale list
  • If items remain → continue with them

To keep it from nagging, the turn-end rule has its own spacing (3 assistant turns since the last reminder) and does not fire when every todo is done or when the final step was itself a TodoList write. The existing 10-turn cadence rule is unchanged.

Notes

  • The change is confined to TodoListReminderInjector plus tests.
  • Mid-turn detection uses the existing history shape: the latest assistant message having no tool calls means the turn completed.

I have a patch ready with tests (10 injector tests passing, typecheck/lint clean) and will open a PR referencing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions