Skip to content

feat(bot): add AI streaming with thinking steps#9

Merged
johnnyhuy merged 4 commits into
mainfrom
feat/slack-ai-streaming
May 31, 2026
Merged

feat(bot): add AI streaming with thinking steps#9
johnnyhuy merged 4 commits into
mainfrom
feat/slack-ai-streaming

Conversation

@johnnyhuy
Copy link
Copy Markdown
Contributor

@johnnyhuy johnnyhuy commented May 30, 2026

Summary

Adds Slack AI streaming support using the new chat_stream() helper from slack-sdk v3.40.0.

Changes

  • Upgrade slack-sdk to v3.40.0 (resolved to v3.42.0) for Thinking Steps support
  • Replace say() with client.chat_stream() for real-time streaming
  • Add thinking steps to show agent processing live:
    • Analyzing question
    • Searching knowledge base
    • Generating response
  • Fix import path: slack_sdk.models.messages.chunk (not slack_sdk.models.blocks)

Streaming Flow

PlanBlock: "Processing your request..."
TaskCard: "Analyzing question..." → complete
TaskCard: "Searching knowledge base..." → in_progress → complete
TaskCard: "Generating response..." → in_progress → complete
MarkdownTextChunk: response.answer
→ stream.stop()

Handlers Updated

  • app_mention (channel thread replies)
  • message (direct messages)
  • /wingman slash command

Testing

# Run streaming tests
cd backend && uv run pytest tests/test_streaming.py -v

# All unit tests
uv run pytest tests/test_streaming.py tests/test_file_extraction_units.py -v

20 streaming tests covering:

  • Chunk imports (MarkdownTextChunk, TaskUpdateChunk, PlanUpdateChunk)
  • Chunk creation and serialization
  • Status values
  • Integration flow

Documentation Added/Updated

File Description
docs/local-development.md NEW Step-by-step local setup with streaming + mise reference
README.md Updated with AI streaming highlight
docs/getting-started.md Added streaming preview
docs/setup.md Cleaned up formatting

⚠️ Build Status

CI checks show backend/frontend build failures. Likely due to uv.lock update for slack-sdk v3.42.0 needing proper Docker rebuild. Please retry checks after approving, or run mise run up --build locally to verify.

Quick Test

# Start services
docker compose up -d postgres chroma

# Run bot with streaming
mise run dev-bot

# 3. DM @Wingman or mention in channel

Docs

johnnyhuy added 4 commits May 31, 2026 01:47
- Upgrade slack-sdk to v3.40.0 for ChatStreamer support
- Replace say() with client.chat_stream() for real-time streaming
- Add thinking steps (PlanBlock, TaskCard) to show agent processing:
  - Analyzing question
  - Searching knowledge base
  - Generating response
- Update all event handlers: mentions, DMs, slash command
- Use task_display_mode=plan for structured task display
- Add docs/local-development.md with step-by-step local setup
- Update README.md to highlight AI streaming feature
- Clean up docs/setup.md formatting
- Update getting-started.md with streaming preview
- Document all mise tasks for Docker services
- Document local development commands
- Document database migration commands
- Document testing commands
- Document Terraform IaC commands
- Add tests/test_streaming.py with 20 tests for streaming chunks
- Fix import path: slack_sdk.models.messages.chunk (not models.blocks)
- Update uv.lock to v3.42.0 for slack-sdk
- Tests cover: imports, chunk creation, serialization, helper methods, status values, integration
@socket-security
Copy link
Copy Markdown

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedpypi/​slack-sdk@​3.39.0 ⏵ 3.42.087 +1100100100100

View full report

@johnnyhuy
Copy link
Copy Markdown
Contributor Author

Build failures detected (backend/frontend build checks). The uv.lock was updated to reflect slack-sdk v3.42.0 which may need to be properly resolved in the Docker build.

Task logged to track fix: "Fix wingman streaming PR build failures"

To retry checks after fix:

# Ensure dependencies are properly synced
cd backend && uv sync
git add uv.lock && git commit --amend --no-edit
git push --force-with-lease

@johnnyhuy johnnyhuy merged commit 3298c02 into main May 31, 2026
7 of 9 checks passed
@johnnyhuy johnnyhuy deleted the feat/slack-ai-streaming branch May 31, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant