The Zustand selector `s.agentMessages[agentId] ?? []` creates a new
empty array on every store update when the key is absent (undefined),
causing React error #185 (infinite re-render).
Fix: selector returns undefined (stable reference), ?? [] applied only
in useState initializer which runs once at mount.
Also restores the comment explaining why ?? [] must not appear in the
selector itself.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>