feat(session): re-surface uncompleted todos each model step - #391
Closed
LeXwDeX wants to merge 7 commits into
Closed
feat(session): re-surface uncompleted todos each model step#391LeXwDeX wants to merge 7 commits into
LeXwDeX wants to merge 7 commits into
Conversation
Todo lists drifted silently: todowrite is the only write path and nothing ever re-surfaced the list, so completed work stayed pending, stale items lingered, and in_progress was never set. A new TodoReminders pass runs after SessionReminders in the session run loop and appends ONE synthetic in-memory part (model-visible, never persisted) to the last user message whenever the session holds uncompleted todos — covering tool-free steps too, which a PreToolUse-based reminder cannot. Skip conditions: no todos, all settled (completed or cancelled), or the turn's last assistant message already contains a successful todowrite call (the model just updated the list itself; a failed call does not satisfy the guard). Applies per session, including child/subagent sessions that hold their own todos (issue #389).
…t mock - the in-memory convention cites SessionReminders' non-plan-mode branch; its plan-mode branch persists via updatePart and is not the pattern - the freshness guard is session-scoped (findLast), not turn-scoped - drop the tautological sessionID filter in the test mock
LeXwDeX
marked this pull request as ready for review
August 20, 2026 07:34
Encode the PR #391 review O3 backlog as explicit behavior tests: - one reminder per model step regardless of parallel tool fan-out - per-step fresh reads never accumulate reminders (no persistence) - a compacted transcript still receives the reminder
LeXwDeX added a commit
that referenced
this pull request
Aug 20, 2026
Encode the PR #391 review O3 backlog as explicit behavior tests: - one reminder per model step regardless of parallel tool fan-out - per-step fresh reads never accumulate reminders (no persistence) - a compacted transcript still receives the reminder
LeXwDeX added a commit
that referenced
this pull request
Aug 20, 2026
Encode the PR #391 review O3 backlog as explicit behavior tests: - one reminder per model step regardless of parallel tool fan-out - per-step fresh reads never accumulate reminders (no persistence) - a compacted transcript still receives the reminder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TodoReminders:session run loop 里SessionReminders之后追加一次性的内存 synthetic 提醒——会话存在未完成 todo 时,每个模型步(含无工具步)把当前未完成项渲染到 last user message,模型可见但不持久化。Closes#389
Gates
bun test test/session test/tool:748 tests / 0 fail / 7 skip(既有)bun typecheck通过测试
test/session/todo-reminders.test.ts6 例:空列表不注入、全 settled 不注入、恰好一个 synthetic part 且渲染未完成项(settled 项不出现)、新鲜度守卫跳过、旧 todowrite 后恢复提醒、失败 todowrite 不满足守卫。