Skip to content

feat(session): re-surface uncompleted todos each model step - #394

Merged
LeXwDeX merged 7 commits into
devfrom
feat/todo-step-reminders
Aug 20, 2026
Merged

feat(session): re-surface uncompleted todos each model step#394
LeXwDeX merged 7 commits into
devfrom
feat/todo-step-reminders

Conversation

@LeXwDeX

Copy link
Copy Markdown
Owner

Summary

  • 新增 TodoReminders:session run loop 里 SessionReminders 之后追加一次性的内存 synthetic 提醒——会话存在未完成 todo 时,每个模型步(含无工具步)把当前未完成项渲染到 last user message,模型可见但不持久化。
  • 三个跳过条件:无 todo;全部 settled(completed/cancelled);当前回合最后一条 assistant 已含成功的 todowrite 调用(新鲜度守卫,失败的 todowrite 不算)。
  • 覆盖子会话/子代理各自的 todo(todowrite 非 root-only)。
  • 原方案(PreToolUse additionalContexts)经探索否定:N 个并行工具会拼 N 份重复提醒且无工具步看不到(见 issue feat: surface stale todo state to the model each step #389 探索记录)。

Closes#389

Gates

  • bun test test/session test/tool:748 tests / 0 fail / 7 skip(既有)
  • bun typecheck 通过
  • root lint 4844/4850 warnings,0 errors

测试

test/session/todo-reminders.test.ts 6 例:空列表不注入、全 settled 不注入、恰好一个 synthetic part 且渲染未完成项(settled 项不出现)、新鲜度守卫跳过、旧 todowrite 后恢复提醒、失败 todowrite 不满足守卫。

@LeXwDeX
LeXwDeXforce-pushed the feat/todo-step-reminders branch from e1d8c24 to 53a861eCompareAugust 20, 2026 09:12
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
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
…ssertions
- .specgit.yaml context.branch follows the renamed delivery branch
(feat/389-issue389 was a duplicated-name mistake; naming convention
is type/short-name)
- remove four unnecessary non-null assertions in release-notes.ts so
the branch adds zero lint warnings over the dev baseline (4850)
@LeXwDeX
LeXwDeXforce-pushed the feat/todo-step-reminders branch from 53a861e to a9cf900CompareAugust 20, 2026 09:20
@LeXwDeX
LeXwDeX merged commit e9f38a0 into devAug 20, 2026
8 of 9 checks passed
@LeXwDeX
LeXwDeX deleted the feat/todo-step-reminders branch August 20, 2026 09:27
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@LeXwDeX