Skip to content

feat(todo): auto-cleanup stale todos + /clear-tasks command #26554

@LifetimeVip

Description

@LifetimeVip

Description

This feature adds automatic cleanup of stale (completed/cancelled) todos and introduces two new slash commands to manage active tasks.

Changes

  1. 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.

  2. New slash commands:

    • /clear-tasks — Clears all active tasks at once (English name)
    • /清除任务 — Same functionality, Chinese name for Chinese-language users
  3. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions