#12

feat: add real-time streaming for Slack bot responses

Openpranaygpwants to merge intofrom

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

https://claude.ai/code/session_012VQVKgVqtnuUrdtPLqjnzU

Activity

7
vercel[bot]9mo ago

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
storytime-slackbot ReadyPreview, CommentFeb 6, 2026 10:01pm
vercel[bot]reviewed9mo ago
socket-security[bot]9mo ago

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
@​slack/​web-api@​7.10.0 ⏵ 7.13.0 -1

View full report

copilot-pull-request-reviewer[bot]reviewed9mo ago
copilot-pull-request-reviewer[bot]9mo 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 generateStoryPiece using streamText plus Slack streaming/update APIs.
  • Updated the main storytime workflow to use streaming/progress flows behind new --streaming/--no-streaming flags (default on).
  • Upgraded @slack/web-api to 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
FileDescription
workflows/steps/generate-story-piece.tsIntroduces streaming + progress generation functions and partial JSON parsing to drive incremental Slack updates.
workflows/create.tsSwitches workflow control flow to streaming by default and integrates the new generation variants.
lib/args.tsAdds CLI flags to enable/disable streaming (default enabled).
lib/slack-streaming.tsAdds a general-purpose Slack stream writer helper abstraction for append/stop streaming.
package.jsonBumps @slack/web-api semver range for streaming support.
pnpm-lock.yamlLocks 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