fix(pi-task): serialize state updates and remind about open tasks

This commit is contained in:
Rasyidan Akbar F. 2026-09-20 21:26:48 +07:00
commit 89bebe5610
4 changed files with 195 additions and 57 deletions

View file

@ -13,7 +13,8 @@ in progress at a time.
State is stored in Pi tool-result details. It survives reloads and compaction,
follows session branches correctly, and does not create project files. A new Pi
session starts with an empty list.
session starts with an empty list. Calls are serialized, and failed or cancelled
calls do not replace the saved list. Invalid saved snapshots are ignored.
While work is active, the widget uses themed symbols and colors to distinguish
the current task (`●`) from pending tasks (`○`). The footer shows compact
@ -21,4 +22,12 @@ overall progress. When every task is complete, Pi displays a success
notification and removes both the widget and footer indicator to reclaim space.
The completed list remains available in session history.
Run `/tasks` to refresh the task UI manually.
The agent must call `task` to update statuses; finishing code does not update
items automatically. After compaction or two turns without a task call, Pi gives
the agent a short, temporary reminder of open items. If a run ends with open
items, Pi shows a warning. Neither reminder nor warning marks work complete.
Run `/tasks` to refresh the task UI manually. Run the state regression tests
with `node --experimental-strip-types --test pi/extensions/pi-task/state.test.ts`. Pi
loads the deployed extension from Home Manager, so apply the configuration and
reload Pi to use repository changes in normal sessions.