#5 root cause (reproduced): getTask — the shared load for the entire per-task API — plus the mutation helpers updateTaskUnlocked, updateStep, readPromptForArchive, and resetPromptCheckboxes all read PROMPT.md unguarded. An unreadable PROMPT.md (root-owned from a prior `sudo` run -> EACCES, PROMPT.md being a directory -> EISDIR, transient FS error) threw and 500'd every per-task operation (GET/DELETE/PATCH/retry/reset/archive) for every task, while the PROMPT.md-free board list and create kept working. These reads are now best-effort: degrade (empty prompt / unsynced steps / skipped cosmetic sync) and log, so a PROMPT.md hiccup can never brick task management. Added a symptom- verification test that forces EISDIR and asserts getTask/updateTask/archiveTask still succeed. #10c: the dashboard badge-snapshot cache only evicted on hard-delete, so archived tasks were re-cached via task:updated and retained for the daemon's lifetime — a slow memory leak. New isBadgeEligibleTask predicate gates the create/update listeners so archived tasks are evicted (matching the startup prime's includeArchived:false). Added a unit test for the invariant. Updates the #5 changeset to cover the real fix; adds a badge-eviction changeset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
883 B
@runfusion/fusion
| @runfusion/fusion |
|---|
| patch |
summary: Task API operations no longer fail with 500 when a task's PROMPT.md can't be read; server also logs 500 causes.
category: fix
dev: getTask (the shared load for GET/DELETE/PATCH/retry/reset/archive) and the mutation helpers updateTaskUnlocked, updateStep, readPromptForArchive, and resetPromptCheckboxes (packages/core/src/store.ts) read PROMPT.md unguarded, so an unreadable file (root-owned from a prior sudo run → EACCES, PROMPT.md being a directory → EISDIR, transient FS error) 500'd every per-task op while the PROMPT.md-free board list/create kept working. These reads are now best-effort (degrade + log). Diagnosability: rethrowAsApiError preserves the original error as Error cause and the /api boundary logs stack + cause for 5xx (packages/dashboard/src/api-error.ts, server.ts); client body stays generic in production.