summaryrefslogtreecommitdiffhomepage
path: root/AGENTS.md
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-12 18:26:00 +0900
committerAdam Malczewski <[email protected]>2026-06-12 18:26:00 +0900
commit4d2e6d817f65a13631f00786c45b403d7d7d58ec (patch)
treeceb08176b7e121fcbd53938096322cb2b7958d48 /AGENTS.md
parent46d6b48d5229bd8cd8eb61efd0a0275349de7caf (diff)
downloaddispatch-web-4d2e6d817f65a13631f00786c45b403d7d7d58ec.tar.gz
dispatch-web-4d2e6d817f65a13631f00786c45b403d7d7d58ec.zip
feat(chat): chat limit — bulk quarter-unload, 75% fresh-load window, show-earlier page-in
Long transcripts no longer grow unbounded: past the chat limit (default 256 chunks, localStorage dispatch.chatLimit) the oldest ceil(limit/4) committed chunks are unloaded in ONE bulk pass — never one-per-delta (old Dispatch's scroll-jump-per-step bug) — and only while the reader is stuck to the bottom (scrolled-up readers defer the trim; it catches up in whole quarters). A fresh page load windows to the newest floor(0.75*limit). Unloading is purely local (IndexedDB cache + server keep everything); a hiddenBeforeSeq watermark keeps history merges from resurrecting unloaded chunks, and a 'Show earlier messages' affordance pages a quarter back in from the cache with scroll-anchor preservation. Thinking-collapse render keys stay stable across trims via a hiddenThinkingCount ordinal base. - core/chunks/trim.ts: pure policy (trim/window/restore/normalize) + tests - chat store: chatLimit + canUnload deps, windowed load, showEarlier() - composition root: dispatch.chatLimit localStorage knob + unload gate wired to smart-scroll isAtBottom() - backend CR-5 OPENED (not a blocker): ?limit=/?beforeSeq= on GET /conversations/:id (courier backend-handoff-chat-limit.md) - scripts/live-probe.ts: fix pre-existing stale TurnMetricsEntry reads (m1.usage -> total.usage) that crashed the probe; 17/17 live checks pass
Diffstat (limited to 'AGENTS.md')
-rw-r--r--AGENTS.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/AGENTS.md b/AGENTS.md
index 3f7d428..a4c2f36 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -136,8 +136,10 @@ browser effects, run a LIVE probe:
## Status
Slices 1–3 DONE + committed (surface system + WS; conversation transcript cache + delta
streaming; tabs + model selector + DaisyUI/dracula), plus per-conversation cwd + LSP view,
-context size, cache-warming (+ retention/timer), markdown, smart auto-scroll, and
-multi-client live view (subscribe/reconnect + the user prompt on the event stream). Plan in
+context size, cache-warming (+ retention/timer), markdown, smart auto-scroll, multi-client
+live view (subscribe/reconnect + the user prompt on the event stream), and the chat limit
+(bulk quarter-unload past `dispatch.chatLimit`, 75% fresh-load window, show-earlier page-in;
+`core/chunks/trim.ts`; backend CR-5 open for `?limit=`/`?beforeSeq=`). Plan in
`../arch-rewrite/notes/frontend-design.md` §10.
## Reports