← Back to PRs

#9671: feat(slack): add AI Assistant loading states support

by natedenh open 2026-02-05 15:13 View on GitHub →
channel: slack stale
## Summary Add support for Slack's AI Assistant features (loading states) when the 'Agents & AI Apps' feature is enabled in the Slack app settings. This displays a loading indicator like "is thinking..." in the Slack UI while the bot processes messages, providing better UX than just an ack reaction. ## Changes - Add new `src/slack/assistant.ts` with helpers for: - `setAssistantStatus` - set loading message (e.g., 'is thinking...') - `clearAssistantStatus` - clear loading status - `setAssistantSuggestedPrompts` - set suggested prompts (future use) - `setAssistantThreadTitle` - set thread titles (future use) - Add `channels.slack.assistant` config: - `enabled` - toggle AI Assistant features (default: false) - `statusMessage` - custom loading message (default: 'is thinking...') - Integrate with existing ack reaction flow: - Set assistant status when ack reaction is added - Clear assistant status after reply is delivered ## Usage 1. Enable 'Agents & AI Apps' in your Slack app settings 2. Add `assistant:write` scope (auto-added when feature is enabled) 3. Configure OpenClaw: ```yaml channels: slack: assistant: enabled: true statusMessage: 'is thinking...' ``` ## Notes - Requires Slack app to have 'Agents & AI Apps' feature enabled - Works alongside existing ack reactions (both can be enabled) - Gracefully fails if API calls don't work (logged but not thrown) - No new dependencies required (`@slack/web-api` already supports the API) ## Testing - [x] Build passes - [x] Manual testing with Slack workspace <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> Adds a Slack “AI Assistant” integration layer (`src/slack/assistant.ts`) and wires it into the Slack message handler flow: when ack reactions are used, the bot sets an assistant loading status (configurable via `channels.slack.assistant.*`) and later attempts to clear it after replies are delivered. Config schema labels/help text and Slack config types are updated accordingly, and the new helper exports are re-exported from `src/slack/index.ts`. <h3>Confidence Score: 3/5</h3> - This PR is mergeable after fixing assistant status lifecycle edge cases. - Core wiring is small and guarded by config, but there are two correctness issues that can leave Slack’s loading state stuck: clearing is gated on ack-reaction success even though status can be set without it, and clearing via empty string may not be accepted by Slack’s API. - src/slack/monitor/message-handler/prepare.ts, src/slack/monitor/message-handler/dispatch.ts, src/slack/assistant.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs