home / skills / andrelandgraf / fullstackrecipes / resumable-ai-streams
This skill enables automatic recovery for AI chat response streams using WorkflowChatTransport, start/resume endpoints, and useResumableChat hook to maintain
npx playbooks add skill andrelandgraf/fullstackrecipes --skill resumable-ai-streamsReview the files below or copy the command above to add this skill to your agents.
---
name: resumable-ai-streams
description: Add automatic stream recovery to AI chat with WorkflowChatTransport, start/resume API endpoints, and the useResumableChat hook.
---
# Resumable AI Response Streams
To set up Resumable AI Response Streams, refer to the fullstackrecipes MCP server resource:
**Resource URI:** `recipe://fullstackrecipes.com/resumable-ai-streams`
If the MCP server is not configured, fetch the recipe directly:
```bash
curl -H "Accept: text/plain" https://fullstackrecipes.com/api/recipes/resumable-ai-streams
```
This skill adds automatic stream recovery to AI chat flows using WorkflowChatTransport, start/resume API endpoints, and a useResumableChat hook. It provides a production-ready pattern and step-by-step guide for building resilient, resumable AI response streams in TypeScript full-stack apps. The goal is to make streamed responses recoverable after network interruptions with minimal client changes.
The system wraps the chat transport with WorkflowChatTransport to track stream state and checkpoints. Server endpoints expose start and resume operations so the client can request continued streaming from the last known checkpoint. On the client, useResumableChat manages local state, reconnection logic, and replaying or resuming partial responses automatically. Together these pieces let the app continue an interrupted response stream without re-running the entire generation.
Does resuming require re-running the whole generation?
No. Checkpointing and server-side resume logic continue from the last committed state to avoid re-running previously generated tokens.
Is the hook framework-specific?
The provided useResumableChat hook is TypeScript-focused and integrates easily with common React stacks, but the recovery pattern can be adapted to other front-end frameworks.