Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update slack_bot #1353

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

feat: Update slack_bot #1353

wants to merge 6 commits into from

Conversation

Asher-hss
Copy link
Collaborator

Description

close #slack

Motivation and Context

close #slack

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Example (update in the folder of example)

Implemented Tasks

  • Subtask 1
  • Subtask 2
  • Subtask 3

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • I have read the CONTRIBUTION guide. (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly. (required for a bug fix or a new feature)
  • I have updated the documentation accordingly.

@Asher-hss Asher-hss self-assigned this Dec 20, 2024
@Wendong-Fan Wendong-Fan requested a review from WHALEEYE December 26, 2024 20:00
Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

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

PR naming is not following our standard, pre-commit is not passing

@Asher-hss
Copy link
Collaborator Author

Thanks @Wendong-Fan, The related issue has been fixed.

@Wendong-Fan Wendong-Fan changed the title update slack_bot feat: Update slack_bot Dec 28, 2024
@Wendong-Fan Wendong-Fan added the enhancement New feature or request label Dec 28, 2024
@Wendong-Fan Wendong-Fan modified the milestones: Sprint 7, Sprint 19 Dec 28, 2024
Copy link
Collaborator

@koch3092 koch3092 left a comment

Choose a reason for hiding this comment

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

Thanks @Asher-hss , just curious, I guess you created a new slack socket mode bot, but in the new socket mode bot, you did the work of being compatible with socket mode and http mode. Why not just do what the socket mode should do in the slack socket mode bot?

scopes: Optional[str] = None,
signing_secret: Optional[str] = None,
client_id: Optional[str] = None,
client_secret: Optional[str] = None,
redirect_uri_path: str = "/slack/oauth_redirect",
installation_store: Optional[AsyncInstallationStore] = None,
socket_mode: bool = True,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @Asher-hss , when we create a new slack app, socket mode is turned off by default. Let's set socket_mode to False to maintain consistency with the official configuration.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure

self._handler: Optional[
Union[AsyncSlackRequestHandler, AsyncSocketModeHandler]
] = None
if not self.socket_mode:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @Asher-hss , the slack app contains OAuth verification and Message communication. In socket mode, the OAuth process also needs to be allowed. I don't think the verification here is appropriate.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The purpose here is:

  1. Different modes correspond to different validation procedures to avoid confusion in validation.
  2. Use default validation in socket mode to reduce the learning curve for users.

@Asher-hss
Copy link
Collaborator Author

Thanks @Asher-hss , just curious, I guess you created a new slack socket mode bot, but in the new socket mode bot, you did the work of being compatible with socket mode and http mode. Why not just do what the socket mode should do in the slack socket mode bot?

Hi Coco,I didn't understand what you meant. Could you explain it more clearly?

@camel-ai camel-ai deleted a comment from Emma2010lgtm Jan 2, 2025
@Wendong-Fan
Copy link
Member

pre commit, conflict with master branch, pytest need to be fixed @Asher-hss

@Asher-hss Asher-hss marked this pull request as draft January 10, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[Feature Request] Slackbot Initialization Optimization
4 participants