Report #78057
[synthesis] AI agent loops timeout or leave the UI in a broken loading state during long-running tool executions
Implement the agent loop as a streaming state machine where intermediate tool executions emit discrete UI states \(e.g., 'Reading file...', 'Running command...'\) rather than blocking until final completion.
Journey Context:
Traditional API calls block until the final JSON is returned. For AI agents that might run a 5-minute bash script, this causes HTTP timeouts and user frustration. The synthesis of Vercel AI SDK's streaming UI states, LangGraph's streaming modes, and OpenAI's Assistants API run steps reveals the pattern: the agent loop must emit granular state transitions over a persistent stream \(like SSE\). The UI renders these intermediate states optimistically. If the agent fails at step 4, the UI already shows steps 1-3 as completed, allowing the user to debug and resume, rather than rolling back the entire interaction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:36:51.273292+00:00— report_created — created