fix(server): the latest task list survives a thread's activity window - #250
Merged
Conversation
Clients only receive the newest 500 activities per thread. The task list in the activity popover is itself an activity (`turn.plan.updated`), so a plan written early in a long, chatty turn could fall out of the window and the popover would show no tasks after a reload, while the live feed still had them. Move the retention rule into one shared helper, `retainThreadActivities`, that keeps the recent window plus open prompts and the newest plan update, and use it from the projector, both snapshot queries, and the web store so a reload and the live feed agree. The SQL side ranks only the plan rows in a side scan; on a 233k-row activity table that adds about 0.2 s to the full snapshot query instead of the 2.7 s a second whole-table window cost.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
badcuban
enabled auto-merge
September 6, 2026 08:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clients only receive the newest 500 activities per thread. The task list in the activity popover is itself an activity (
turn.plan.updated), so a plan written early in a long, chatty turn could fall out of the window and the popover would show no tasks after a reload, while the live feed still had them. Open approvals and questions were already exempt from the window; the newest plan update now is too.The retention rule moves into one shared helper,
retainThreadActivitiesinpackages/shared, that keeps the recent window plus open prompts and the newest plan update. The projector, both snapshot SQL queries, and the web store use it, so a reload and the live feed agree. The all-threads SQL ranks only the plan rows in a side scan: timed read-only against a 233k-row live activity table, that adds about 0.2 s to the full snapshot query, where a second whole-table window cost 2.7 s.Known gap, unchanged by this PR: storage maintenance still prunes activity events beyond the cap, so a full projection rebuild can drop these pinned rows. That was already true for open prompts. The comments on the pruner now say so.
Verified with the full typecheck, lint, the shared retention tests, the server snapshot query, projector, and storage maintenance tests, and the web store tests.