MoonshotAI / MoonshotAI/kimi-code
TodoList reminder misses turn-end reconciliation (unfinished todos after turn end)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
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
TodoListReminderInjectorplus 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/agent-core/src/agent/injection/todo-list.ts and the existing injector tests. Check the history shape used to detect a completed turn and the current reminder cadence, then run the injector tests, typecheck, and lint. Done means unfinished todos trigger the turn-end reminder with the specified spacing while completed lists and final TodoList writes do not.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100