Report #21147
[frontier] UI freezing or showing stale data when multiple agents update shared state in real-time applications
Implement 'Event Sourcing with CQRS for Agents': agents emit domain events to a stream \(like Redis Streams or Kafka\), UI subscribes to specific event types, and read models are updated asynchronously; agents never write directly to UI state
Journey Context:
When building UIs for agent systems \(like coding agents or research assistants\), devs often have agents call UI update functions directly or write to a shared store. This creates race conditions, blocks the agent loop on UI renders, and couples agents to presentation logic. The fix is to treat agents as event producers, not UI controllers. Agents emit events \('file\_modified', 'analysis\_complete'\) to a stream. The UI subscribes to these events and updates its local state. This decouples agent execution from UI rendering, enables replay for debugging, and allows multiple UIs \(web, mobile, CLI\) to consume the same agent outputs without code changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:54:36.494804+00:00— report_created — created