Session-scoped active todo reminders for update_plan
What variant of Codex are you using?
CLI / App core session engine (codex-core)
What feature would you like to see?
I would like update_plan to maintain a session-scoped active todo list and use it to remind the model at task-continuation boundaries.
Since external PRs are not currently accepted for this repository, I opened this issue with a reference implementation in a fork PR:
- Reference PR: https://github.com/toddwyl/codex/pull/1
Problem
update_plan is already useful as a structured TODO/checklist tool that clients can render, but the core session does not currently treat the latest unfinished plan as active execution state.
In practice this creates a few gaps:
- The UI can receive and render a
PlanUpdate, but the model still relies on normal transcript context to remember the checklist later. - A later user turn such as "continue" may not reliably steer the model back to the unfinished
in_progress/pendingitems. - A resumed session can restore transcript history, but there is no explicit active todo state recovered from the latest unfinished
update_plancall. - A naive reminder on every model request would be too noisy, especially during tool continuations and retries.
The intended behavior is closer to Claude Code's TodoWrite-style workflow: the todo list is not just UI decoration; it is active session state that helps prevent task drift during long-running work.
Proposed behavior
When update_plan has unfinished items, Codex should keep that plan as the session's active todo list and remind the model only when that reminder is useful:
- after
update_planupdates the active todo list - at the beginning of a later user turn while unfinished todos exist
- after
resumerestores an unfinished todo list from history
The reminder should be one-shot: once it is injected into the next sampling request, it should be consumed so the same todo list is not repeated on every model request or tool continuation.
If update_plan is empty or every item is completed, the active todo list should be cleared.
Reference implementation
The fork PR implements the behavior as follows:
- Adds
active_todo_listtoSessionState. - Updates
PlanHandlerso parsedupdate_planarguments are stored in session state before the existingPlanUpdateevent is emitted. - Clears active todo state when the plan is empty or all steps are completed.
- Adds a pending-reminder flag so reminders are queued and consumed once.
- Queues reminders after
update_plan, on new user turns with active todos, and after resume restores active todos. - Appends the reminder as an ephemeral developer message in
run_sampling_requestonly when a reminder is pending. - Restores active todos on resume by scanning rollout items for the latest unfinished
update_planfunction call.
The reference PR uses the name active_todo_list rather than latest_todo_list because the state represents the current unfinished checklist, not just the most recent plan payload.
Verification in the reference PR
The fork PR includes tests covering:
- reminder formatting
- skipping empty / completed todo lists
- restoring the latest unfinished
update_planfrom rollout history - storing and clearing active todo state through the
update_planhandler - injecting and consuming the reminder in model request construction
Commands run locally:
cargo test -p codex-core todo_reminder
cargo test -p codex-core update_plan_
Related issues
This appears related to, but narrower than, these existing issues:
- #2966 asks for TODO support for long-running tasks.
- #18920 asks for the
update_plantask list to remain visibly rendered in the TUI.
This issue is specifically about the core session/model-reminder behavior: preserving the unfinished update_plan checklist as active execution state and injecting a bounded reminder to reduce task drift.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗