Skip to content

Add session-scoped todo reminders - #1

Merged
toddwyl merged 1 commit into
mainfrom
codex/session-todo-reminder
Apr 27, 2026
Merged

toddwyl merged 1 commit into
mainfrom
codex/session-todo-reminder

Conversation

@toddwyl

@toddwyl toddwyl commented Apr 24, 2026 •

Copy link
Copy Markdown
Owner

Motivation

Codex exposes update_plan as a TODO/checklist tool that clients can render, but core did not keep an active TODO list in session state. That meant later sampling requests had to rely on whatever remained visible in transcript context, and resumed sessions could lose the latest unfinished checklist as executable state.

The goal of this change is to make update_plan behave more like an active session checklist: the UI still receives PlanUpdate, while core also remembers unfinished work and can remind the model at the moments where task drift is most likely. The reminder is intentionally one-shot so tool continuations do not receive the same TODO reminder on every model request.

What changed

  • Store the active update_plan payload in session state as active_todo_list.
  • Clear the active TODO state when update_plan is empty or every step is completed.
  • Restore the active TODO list on resume by scanning rollout history for the latest unfinished update_plan call.
  • Queue a developer-message TODO reminder after update_plan, at the start of a later user turn with active todos, and after resume restores active todos.
  • Consume each queued reminder on the next sampling request so reminders do not repeat across retries or tool continuations.
  • Add core coverage for reminder formatting, completed-list skipping, resume restoration, handler state updates, and request-body injection.

How it works

PlanHandler now parses update_plan arguments once, stores them on the Session, and still emits the same PlanUpdate event for clients. SessionState owns the active TODO payload plus a pending-reminder flag. run_turn queues a reminder when a real user turn starts, and run_sampling_request appends the reminder as an ephemeral developer message only when that flag is pending.

For resumed sessions, initial history restoration asks todo_reminder to recover the last unfinished update_plan from rollout items. Completed-only plans are ignored so old finished work does not come back after resume.

Verification

  • cargo test -p codex-core todo_reminder
  • cargo test -p codex-core update_plan_

Documentation

No user-facing documentation update is needed. This is internal behavior for existing update_plan handling.

@toddwyl
toddwyl force-pushed the codex/session-todo-reminder branch from 8e790d3 to f1c20d7 Compare April 24, 2026 04:06
@toddwyl
toddwyl force-pushed the codex/session-todo-reminder branch from f1c20d7 to 3542eb8 Compare April 24, 2026 06:31
@toddwyl toddwyl changed the title Add session todo reminders Add session-scoped todo reminders Apr 27, 2026
@toddwyl
toddwyl merged commit e8658a4 into main Apr 27, 2026
Sign up for free to 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