Repository navigation
Closed
Labels
complexity-mediumComplexity: medium (board points 5-8)priority-p1Critical pathtype-featureNew functionality
Description
Summary
Rebuild the existing Slack integration on top of the Channel Adapter Abstraction to make it production-grade for business users. Improve context injection, session management, message formatting, and error handling.
Context
The current Slack adapter (src/backend/routers/slack.py) is functional but built as a first pass. It injects the last 10 message pairs as context, uses plain text responses, and has minimal error UX. For Slack to be the primary business communication channel, it needs to be robust and polished.
Depends On
- Channel Adapter Abstraction issue
Requirements
Context Injection Improvements
- Replace fixed "last 10 pairs" with smarter context windowing:
- Token-aware context window (fit as much history as the model allows)
- Prioritize recent messages but include referenced older messages
- Inject client profile summary (see Client Profile Memory issue) when available
- Include session metadata in context: session start date, message count, last active
Session Management
- Thread-based sessions: each Slack thread = one chat session
- DM-based sessions: continuous conversation in agent DM channel
- Session resume: if a user returns after hours/days, agent acknowledges gap and has context
- Session close: explicit close command or auto-close after configurable inactivity
- Session list: API to see all active Slack sessions per agent
Rich Message Formatting
- Use Slack Block Kit for structured responses (headers, bullet lists, code blocks, dividers)
- Attach images/files when agent output includes them
- Use Slack message threading correctly (reply in thread, not in channel)
- Typing indicator while agent is processing
Error Handling & Reliability
- Graceful handling of agent timeout (message user: "still working on this...")
- Retry logic for Slack API failures (rate limits, network errors)
- User-facing error messages (not stack traces or generic "error occurred")
- Handle Slack's 3-second webhook timeout (acknowledge immediately, respond async)
Monitoring
- Log all Slack interactions via existing Vector pipeline
- Track response latency per agent
- Surface Slack session metrics in the dashboard
Acceptance Criteria
- Slack adapter refactored to implement
ChannelAdapterinterface - Context injection is token-aware, not fixed message count
- Thread-based and DM-based session models working
- Responses use Slack Block Kit formatting
- Typing indicator shown during agent processing
- 3-second webhook timeout handled (immediate ack + async response)
- Error states produce user-friendly messages in Slack
- No regressions in existing Slack functionality (OAuth, DM routing, email verification)
Non-Goals
- No Slack app distribution/marketplace listing
- No Slack slash commands (future enhancement)
- No multi-workspace support beyond current OAuth flow
Metadata
Metadata
Assignees
Labels
complexity-mediumComplexity: medium (board points 5-8)priority-p1Critical pathtype-featureNew functionality
Activity
oleksandr-korin commentedon Mar 16, 2026
feat: Slack connection management UI + per-agent channel binding (#64)