From c6769fdab1a0d8c99fea2a882bc4bfcf8f199b17 Mon Sep 17 00:00:00 2001 From: tintinweb Date: Tue, 17 Mar 2026 16:52:07 +0100 Subject: [PATCH] v0.3.2 --- CHANGELOG.md | 8 +++++++- package-lock.json | 4 ++-- package.json | 2 +- src/index.ts | 10 +++++++++- src/task-store.ts | 4 ++-- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 919f313..a05de92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.3.2] - 2026-03-17 + +### Fixed +- **Completed tasks no longer vanish from the list** — completed tasks are now persisted to disk so they survive reloads and show as strikethrough instead of disappearing. Use "Clear completed" in `/tasks` to explicitly remove them. + ## [0.3.1] - 2026-03-16 ### Added - **Local-by-default task persistence** — tasks now auto-persist to `/.pi/tasks/tasks.json` on every mutation and reload on restart. No config needed. Set `PI_TASKS=off` to opt out (CI/automation). - **Settings persistence** — `persistTasks` and `autoCascade` settings survive restarts via `/.pi/tasks-config.json`. - **"Persist tasks" toggle in Settings** — `/tasks` → Settings now shows two toggles: auto-execute and persist. Both are saved immediately to `tasks-config.json`. -- **Completed tasks excluded from disk** — only `pending` and `in_progress` tasks are written to disk. Completed tasks are in-memory only and pruned on restart. +- **Completed tasks excluded from disk** — only `pending` and `in_progress` tasks are written to disk. Completed tasks are in-memory only and pruned on restart. *(Reverted in 0.3.2 — completed tasks are now persisted.)* - **Absolute path support** — `TaskStore` now accepts an absolute file path in addition to a short list ID. ### Changed @@ -68,6 +73,7 @@ Initial release — Claude Code-style task tracking and coordination for pi. - **Background process tracker** — output buffering (stdout + stderr), waiter notification, graceful stop with timeout escalation (SIGTERM → 5s → SIGKILL). - **78 unit tests** — task store CRUD, dependencies, warnings, file persistence; widget rendering, icons, spinners, token/duration formatting; process tracker lifecycle. +[0.3.2]: https://github.com/tintinweb/pi-tasks/releases/tag/v0.3.2 [0.3.1]: https://github.com/tintinweb/pi-tasks/releases/tag/v0.3.1 [0.3.0]: https://github.com/tintinweb/pi-tasks/releases/tag/v0.3.0 [0.2.0]: https://github.com/tintinweb/pi-tasks/releases/tag/v0.2.0 diff --git a/package-lock.json b/package-lock.json index 143b209..ce67e4e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tintinweb/pi-tasks", - "version": "0.3.1", + "version": "0.3.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@tintinweb/pi-tasks", - "version": "0.3.1", + "version": "0.3.2", "license": "MIT", "dependencies": { "@mariozechner/pi-coding-agent": "^0.57.1", diff --git a/package.json b/package.json index 4fff718..0418589 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tintinweb/pi-tasks", - "version": "0.3.1", + "version": "0.3.2", "description": "A pi extension that brings Claude Code-style task tracking and coordination to pi.", "author": "tintinweb", "license": "MIT", diff --git a/src/index.ts b/src/index.ts index 2c954b6..7495a3b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -210,7 +210,15 @@ export default function (pi: ExtensionAPI) { }; }); - // Grab UI + extension context from every tool execution + // Grab UI context early — before_agent_start fires before any tool calls, + // so persisted tasks show up immediately on session resume. + pi.on("before_agent_start", async (_event, ctx) => { + latestCtx = ctx; + widget.setUICtx(ctx.ui as UICtx); + if (store.list().length > 0) widget.update(); + }); + + // Keep latestCtx fresh on every tool execution as well. pi.on("tool_execution_start", async (_event, ctx) => { latestCtx = ctx; widget.setUICtx(ctx.ui as UICtx); diff --git a/src/task-store.ts b/src/task-store.ts index 4516f35..aa21e8e 100644 --- a/src/task-store.ts +++ b/src/task-store.ts @@ -82,12 +82,12 @@ export class TaskStore { } catch { /* corrupt file — start fresh */ } } - /** Write store to disk atomically (file-backed mode only). Completed tasks are not persisted. */ + /** Write store to disk atomically (file-backed mode only). */ private save(): void { if (!this.filePath) return; const data: TaskStoreData = { nextId: this.nextId, - tasks: Array.from(this.tasks.values()).filter(t => t.status !== "completed"), + tasks: Array.from(this.tasks.values()), }; const tmpPath = this.filePath + ".tmp"; writeFileSync(tmpPath, JSON.stringify(data, null, 2));