Addresses the audit's findings with minimal, desktop-first changes (no
payload deferral, no streaming-path work since streaming is off by default):
- Sidebar: replace the 10-thread bulk detail prewarm with a single
hover-based prewarm; at idle one shell stream + at most one detail stream
- Server replay: thread catch-up reads only the thread's aggregate stream
via the (aggregate_kind, stream_id, sequence) index instead of scanning
the global log; shell catch-up is bounded (500 events) with a shell
snapshot fallback for stale cursors
- Shell summaries: thread.message-sent updates latestUserMessageAt
incrementally; activity-appended triggers the history-wide summary
rebuild only for approval/user-input activity kinds; streaming assistant
chunks no longer fan out per-chunk shell upserts
- Client runtime: O(1) activity appends when order is preserved; skip
IndexedDB full-snapshot encodes while a turn is running (settle event and
scope finalizer persist the final state)
- Timeline derivation: share one ordered activities view across the four
derivations (identity-cached, O(n) sorted check); k-way merge for the
combined timeline instead of concat+sort
- Composer drafts: debounce JSON serialization itself, and cache per-draft
partialization by object identity so typing doesn't re-clone every
retained draft
- Shiki: negative-cache languages without grammars (sh, yaml) so those
fences stop retrying and throwing on every render
- Bootstrap polling: one shared change-detecting poller instead of one
2s interval per consumer; minimap only writes data-in-view on change
Co-Authored-By: Claude Fable 5 <[email protected]>