#12
feat: add real-time streaming for Slack bot responses
Implements Slack's new streaming APIs (chat.startStream, chat.appendStream, chat.stopStream) to progressively show story generation in real-time.
Key changes:
- Upgrade @slack/web-api to ^7.11.0 for streaming support
- Add new streaming helper module (lib/slack-streaming.ts)
- Add streaming variants of generateStoryPiece:
- generateStoryPieceWithStreaming: Uses Slack streaming APIs for real-time token-by-token display in thread responses
- generateStoryPieceWithProgress: Uses chat.update for throttled progress updates on existing messages
- Add --streaming/--no-streaming flags (streaming enabled by default)
- Update main workflow to use streaming for both intro generation and thread responses, with fallback to non-streaming mode
The streaming implementation:
- Uses AI SDK's streamText for real-time generation
- Parses streaming JSON to extract story content incrementally
- Buffers updates to reduce API calls while maintaining responsiveness
- Gracefully handles errors by stopping streams
Activity
7vercel[bot]reviewed9mo ago
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
| Diff | Package | Supply Chain Security | Vulnerability | Quality | Maintenance | License |
|---|---|---|---|---|---|---|
| @slack/web-api@7.10.0 ⏵ 7.13.0 | -1 |
copilot-pull-request-reviewer[bot]reviewed9mo ago
Pull request overview
Adds opt-in-by-default real-time Slack response streaming for the storytime workflow, aiming to show LLM generation progress in-channel/threads using Slack’s new streaming endpoints while keeping a non-streaming fallback.
Changes:
- Added streaming and progress-update variants of
generateStoryPieceusingstreamTextplus Slack streaming/update APIs. - Updated the main
storytimeworkflow to use streaming/progress flows behind new--streaming/--no-streamingflags (default on). - Upgraded
@slack/web-apito a version that includes the streaming endpoints.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| workflows/steps/generate-story-piece.ts | Introduces streaming + progress generation functions and partial JSON parsing to drive incremental Slack updates. |
| workflows/create.ts | Switches workflow control flow to streaming by default and integrates the new generation variants. |
| lib/args.ts | Adds CLI flags to enable/disable streaming (default enabled). |
| lib/slack-streaming.ts | Adds a general-purpose Slack stream writer helper abstraction for append/stop streaming. |
| package.json | Bumps @slack/web-api semver range for streaming support. |
| pnpm-lock.yaml | Locks updated Slack Web API and Slack types transitive versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vercel[bot]reviewed9mo ago
The latest updates on your projects. Learn more about Vercel for GitHub.