Skip to content

perf(platform): page the chat thread list and read generations per page #5153

Closed

Description

@tale-code-bot

Split from #4708 (item 1 of 7), as triaged on TALE-117.

What the read does now

At feature-train 9173785 (paths under services/platform/):

  • listThreads (backend/domains/chat/threads.ts:304-326) is "deliberately unpaginated": ORDER BY t.updated_at_ms DESC with no LIMIT.
  • Every call also runs generatingThreadIds (backend/domains/chat/threads.ts:287-296), SELECT thread_id FROM app.generations WHERE org_id = …: the thread ids of every generation of the whole organization, served only by generations_org (org_id) (backend/db/migrations/0016_chat.sql:27).
  • It is served by GET /api/app/chat/threads (backend/domains/chat/routes.ts:396-401) and read by useChatThreads (app/features/chat/data/chat-backend.ts:306) on Home (app/features/home/hooks/use-home-data.ts:174) and in the chat surface (app/features/chat/components/chat-surface.tsx:277). It is read again on every stream settled and idle (app/features/chat/data/thread-stream.ts:120,178).

What to do

  • Keyset pages for listThreads and its client, instead of the full set (the panel's date buckets then fill page by page).
  • Mark a thread as generating by joining the page's own threads to app.generations, instead of reading the organization-wide set of generating thread ids.

Done means: one call reads one page of the caller's threads and only their generations, and tests prove the page and the generating flag.

Activity

  1. added
    agent-ready
    on Oct 30, 2026
  2. added a commit that references this issue on Oct 31, 2026
    74b89ad
  3. added
    perf
    on Oct 31, 2026
  4. added a commit that references this issue on Oct 31, 2026
    3ffe5e4
  5. 8 remaining items

  6. added 13 commits that reference this issue on Nov 2, 2026
    e8715ec
    3f150d6
    d6c7c86
    6d7917a
    1208496
    63a7d72
    c514c3c
    ed56bff
    dbb2b17
    13761f4
    d760bd6
    58a8050
    49e01ed
  7. added a commit that references this issue on Nov 15, 2026
    5a12351
  8. added a commit that references this issue on Nov 23, 2026
    3784295
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyperf

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions