- Request at most 25 messages from chat.history (was 200) to reduce payload
size and JSON parse cost in the browser.
- Cap rendered chat history at 25 messages to avoid main-thread freeze
from rendering many markdown messages (fixes 'tab unresponsive').
- Defer applying messages with requestAnimationFrame so the UI can paint
'Loading chat...' before the heavy render.
- Cap sessions.list to 40 when loading the chat tab to avoid large
session dropdown response.
Helps address #10622 (Webchat UI freezes when loading sessions with
many messages). Gateway already caps payload size (#18505); this adds
client-side limits so the Control UI stays responsive with long
sessions.
Made-with: Cursor