Skip to content

feat(slack): request channels:manage and groups:write for conversation ops#4792

Merged
waleedlatif1 merged 1 commit into
stagingfrom
waleedlatif1/slack-oauth-channel-scopes
May 29, 2026
Merged

feat(slack): request channels:manage and groups:write for conversation ops#4792
waleedlatif1 merged 1 commit into
stagingfrom
waleedlatif1/slack-oauth-channel-scopes

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Add channels:manage and groups:write to the Slack OAuth scope set so the "Create Conversation" and "Invite to Conversation" operations work with the hosted (Sim Bot) OAuth credential — these call conversations.create/conversations.invite, which require those scopes for public and private channels respectively
  • Without them the operations fail at runtime with missing_scope on OAuth credentials (custom bot tokens are unaffected; they bring their own scopes)
  • Verified against the code that these are the only OAuth-token methods missing scopes; reactions:read was intentionally NOT added since reactions.get is only used by the custom-bot trigger path, never the OAuth token

Type of Change

  • Bug fix

Testing

Tested manually; lint passes. Note: existing Slack OAuth connections must reconnect to pick up the new scopes (the credential selector surfaces the reconnect prompt).

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
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 29, 2026 7:08pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 29, 2026

PR Summary

Low Risk
Config-only OAuth scope expansion; no runtime logic changes, though users must reconnect Slack to pick up new permissions.

Overview
Extends the Slack OAuth scope list in oauth.ts with channels:manage and groups:write so hosted (Sim Bot) credentials can call conversations.create and conversations.invite without Slack returning missing_scope.

Custom bot tokens are unchanged. Existing Slack OAuth connections must reconnect to grant the new scopes.

Reviewed by Cursor Bugbot for commit 5a257ac. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR adds two missing Slack OAuth scopes (channels:manage and groups:write) to the hosted Sim Bot credential, fixing runtime missing_scope failures for the Create Conversation and Invite to Conversation operations. Custom bot tokens are unaffected; only users authenticating via the hosted OAuth flow need to reconnect.

  • channels:manage is required by conversations.create/conversations.invite for public channels; groups:write is the equivalent for private channels — both were absent from the scope list.
  • The change is confined to the static scope array in oauth.ts; no logic, routing, or data handling is modified.

Confidence Score: 5/5

Safe to merge — a two-line additive change to a static scope list with no logic modifications.

The change is a minimal, targeted fix: two OAuth scope strings are inserted into a static array. The affected tools already include missing_scope error handling that names these exact scopes, confirming the fix is consistent with the existing implementation. No logic, routing, auth flow, or data handling is touched.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/lib/oauth/oauth.ts Adds channels:manage and groups:write to the Slack OAuth scope list to support conversations.create and conversations.invite API calls that were failing with missing_scope.

Sequence Diagram

sequenceDiagram
    participant User
    participant SimBot as Sim Bot (OAuth)
    participant SlackAPI as Slack API

    User->>SimBot: Trigger "Create Conversation" / "Invite to Conversation"
    SimBot->>SlackAPI: POST conversations.create or conversations.invite (Bearer OAuth token)
    alt Before this PR (missing scopes)
        SlackAPI-->>SimBot: "{ ok: false, error: "missing_scope" }"
        SimBot-->>User: Error: Missing required permissions
    else After this PR (channels:manage + groups:write added)
        SlackAPI-->>SimBot: "{ ok: true, channel: {...} }"
        SimBot-->>User: Success
    end
Loading

Reviews (1): Last reviewed commit: "feat(slack): request channels:manage and..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit 8daca91 into staging May 29, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/slack-oauth-channel-scopes branch May 29, 2026 19:22
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