Description
This feature adds automatic cleanup of stale (completed/cancelled) todos and introduces two new slash commands to manage active tasks.
Changes
-
Auto-cleanup: Completed/cancelled todos are filtered out before saving (in todowrite.txt tool) and on session load (in session/todo.ts). Only pending and in_progress tasks are preserved.
-
New slash commands:
/clear-tasks — Clears all active tasks at once (English name)
/清除任务 — Same functionality, Chinese name for Chinese-language users
-
i18n: Added Chinese translations in zh.ts for the new command descriptions and category.
Files changed
packages/opencode/src/tool/todowrite.txt — Updated description to mention auto-removal
packages/opencode/src/session/todo.ts — Filter out completed/cancelled tasks on load
packages/opencode/src/command/index.ts — Register new slash commands
packages/app/src/i18n/zh.ts — Chinese translations for new commands
Why this change
Stale todos accumulate in the chat UI and persist across conversations. This change keeps the todo list clean automatically and gives users a quick way to reset tasks.
Verification
npm run typecheck — zero errors
npm test — 62/62 all passing
- Manual test: todos are filtered correctly on reload
Description
This feature adds automatic cleanup of stale (completed/cancelled) todos and introduces two new slash commands to manage active tasks.
Changes
Auto-cleanup: Completed/cancelled todos are filtered out before saving (in
todowrite.txttool) and on session load (insession/todo.ts). Onlypendingandin_progresstasks are preserved.New slash commands:
/clear-tasks— Clears all active tasks at once (English name)/清除任务— Same functionality, Chinese name for Chinese-language usersi18n: Added Chinese translations in
zh.tsfor the new command descriptions and category.Files changed
packages/opencode/src/tool/todowrite.txt— Updated description to mention auto-removalpackages/opencode/src/session/todo.ts— Filter out completed/cancelled tasks on loadpackages/opencode/src/command/index.ts— Register new slash commandspackages/app/src/i18n/zh.ts— Chinese translations for new commandsWhy this change
Stale todos accumulate in the chat UI and persist across conversations. This change keeps the todo list clean automatically and gives users a quick way to reset tasks.
Verification
npm run typecheck— zero errorsnpm test— 62/62 all passing