GeezerVison is showing github.com — v2: restoring `todowrite` (#56947) left its prompt guidance behind, so models ignore it when enabled · Issue #59259 · anomalyco/opencode
v2: restoring todowrite (#56947) left its prompt guidance behind, so models ignore it when enabled #59259DescriptionDescription
With experimental.todo: true the todowrite tool is registered and callable, but models practically never call it. Enabling the flag is not enough: the only thing that mentions the tool is its own tool description, and nothing in the system prompt establishes that the agent should track tasks at all.
In practice a task with 3+ distinct steps produces zero todowrite calls until the user explicitly asks for a todo list.
opencode v2.1.4-local, verified on dev ed74ec82ce.
Reproduce
- Set
experimental.todo: true.
- Give an agent a task with 3+ distinct steps ("add X, update the tests, run the checks").
- Observe: no
todowrite call. The model just works through the steps. The tool description's own trigger — "Use it proactively when a task has 3 or more distinct steps" — never fires.
Root cause
The tool was restored without the prompt guidance that used to accompany it.
7feefb697f refactor: remove todo tool (#35989) deleted the tool and the text that told models to use it: packages/core/src/session/runner/prompt/anthropic.txt (52 lines) and a 44-line packages/core/src/tool/todowrite.txt. The removed prompt text included:
- "You have access to the todowrite tool to help you manage and plan tasks. Use it VERY frequently..."
- "It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks..."
8f7db12b2a feat: restore the todowrite tool behind an experimental flag (#56947) restored the tool, a 7-line description, and the whole TUI/app surface. No prompt file appears in that diff.
Current state on dev:
packages/core/src/tool/plugin/todo.ts:50 gates registration on experimental.todo === true; :57 registers with codemode: false, so the model does see a native tool.
packages/core/src/tool/todowrite.txt is 7 lines / 512 bytes. Line 3 carries the only trigger anywhere.
packages/core/src/session/runner/prompt/system.txt — 0 occurrences of "todo".
- Every provider template (
anthropic, gpt, gpt-astra, kimi, meta, trinity) — 0 occurrences. v1's Anthropic task-management section did not survive into v2.
- Nothing injects a reminder when the agent goes many steps without touching the list.
So the only instruction is a tool description competing with every other tool description, while everything else the harness cares about (shell usage, editing, response shape) is stated in system.txt. Models follow the system prompt; a description is advisory.
Prior attempts
All of these were against v1. v2 has the tool back and the guidance is still missing.
Proposed fix
Render the guidance conditionally, the way tool guidance already works:
packages/core/src/session/system-prompt.ts:9-27 already injects shell / write / edit bullets into ${OPENCODE_TOOL_GUIDANCE}.
- Add a
tools.includes("todowrite") branch with a short block: when the task has 3+ distinct steps, write the list first; keep one item in progress; mark items completed immediately instead of batching.
- Nothing renders when the flag is off, so the prompt stays byte-identical for everyone who does not enable it.
I'm keeping the patch in my own fork for now and can open a PR if you want this upstream. Reacted by AlexSilverLight and Nathan Brown Activityopencode-agent commented on Oct 26, 2026 Thanks for the detailed write-up and for tracing it back to #35989 and #56947.
You're asking for the system prompt to include todo guidance when experimental.todo is enabled. It would sit in a conditional block in SessionSystemPrompt.render, like the existing shell/write/edit bullets, so nothing changes for anyone who leaves the flag off. Right now the tool is registered and callable as #56947 intended, and the only usage hint is in its tool description. So I'm filing this as a feature request rather than a bug. Maintainers will consider it, along with your offer to open a PR.
Until then, you can get most of the effect by putting the same guidance in your AGENTS.md or in the config instructions. For example: "For tasks with 3+ distinct steps, call todowrite with the full plan before starting, keep one item in_progress, and mark items completed as soon as each is done."
Related issues:
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|