You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(platform): read a chat thread's tail and apply the settled row #5154
Split from #4708 (item 2 of 7), as triaged on TALE-117.
What the read does now
At feature-train9173785 (paths under services/platform/):
GET /api/app/chat/threads/:threadId/messages (backend/domains/chat/routes.ts:1032-1068) returns the whole thread through listMessageViews (backend/domains/chat/message-views.ts:47-62). That is every message with its parts, ORDER BY "order", step_order, with no LIMIT.
The server's stream settle already sends only the settled row (backend/domains/chat/generation-watch.ts:331-354, readMessageViewsByIds / readLastMessageView). The client ignores that payload:
on settled it invalidates the whole message list and the thread list (app/features/chat/data/thread-stream.ts:173-179);
it does the same when a turn opens (:167) and on idle after streaming (:119-120).
So every turn re-reads the whole thread.
A tail reader exists: listThreadMessagesTail (backend/domains/threads/store.ts:193-235), with a default limit of 200, a before cursor and hasMore. Only task comments use it. As it stands it does not fit chat:
it filters by thread_id alone, with no org_id;
it leaves out tool roles by default;
its columns lack model, provider_slug, usage, blocked_reason and error.
What to do
Read a chat thread's tail (limit 200, with a cursor for older messages) instead of the whole thread. Reuse the tail reader's keyset rather than writing a second copy.
On settled, apply the row the stream already sends to the cached messages instead of re-reading the thread.
Done means:
opening a thread and settling a turn each read at most one page;
Landed on release/0.6 with feature train #5221 (merged by rebase on 2026-10-31 at 20:26:51 UTC) as commit 9b9e68f (perf(platform): read a chat thread's tail and apply the settled row). It ships with Tale 0.6.0. GitHub closes issues only for commits on main, so the feature-train role closes this one. Task: TALE-250.
Activity
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
tale-code-bot commentedon Oct 31, 2026
Landed on
release/0.6with feature train #5221 (merged by rebase on 2026-10-31 at 20:26:51 UTC) as commit 9b9e68f (perf(platform): read a chat thread's tail and apply the settled row). It ships with Tale 0.6.0. GitHub closes issues only for commits onmain, so the feature-train role closes this one. Task: TALE-250.perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row
perf(platform): read a chat thread's tail and apply the settled row