feat(slack): add Slack integration with @mention-based task submission#42
feat(slack): add Slack integration with @mention-based task submission#42isadeks wants to merge 1 commit intoaws-samples:mainfrom
Conversation
aef74c1 to
833c770
Compare
Adds full Slack integration enabling users to submit coding tasks by mentioning @shoof in any channel or DM, with real-time emoji reactions and threaded notifications showing task progress. Key features: - @mention task submission with natural language repo extraction - Emoji reaction progression: 👀 → ⌛ → ✅ - Threaded notifications (created, started, completed/failed) - Cancel button with instant feedback - DM support for private task submissions - OAuth multi-workspace install flow - `bgagent slack setup` CLI wizard for zero-friction onboarding - Account linking via /bgagent link New files: - CDK constructs: SlackIntegration, SlackInstallationTable, SlackUserMappingTable - Lambda handlers: events, commands, command-processor, interactions, oauth-callback, link, notify - Shared utilities: slack-verify, slack-blocks - CLI: slack.ts (setup, link commands) - Docs: SLACK_SETUP_GUIDE.md with screenshots
|
Thank you @isadeks ! Great addition From a first pass review: What's Done Well
The inbound path (task creation) is well-architected. The existing createTaskCore() function is a genuinely clean seam — it accepts a TaskCreationContext with a channelSource tag and My architectural problem: This PR hardwires Slack as the only notification consumer, bypassing the opportunity to build a proper event fan-out layer. Today on main, the TaskEventsTable is a pull-only audit log — no streams, no push notifications. When this PR adds stream: dynamodb.StreamViewType.NEW_IMAGE to the events table, it's
The current slack-notify.ts (333 lines) mixes three concerns that should be separated: Event routing, Message rendering, and Delivery + state management. If you separate the routing concern, each future adapter only needs to implement rendering + delivery. The slack-notify.ts handler currently does all three, which means the next adapter would duplicate the routing and deduplication logic. ALso, the opaque bag pattern (channel_metadata: Record<string, string>) works because each adapter writes and reads its own keys. But it means the task record accumulates state for the active channel's notification lifecycle (message timestamps, thread context). This couples the task record to the notification system. A cleaner approach would store notification state in a separate table or in the channel adapter's own state, not in the task's channel_metadata. I don't want to block the PR for the notification architecture alone since this is the first channel we are adding, so premature abstractions is a real risk. What I would like to see in the current PR:
Some captured issues in the current code, please revise once the recommendations above are implemented to see if they are still relevant:
Thank you ! Also, @scoropeza since you are working on the related task, could you please have a look to see if this is aligned with your work ? Thank you ! |
Summary
@Shoofmentions or DMs, receive threaded notifications with emoji reaction progressbgagent slack setupCLI wizard for zero-friction onboarding/bgagent linkslash commandWhat's included
CDK Constructs: SlackIntegration, SlackInstallationTable, SlackUserMappingTable
Lambda Handlers: slack-events, slack-commands, slack-command-processor, slack-interactions, slack-oauth-callback, slack-link, slack-notify
Shared Utilities: slack-verify (HMAC signature verification), slack-blocks (Block Kit renderer)
CLI:
bgagent slack setup(interactive wizard),bgagent slack link <code>(account linking)Docs: SLACK_SETUP_GUIDE.md with screenshots, Developer Guide updated
UX Flow
@Shoof fix the bug in org/repo#42Other changes (non-Slack)
cdk deploy -c blueprintRepo=org/repoorBLUEPRINT_REPO=org/repo— no longer requires editingagent.tsdirectly. Developer Guide updated with the new method.UpdateTraceSegmentDestinationsetup that blocks first-time deploys. Disabled to unblock new users; re-enable once the prerequisite is documented more clearly.Test plan
bgagent slack setup— full flow from scratch (deploy, create app, credentials, install, link)@Shoofmention in channel — happy path with reactions and threaded notifications/bgagent helpand/bgagent link-c blueprintRepo=org/repodeploys with custom repo onboarded