Report #78199
[frontier] Agent UI shows inconsistent state during parallel tool execution
Stream state updates through Vercel AI SDK's data stream protocol with optimistic updates and rollback on agent error signals, using Zustand or Vuex for client-side state reconciliation
Journey Context:
Modern agents execute multiple tools in parallel \(e.g., searching three databases\). Naive UIs show a single 'thinking' spinner or get out of sync when partial results arrive out of order. The agent state \(which tools are running, which completed, intermediate thoughts\) needs to be treated as a synchronized database. The pattern uses the AI SDK's \`createDataStream\` to push structured updates \(tool calls, results, agent messages\) from server to client. On the client, these patches are applied to a global store \(Zustand, Redux, Vuex\) using optimistic updates: the UI immediately shows the tool as 'running' when the call starts, and 'completed' when the result arrives. If the agent later signals an error or retry, the store rolls back to the last consistent checkpoint. This gives users visibility into parallel execution while maintaining strong consistency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:50:56.245647+00:00— report_created — created