Skip to content

Lazy-load chat histories and serve lightweight list summaries (avoid full global index scan on every page load) #84

@bradjin8

Description

@bradjin8

Summary

UI testing is blocked by slow chat loading: the home page rescans Cursor's full global KV index across all projects on every load (often 1–2+ min), and opening a workspace assembles every conversation with full bubble bodies before the sidebar renders. There is no summary cache.

Problem

  • GET /api/workspaces runs list_workspace_projects(), which loads all composerData, all bubbleId rows, and all messageRequestContext rows from global storage on every request—even though the UI only needs project cards (id, name, conversationCount, lastModified).
  • GET /api/workspaces/<id>/tabs runs assemble_workspace_tabs(), which loads all global bubbles then builds full tab payloads for every conversation in the project before first paint.
  • No application-level cache for derived summaries.

Proposed solution

  1. Summary-only list endpoints (no full global bubbleId scan on list paths).
  2. Lazy-load full conversation content when a tab is selected (split API + workspace UI).
  3. Optional mtime-keyed cache for summaries.

Acceptance criteria

  • Home and workspace sidebar usable in < 3 s on a large local fixture.
  • List routes do not full-scan global bubbles (test or documented audit).
  • Export/full assembly paths remain correct.
  • Tests + optional warnings for partial/stale summary builds.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions