mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
The deferred-paint approach caused a perf regression: the user now waited max(prefetch, RPC) instead of just prefetch_time to see content. The RPC can take 1-2s (agent pre-warm, MCP discovery) vs ~50ms for the local DB prefetch. The deferred paint was unnecessary — the original eager prefetch paint already worked correctly with the existing fast-path guard (preferredMessages = localSnapshot when prefetchApplied && !hasLiveProjection && resumed.messages.length <= prefetchedMessageCount). The second re-render was entirely from setBusy(true) during the load followed by setBusy(false) in the finally, which toggled the thread viewport's internal loading indicator (2 DOM mutations). The only change from main is removing setBusy(true) from the cold-path entry. This is a history load, not a live turn — the busy flag is for active LLM turns only. The loading spinner is driven by messagesEmpty && !activeSessionId, not by $busy. The e2e test now asserts <= 2 bursts (prefetch paint + thread rebind) instead of exactly 1, since setActiveSessionId(null) → resumed.id is expected behavior (the user wants the session cleared on switch). |
||
|---|---|---|
| .. | ||
| bootstrap-installer | ||
| desktop | ||
| shared | ||