← Back to PRs

#23268: feat(slack): Add App Home tab support

by slurpyone open 2026-02-22 04:55 View on GitHub →
docs channel: slack agents size: XL
## Summary Rebased and enhanced version of #11716 (which was from TinyTb's fork where we no longer have push access). Adds support for the Slack App Home tab by listening for `app_home_opened` events and publishing a view via `views.publish`. ### What's included - **Default Home tab view** — Shows agent name, interaction instructions (DM, mentions, slash commands), and an OpenClaw footer - **Event handler** — Registers `app_home_opened` listener, publishes view per-user - **Phase 2: Agent-driven updates** — `updateHomeTab` and `resetHomeTab` tool actions for dynamic Home tab content (Block Kit blocks) - **Account-scoped state** — Per-user state management, in-flight dedup, version caching - **Configurable** — `channels.slack.homeTab.enabled` (default: `true`), `showCommands`, `customBlocks` - **Comprehensive docs** — Scope reference, config examples, troubleshooting in `docs/channels/slack.md` - **41 tests** passing (26 view builder + 8 event handler + 7 state management) - **No new OAuth scopes needed** — `views.publish` works with existing bot token ### Conflict resolution Rebased on latest main (`6d11b46`). Resolved conflicts in: - `src/config/types.slack.ts` — merged `ackReaction` (upstream) with `homeTab` config - `src/slack/monitor/events.ts` — added `registerSlackAppHomeEvents` alongside new `registerSlackInteractionEvents` - `docs/channels/slack.md` — merged upstream accordion changes with our scope docs - `src/agents/tools/slack-actions.e2e.test.ts` — merged upstream typed mock signatures with our Home tab test cases ### Setup for existing apps Subscribe to the `app_home_opened` bot event in app settings (Event Subscriptions → Subscribe to bot events). New apps via the onboarding wizard get it automatically. Supersedes #11716. Closes #11655 <!-- greptile_comment --> <h3>Greptile Summary</h3> Added comprehensive Slack App Home tab support with automatic view publishing, agent-driven updates, and account-scoped state management. The implementation publishes a default view showing agent status, version, uptime, and interaction instructions when users open the Home tab. Agent tools `updateHomeTab` and `resetHomeTab` enable dynamic customization with Block Kit blocks. Per-user version caching prevents redundant publishes, in-flight deduplication handles concurrent events, and account-scoped state keys prevent cross-contamination in multi-account setups. **Key changes:** - Default Home tab view with agent name, status fields, uptime display with timezone support, getting started instructions, and OpenClaw footer - Event handler for `app_home_opened` with conditional publishing (skips non-home tabs, custom views, cached versions, in-flight requests) - Per-user state management (`publishedVersionByUser`, `customViewUsers`, `publishingInFlight`) scoped by `accountId:userId` - Agent tool actions `updateHomeTab` (publish custom Block Kit view) and `resetHomeTab` (clear custom view) - Configuration support via `channels.slack.homeTab` (enabled, showCommands, customBlocks) and `actions.homeTab` gate - Onboarding manifest includes `home_tab_enabled: true` and `app_home_opened` event subscription - Comprehensive test coverage (26 view builder + 8 event handler + 7 state management tests) - Documentation with setup instructions, config examples, and troubleshooting **Implementation quality:** - Clean separation of concerns (view builder, state management, event handler, agent tools) - Proper error handling with try-catch blocks and graceful degradation - Timezone display with fallback to UTC on invalid timezones - Version caching optimization reduces unnecessary API calls - Account-scoped state prevents user ID collisions across workspaces <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The implementation demonstrates excellent code quality with comprehensive test coverage (41 tests across 4 test files), clean architecture with proper separation of concerns, robust error handling, and thorough documentation. The state management is account-scoped to prevent cross-contamination, includes in-flight deduplication, and handles edge cases like disabled Home tabs, non-home tabs, and API errors gracefully. The feature is backward compatible (default enabled with no breaking changes), requires no new OAuth scopes, and follows existing patterns in the codebase. All tests pass with proper mocking and integration verification. - No files require special attention <sub>Last reviewed commit: 4cf2a81</sub> <!-- 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