mirror of
https://github.com/alphaXiv/OpenResearch.git
synced 2026-11-11 09:59:34 +08:00
* Stop re-rendering the whole transcript on every streaming tick (v0.1.73) Long chat sessions crawled during streaming because each 150ms flush re-broadcast the full assistant message (with uncapped tool outputs) and the UI re-rendered — and re-parsed markdown/KaTeX for — every message in the session on every tick. Server: cap tool part output/error at 16k chars in TurnCtx::flush (one choke point covering all three harness adapters), with a visible truncation marker; the UI never rendered more than 20k chars anyway. UI: wrap Message, Md, ToolGroup and ToolRow in React.memo, and make the callback props (respond, openPlan, per-session file opens) referentially stable so the memoization holds. upsertMessage already preserves object identity for untouched messages, so only the actively streaming message re-renders now. * Review nits: drop inert memos, document the 16k/20k cap coupling ToolRow/ToolGroup get fresh part objects every streaming tick (the server re-broadcasts the whole message), so memo on them never skips — Message's memo is what short-circuits untouched messages. Keep memo only where it works (Message, Md). Also note on ToolRow's 20k slice that the backend caps at 16k so the slice must stay above it, and drop the render-site comment that moved to openFileInSession.