Repository navigation
Conversation
The Dock / taskbar / tray unread count summed every `unread` entry in the persisted agent-status table, which is only pruned by the delete funnels that call `remove`. Nodes dropped any other way left their entries behind for good: one machine had 633 entries, 20 unread, 1 of them a live node, so the Dock read 20 beside a single tab badge of 1. - Count unread over the nodes the projects hold (closed projects included), through the same unread-id signature the tab bar uses. - Report the badge only once the workspace is loaded, so a boot-time 0 followed by the real count does not read as a rise on Windows. - At load, drop status entries whose node is in no project and whose last hook event is older than 7 days. Skipped when the load is incomplete (no projects, or an unavailable one).
|
Thanks @Senzaiken, this landed. Your commit (bfe63cc) is on The one change on top: the orphan sweep's grace window went from 7 days to 90 days, and a test now pins it equal to Thanks for tracking this down, and for the tests. The |
…(90 days) Follow-up to eneskirca#1311. The boot sweep dropped an entry whose node is in no project once its last hook event was 7 days old. That also hits a node that legitimately comes back later: a folder dropped from a rebuilt index keeps its node ids when it is opened again, and a git checkout can restore an older canvas. Losing the entry costs that node its resume id, so a cold start after a reboot launches a bare CLI instead of resuming. The count no longer reads orphans, so the sweep only bounds storage and a long window is cheap. The grace now equals LAST_SEEN_MAX_AGE_MS: an orphan goes on the same boot its clock ages out on load, never earlier. A test pins the two constants together. Also rewraps the CLAUDE.md lines the PR left at ~125 columns and notes the sweep in the lastSeen field comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What changed
The Dock badge (and the Windows taskbar overlay and tray count, which share it) summed every
unreadentry in the persisted agent-status table. That table is only pruned by the delete funnels that callremove, so a node dropped any other way (an outside edit or sync, an in-place reload) left its entry behind for good, still unread.Measured on one machine: the table held 633 entries, 20 unread, and only 1 of those belonged to a node in any project. The Dock said 20 while the only tab badge said 1.
lib/unreadBadge.ts, so the two can't drift.planBadgetreats the first report as the baseline).unavailableplaceholder, which carries no nodes). Deleted entries go through a new batchremoveMany, one write per localStorage key.How it was checked
lib/unreadBadge.test.tscover the count, including the field case of 20 unread with 1 live, plus closed projects and a node held by two projects. They also cover the sweep's grace window and its refusals.agentStatus.persist.test.tscoversremoveMany(both keys written, unknown ids ignored, no-op returns the same state).npm run typecheckis clean apart fromWhiteboardEditor.tsx. Those errors come from@excalidraw/excalidrawnot being installed in this checkout and are unrelated to this change.Risks
Surfaces: Desktop and Server Edition share this renderer code. Mobile is not affected (the phone's badges come from the core mirror, not this table).