Skip to content

feat(slack): slack-v2 copilot entitlement and agent_view custom-bot manifests#5876

Open
TheodoreSpeaks wants to merge 2 commits into
stagingfrom
feat/slack-v2-entitlement
Open

feat(slack): slack-v2 copilot entitlement and agent_view custom-bot manifests#5876
TheodoreSpeaks wants to merge 2 commits into
stagingfrom
feat/slack-v2-entitlement

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • slack-v2 copilot entitlement: computed from the viewer's block-visibility projection (same predicate that hides the slack_v2 schema in the VFS), fail-closed without a userId
  • custom-bot wizard manifests migrate to the agent messaging experience: features.agent_view (new Slack apps can no longer use assistant_view), agent event set (app_home_opened, app_context_changed, message.im), description capped at Slack's 300-char limit
  • new app_context_changed trigger event with context (entities) passthrough in the webhook normalizer
  • deploy before mothership PR simstudioai/mothership#365 — until this ships, the copilot's v2 tips stay hidden (intended fail-closed)

Type of Change

  • New feature

Testing

capabilities + slack provider vitest (44 passing, incl. new agent_view/event-set/cap tests), tsc clean, API validation audit passed; entitlement verified live end-to-end against the mothership branch

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 23, 2026 3:12am

Request Review

@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Manifest changes affect new Slack app creation (irreversible agent_view migration) and copilot/mothership contract timing; webhook and entitlement behavior are well-tested but touch integration surfaces.

Overview
Adds a slack-v2 copilot entitlement so mothership can gate Slack v2 tips/tools. It is granted only when the viewer can see the slack_v2 block (same visibility as the copilot VFS schema), and fails closed without a userId.

Custom Slack bot manifests move from deprecated assistant_view to Slack’s agent_view agent messaging experience: agent_description (300-char cap), and bot events app_home_opened, app_context_changed, and message.im instead of assistant_thread_*. UI copy shifts from “assistant” to “agent”.

The webhook normalizer surfaces app_context_changed and passes through context (viewing entities) on trigger output; the event catalog documents the new trigger type.

Reviewed by Cursor Bugbot for commit b6aab2c. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds Slack v2 entitlement handling and migrates custom Slack apps to the agent messaging experience. The main changes are:

  • Adds a per-viewer slack-v2 copilot entitlement.
  • Generates agent_view manifests with the new agent event set.
  • Normalizes app_context_changed context into trigger output.
  • Updates Slack setup copy and manifest tests.

Confidence Score: 5/5

This looks safe to merge after a small trigger-output description cleanup.

  • The entitlement remains fail-closed and isolated by workspace and user.
  • Agent manifest generation and webhook routing are consistent with the new event set.
  • The only identified issue is misleading metadata for the new context output.

apps/sim/triggers/slack/shared.ts

Important Files Changed

Filename Overview
apps/sim/lib/copilot/entitlements.ts Adds the fail-closed, per-viewer Slack v2 entitlement evaluation.
apps/sim/triggers/slack/capabilities.ts Migrates generated manifests to agent_view, updates events, and limits agent descriptions.
apps/sim/lib/webhooks/providers/slack.ts Recognizes and normalizes app_context_changed events.
apps/sim/triggers/slack/shared.ts Adds the context output and event catalog entry, but describes the context object as an array.
apps/sim/triggers/slack/capabilities.test.ts Covers the new manifest feature, event set, fallback text, and description limit.
apps/sim/app/workspace/[workspaceId]/integrations/components/connect-slack-bot-modal/connect-slack-bot-modal.tsx Updates Slack setup terminology from assistant to agent.

Reviews (1): Last reviewed commit: "feat(slack): slack-v2 copilot entitlemen..." | Re-trigger Greptile

Comment on lines +130 to +134
context: {
type: 'json',
description:
'What the user is currently viewing, as an entities array (each entry: type, value, team_id). Present for app_context_changed; null otherwise',
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Context Output Shape Is Misstated

The normalizer returns the full context object, shaped like { entities: [...] }, but this description says the output is an entities array. Workflow authors following it may index event.context directly and receive no entity data.

Suggested change
context: {
type: 'json',
description:
'What the user is currently viewing, as an entities array (each entry: type, value, team_id). Present for app_context_changed; null otherwise',
},
context: {
type: 'json',
description:
'What the user is currently viewing, as an object containing an entities array (each entry: type, value, team_id). Present for app_context_changed; null otherwise',
},

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — description now says it's an object with an entities array and shows the context.entities[0].value access path.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b6aab2c. Configure here.

features.agent_view = {
agent_description: (
trimmedDescription || `${displayName} — an AI agent powered by Sim.`
).slice(0, 300),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Profile description exceeds agent cap

Medium Severity

The PR caps the user-supplied description at 300 characters for features.agent_view.agent_description, but the same text is copied verbatim into display_information.description. Long wizard descriptions can exceed Slack’s limit there and fail manifest validation even though the agent field was truncated.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b6aab2c. Configure here.

// features.agent_view), message.im (incoming messages). The legacy
// assistant_thread_* events belong to the deprecated assistant_view
// experience and are not subscribable by new agent_view apps.
events: ['app_home_opened', 'app_context_changed', 'message.im'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assistant triggers lack manifest events

Medium Severity

Custom-bot manifests with the AI agent capability now subscribe to app_home_opened, app_context_changed, and message.im instead of assistant_thread_*, but the trigger event picker still offers “Assistant opened” and “Assistant context changed.” Workflows using those events never receive webhooks from newly created agent apps.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b6aab2c. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant