feat(slack): interactive drill-downs and App Home tab - #595
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
The latest updates on your projects. Learn more about Unkey Deploy
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR adds agent-generated Slack drill-down buttons and routes button clicks into same-thread agent runs, while updating the analytics prompt to encourage native Slack components.
Confidence Score: 3/5The PR is not safe to merge until drill-down clicks enforce the same Slack Connect and channel authorization boundaries as existing agent triggers. The new callback allows a shared-channel participant to reach organization-scoped agent execution without the cross-team checks applied to ordinary Slack messages; the remaining typing issue is non-blocking. Files Needing Attention: apps/slack/src/slack/listeners.ts, apps/slack/src/slack/drilldown.ts
|
| Filename | Overview |
|---|---|
| apps/slack/src/slack/listeners.ts | Registers the drill-down callback, but sends it directly into agent execution without the shared-channel authorization gates used by existing message routes. |
| apps/slack/src/slack/drilldown.ts | Converts action payloads into thread follow-up runs correctly for the tested shape, but relies on unknown-based manual parsing. |
| apps/slack/src/slack/blocks.ts | Adds bounded native button rendering for suggested actions; the action schema should use an explicit type. |
| packages/ai/src/ai/prompts/analytics.ts | Documents the suggested-actions component and updates Slack output guidance without introducing a concrete prompt-rendering defect. |
Sequence Diagram
sequenceDiagram
participant U as Slack user
participant S as Slack block_actions
participant H as Drill-down handler
participant A as Agent run handler
participant O as Organization analytics
U->>S: Click suggested follow-up
S->>H: action, user, team, channel, thread
Note over H: Parse prompt and run context
H->>A: handleAgentRun
A->>O: Resolve team and execute query
O-->>A: Analytics response
A-->>U: Reply in same Slack thread
Reviews (1): Last reviewed commit: "feat(ai): let the agent emit suggested-a..." | Re-trigger Greptile
| ) { | ||
| app.action( | ||
| DRILLDOWN_ACTION_ID, | ||
| async ({ ack, action, body, client, logger }) => { | ||
| await ack(); | ||
| const run = parseDrilldownRun(body, action); | ||
| if (!run) { | ||
| return; | ||
| } | ||
| const say: SlackSay = (message) => | ||
| client.chat.postMessage({ channel: run.channelId, ...message }); | ||
| const slackContext = createSlackConversationContext(client, run); | ||
| await threadQueue.markEngaged(run); | ||
| await handleAgentRun({ |
There was a problem hiding this comment.
Shared-channel authorization bypass
When an external Slack Connect participant clicks a drill-down button, this handler calls handleAgentRun without the channel-readiness or cross-team-user checks used by ordinary thread follow-ups, causing analytics to execute under the installing workspace and return its data in the shared channel.
How this was verified: The new action handler reaches handleAgentRun directly, while the existing thread-follow-up route rejects users whose source team differs from the installed team.
Knowledge Base Used: Slack App
| export function parseDrilldownRun( | ||
| body: unknown, | ||
| action: unknown | ||
| ): SlackAgentRun | null { |
There was a problem hiding this comment.
parseDrilldownRun accepts both payloads as unknown, and the renderer similarly casts actions to Record<string, unknown>, preventing the compiler from detecting Slack callback or suggested-action schema drift. Define explicit payload types for this new action flow.
Context Used: Basic guidelines for the project so vibe coders do... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
…-home feat(slack): App Home quick-start tab
What
Agent-tailored drill-down buttons in Slack. After an analytics answer, the agent can offer 1-3 context-specific follow-up questions as buttons; clicking one runs the agent with that exact question in the same thread.
Builds on the native Block Kit work (#594).
How it works
suggested-actionscomponent:{"type":"suggested-actions","actions":[{"label":"Break down by referrer","prompt":"break /pricing down by referrer"}]}(packages/ai prompt).actionsblock of buttons carrying the prompt (action_id: agent_drilldown,value: <prompt>).block_actionshandler (parseDrilldownRun→handleAgentRun) turns a click into a scoped thread follow-up run.data-table/charts/lists natively (from feat(slack): native Block Kit output, feedback buttons, rotating status #594), so the agent is told to prefer them.Testing
apps/slacksuite: 68/68 pass (newdrilldown.test.tsfor the payload→run parser;renderSuggestedActionscovered inblocks.test.ts).actions-block render shape was verified live in feat(slack): native Block Kit output, feedback buttons, rotating status #594.Open follow-up
The button click → agent run path is unit-tested on the parser but not yet confirmed with a real human click (needs a live thread). Same pattern as the feedback buttons. The agent actually emitting
suggested-actionsdepends on the new prompt line and will show up in real conversations.Summary by cubic
Adds agent-tailored drill-down buttons and a quick-start App Home in Slack, including quick-action dashboard links, to help users follow up and get started faster. Blocks external Slack Connect clicks, tightens payload typing, updates the analytics prompt to prefer native components, and collapses list renderers into one config.
New Features
suggested-actionsas Slack buttons inapps/slack; each carries the exact prompt (action_id: agent_drilldown).parseDrilldownRunand runs the agent as a thread follow-up in the same channel.app_home_opened(manifest +views.publish).Refactors
renderListTablewithLIST_TABLES, and types the App Home view builder.Written for commit 0840576. Summary will update on new commits.