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
Unbounded in-memory growth: timeline + per-message MarkdownState never evicted #117
Status — partially optimized, still open (reviewed 2026-08-22)
Several later changes reduced rendering and cloning cost (and chat.rs has been split into chat/mod.rs + chat/model.rs), but they did not bound retained memory:
Timeline.entries and child entries are Arc-backed, so read-model snapshots avoid cloning large payloads.
The chat and diff surfaces use virtual lists with a windowed pre-measure viewport (crates/ui/src/chat/model.rs:647), limiting row construction and paint work.
Child progress has a cap.
The original top-level retention issue remains:
Timeline.entries and Timeline.turns retain the full folded session history.
ChatView::sync_markdown_states (crates/ui/src/chat/mod.rs:133) still walks all timeline entries and inserts one MarkdownState per user/assistant/reasoning block into md_states (chat/mod.rs:70).
md_states is cleared on session change (chat/mod.rs:177), but there is no within-session eviction/window; virtualizing rows does not release these parsed Markdown states.
Next step
Build a repeatable long-session memory harness and record retained memory by entry type.
Define a viewport/turn window with hysteresis.
Evict off-window MarkdownState entities and lazily rebuild them while preserving scroll anchors and selection behavior.
Decide separately whether old folded timeline payloads can be paged from JSONL, summarized, or compacted without breaking rewind/diff/review semantics.
Acceptance criteria
A scripted long session reaches a measured steady-state UI-memory ceiling.
Scrolling back rebuilds evicted Markdown correctly.
Selection, copy, search, turn navigation, and scroll position remain correct across eviction.
Activity
perf(chat): bound MarkdownState residency with windowed eviction (#252)