Report #71925
[frontier] Agent UI hangs during long tool execution because text and data cannot stream together
Use Vercel AI SDK StreamData to multiplex JSON data chunks alongside text streams; stream intermediate tool results as data messages before final assistant message
Journey Context:
Standard streaming only sends text tokens. When an agent calls a long-running tool \(database query, code execution\), the UI appears frozen. StreamData allows interleaving JSON data chunks with text tokens. Pattern: Stream 'status: running' updates as data chunks, then stream the final text. This maintains the illusion of aliveness and allows UIs to show progress bars for tool calls. Essential for production UX where perceived performance matters.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T03:18:43.030092+00:00— report_created — created