anomalyco / anomalyco/opencode

[BUG] todowrite list goes stale for several turns, stays stuck on one item, and leaks the previous task's todos when switching to a new task

Open
#41,359 4 comments 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 9, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

On the desktop app, the todo list (todowrite tool) frequently does not update for many turns:

  • It stays stuck on one item (often marked in_progress) even though the agent has moved far past it.
  • When the user switches to a different task (or even continues a new path in the same session), the old task's todo list remains displayed and the agent keeps referencing it, instead of resetting/initializing a fresh todo for the new task.
  • Toggling between tasks: the todo shown in the TUI sidebar does not reflect the current activity at all for long stretches (several turns / many minutes).

This makes the todo feature untrustworthy as progress indicator, and (more importantly) it is a real confusion for the agent itself, since it looks at the todos and thinks they still describe the current job.

Repro (Desktop)

  1. Start a multi-step task with a todo list (5-6 items).
  2. Let the agent work; after 2-3 turns the todo list shows only 1 item "in_progress" that is stale — the agent has since done later steps (edits, tests).
  3. Ask a new, unrelated prompt: "now write tests for X" — the old todo list still displayed (previous task items), agent picks up old list or doesn't create a new one.
  4. The todo list only refreshes after the agent happens to call todowrite again, or never, until user manually prompts.

Expected

  • The agent should refresh the todo list every turn (or at least after each completed step / before/after tool-heavy operations), per current turn.
  • When the user's new prompt starts a different task (detectable by "first user message after task complete" or on /reset or when the user asks something not covered by existing todos), the todo list should be reset/archived and a new one started.
  • The UI should mark when todos correspond to an older task (e.g. stale display) rather than silently keeping them.

Related

  • #22288 (closed: todo hang) — this is the stale/never-updated variant persisting into desktop.
  • #27560 (closed: model completes but doesn't mark todo) — part of the same UX: the model rarely refreshes.

Suggestion for fix

Make the todos a first-class part of the agent loop: after every turn (or at least after any tool that mutates files), the agent receives the prompt/context include "your current todo list is stale, update it if needed" or a lifecycle hook that auto-updates. For task switch, an explicit "/todo reset" or automatic detection.

Reference to the current doc: the todowrite tool should be treated as part of the contract: every task change must update todos the same turn (like the checklist in TDD skill wfh.com).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.