Carry forward subtaskId/cost/tokens/line changes when the LLM rewrites todo text, including sequential updates.\n\nIncludes [TODO-DEBUG] instrumentation across extension/webview and regression tests.
Match todos by subtaskId first to retain tokens/cost/added/removed when
content or derived IDs change. Improve UI rendering to suppress
misleading +0/−0 while running unless values are explicitly provided.
Relates to #5376
Align extension->webview message contract with extended AggregatedCosts/SubtaskDetail (added/removed + totals), fixing check-types and enabling line deltas in UI.
Compute per-task lines added/removed from tool diffStats, persist on history items, and aggregate recursively across descendants.\n\nRender +/− in todo rows, task header, and expanded task details with diff-like green/red styling. Update i18n labels across locales and adjust layout/alignment.\n\nRelates to PR #10765
Ensure delegation roll-up reads final persisted cost/tokens by awaiting background usage collection before reopening parent.
Add regression test covering late usage persistence ordering.
Prefer history todos when they contain subtaskId/tokens/cost so updateTodoList preserves injected metadata.
Adds regression test covering history-vs-memory selection.
System-generated todo updates (e.g. cost syncs) will now be processed
silently without showing a 'Todo List Updated' notification, reducing
chat noise. User edits remain visible.
Use todo list costs (source of truth) to derive subtasks total in
TaskHeader tooltip, de-duping by subtaskId and falling back to
history-derived subtaskDetails when needed.
- Add system_update_todos message type to distinguish system-generated
todo updates from actual user edits
- Remove unnecessary edit button from todo list update notifications
- Update UI rendering logic to handle system updates appropriately
- Update tests to reflect new message type behavior
Enhance the direct todo-subtask linking mechanism to handle edge cases
where subtaskId links may be missing during history resume or delegation.
Changes:
- UpdateTodoListTool: Use dual-strategy metadata matching (ID-first,
then content-based fallback) to preserve tokens/cost across updates
- ClineProvider: Add deterministic fallback anchor selection
(in_progress > pending > last completed > synthetic) for both
delegation-time linking and cost write-back on resume
- ClineProvider: Create synthetic anchor todo when no todos exist
- Clean up excessive logging statements
Tests:
- Add fallback anchor tests for reopenParentFromDelegation
- Add delegation-time linking tests with various todo states
- Add SubtaskDetail interface with id, name, tokens, cost, status fields
- Add buildSubtaskDetails() function to aggregate task costs
- Pass childDetails in taskWithAggregatedCosts message
- Integrate subtask cost display into TodoListDisplay component
- Add fuzzy matching to match todo items with subtask details
- Display token count and cost next to matching todo items
- Add 16 tests for TodoListDisplay with subtask cost functionality
Related to: #5376