diff options
| author | Adam Malczewski <[email protected]> | 2026-06-02 14:49:49 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-02 14:49:49 +0900 |
| commit | ecb001ec7a2e573d8dedf5064e860e5a3e7788fd (patch) | |
| tree | 531371ba6f449a144b5bb45a3d226b025983bd4b /notes | |
| parent | 7c527b4d8a72159954405e720d5bf776802dc0ff (diff) | |
| download | dispatch-ecb001ec7a2e573d8dedf5064e860e5a3e7788fd.tar.gz dispatch-ecb001ec7a2e573d8dedf5064e860e5a3e7788fd.zip | |
feat(todo): port opencode's declarative whole-list todo tool
Replace the imperative id-based CRUD todo tool (add/update/list/get/remove)
with opencode's declarative whole-list design: a single `todos` param that
replaces the entire list each call. No model-visible ids, no delta reasoning,
no "task not found" spirals.
- core: TaskItem { id, content, status }; statuses pending|in_progress|
completed|cancelled. TaskList.setTasks/getTasks/onChange. New rich
TODO_DESCRIPTION adapted from opencode's todowrite.txt.
- api: TASK_MANAGEMENT_GUIDANCE system-prompt section (from anthropic.txt);
updated TOOL_DESCRIPTIONS.todo. Reload fix: TabStatusSnapshot now carries
per-tab tasks so getAllStatuses rehydrates the panel on reconnect.
- frontend: mirror types; hydrate tasks from snapshot in both restore paths;
upgrade sidebar Tasks panel to render content + all four statuses + progress.
- tests: new core task-list.test.ts (15); updated api TaskList mocks +
getAllStatuses task-snapshot coverage.
bun run check clean; 569 tests pass; all packages typecheck.
Diffstat (limited to 'notes')
| -rw-r--r-- | notes/todo-tool-redesign-plan.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/notes/todo-tool-redesign-plan.md b/notes/todo-tool-redesign-plan.md index 7e3af48..78963eb 100644 --- a/notes/todo-tool-redesign-plan.md +++ b/notes/todo-tool-redesign-plan.md @@ -84,3 +84,29 @@ in the allowlist/summon/loader/permission wiring and existing agent TOMLs. untouched. - Persistence to DB (opencode stores todos in SQLite) is **not** added — Dispatch keeps the existing in-memory per-tab `TaskList`; the visible/UX behaviour is what was failing, and that's what we fix. + +--- + +## As-built (implemented on branch td/todo-fix) + +Implemented the opencode-style declarative whole-list `todo` tool. **Deviations from the plan above:** + +- **No `priority`.** Dropped per product decision. `TaskItem = { id, content, status }`; + the tool param is `todos: Array<{ content, status }>`. +- **Reload reliability fix (new).** Todos previously blanked on page reload because they were + broadcast only via the `task-list-update` change event and were absent from the reconnect + snapshot. `TabStatusSnapshot` now carries an optional `tasks` field (core + frontend mirror); + `getAllStatuses()` includes each tab's `taskList.getTasks()` for ALL tabs (omitted when empty). + The frontend hydrates `tasks` from the snapshot in both restore paths (initial `GET /status` + map and the `statuses` WS handler) instead of hardcoding `tasks: []`. Still in-memory per-tab + (no DB; does not survive a server restart). +- **Statuses:** `pending | in_progress | completed | cancelled` (as planned). +- **UI:** the existing sidebar **Tasks** panel (`TaskListPanel.svelte`) was upgraded to render + `content`, all four statuses (completed→checked+strikethrough, in_progress→indeterminate+bold, + cancelled→dim+strikethrough, pending→empty) and a `completed/active` progress counter. No new + UI surfaces were added (panel only). +- **System prompt:** `TODO_GUIDANCE` replaced by a `TASK_MANAGEMENT_GUIDANCE` "Task Management" + section adapted from opencode's `anthropic.txt`; `TOOL_DESCRIPTIONS.todo` and the tool's own + `TODO_DESCRIPTION` adapted from `todowrite.txt`. + +Verification: `bun run check` clean; `bun run test` 569 passing; all three packages typecheck. |
