Skip to content

perf(api): read notifications without full workspace snapshot - #106

Open
kvnloo wants to merge 2 commits into
CopilotKit:mainfrom
kvnloo:perf/notifications-direct-list
Open

kvnloo wants to merge 2 commits into
CopilotKit:mainfrom
kvnloo:perf/notifications-direct-list

Conversation

@kvnloo

@kvnloo kvnloo commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Problem

GET /notifications currently calls service.snapshot(), which loads tasks, goals, monitors, ideas, memories, artifacts, notifications, identity, and worker state only to return the notifications array.

With retained terminal tasks, that makes notification polling scale with the entire workspace.

A downstream PGlite benchmark with 2,000 task rows measured roughly:

  • full snapshot path: ~2264ms / 39.3MB
  • direct notifications list: ~2.0ms / 4.7KB

Change

Read notifications directly from the Store. Payload shape and ordering stay the same as the existing db.list used by the snapshot.

Regression

The API test stubs AgentService.snapshot() to throw and proves GET /notifications still succeeds. This fails on the old route and passes with the scoped read.

No notification mutation, ownership, or UI behavior changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant