[GH-ISSUE #5423] [GUI] the first chat load reads every chat whole (N+1 requests, the full archive in page memory) #3242

Closed
opened 2026-11-07 14:39:07 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @TheHubUser4860938 on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5423

Problem: at every app start, hydrateChats fetches every chat file in full - one request per chat, no length cap - to show a list that needs only the index entries. For a heavy user (hundreds of chats, multi-MB each after #5192's long-chat fix) that is hundreds of requests and the whole archive resident in the page before the first paint of the list.

Environment: Strata 0.2.11 (app and Terminal 0.2.11, Control and engine 0.1.57) · Linux x86_64 · NVIDIA RTX 4090 24 GB, 125 GB RAM · Qwen3.8-Flash-Next family

Reproduce: start the 0.2.11 app with ~200 chats in <data>/chats: the network log shows /api/chats (the index) followed by 200 /api/chats/<id> reads before the sidebar settles.
Expected: the list paints from /api/chats (which already carries title, updatedAt, bytes, rev); the chat text is read when a chat is opened.
Actual: chat-sync.ts readAll GETs every entry with parallelism 4 and merges the sessions in memory.
Reproduction status: unconfirmed static analysis (the path is list() -> readAll in hydrateChats; the request count follows directly, and we measured the code path, not a 200-chat archive).

The merge of "what the host has" against "what this window holds" needs revs, not whole chats; the rev is already in the index entry.

Originally created by @TheHubUser4860938 on GitHub (Nov 6, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5423 Problem: at every app start, `hydrateChats` fetches every chat file in full - one request per chat, no length cap - to show a list that needs only the index entries. For a heavy user (hundreds of chats, multi-MB each after #5192's long-chat fix) that is hundreds of requests and the whole archive resident in the page before the first paint of the list. Environment: Strata 0.2.11 (app and Terminal 0.2.11, Control and engine 0.1.57) · Linux x86_64 · NVIDIA RTX 4090 24 GB, 125 GB RAM · Qwen3.8-Flash-Next family Reproduce: start the 0.2.11 app with ~200 chats in `<data>/chats`: the network log shows `/api/chats` (the index) followed by 200 `/api/chats/<id>` reads before the sidebar settles. Expected: the list paints from `/api/chats` (which already carries title, updatedAt, bytes, rev); the chat text is read when a chat is opened. Actual: `chat-sync.ts` `readAll` GETs every entry with parallelism 4 and merges the sessions in memory. Reproduction status: unconfirmed static analysis (the path is `list()` -> `readAll` in `hydrateChats`; the request count follows directly, and we measured the code path, not a 200-chat archive). The merge of "what the host has" against "what this window holds" needs revs, not whole chats; the rev is already in the index entry.
Author
Owner

@TheHubUser4860938 commented on GitHub (Nov 6, 2026):

Closing: unconfirmed static analysis. The path (list() → readAll in hydrateChats) is read from the 0.2.11 code, but no multi-chat start was measured on a real install. Will reopen with a measured request count when one is.

<!-- gh-comment-id:6691039812 --> @TheHubUser4860938 commented on GitHub (Nov 6, 2026): Closing: unconfirmed static analysis. The path (`list()` → `readAll` in `hydrateChats`) is read from the 0.2.11 code, but no multi-chat start was measured on a real install. Will reopen with a measured request count when one is.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3242
No description provided.