Slack
CodeArts Agent Space provides IM access capabilities for multiple platforms, supporting the reuse of agent capabilities across these platforms alongside unified configuration management.
This section describes how to connect CodeArts Agent Space to Slack, allowing you to quickly integrate capabilities and enable collaborative workflows.
Constraints
| Category | Description |
|---|---|
| Function | A Slack bot can connect to only one CodeArts Agent Space. |
Procedure
| No. | Operation Platform | Step | Description |
|---|---|---|---|
| 1 | Slack developer console | Before connecting CodeArts Agent Space to a Slack bot, perform the following operations:
| |
| 2 | CodeArts Agent Space | In CodeArts Agent Space, register a Slack bot to receive and reply to messages. | |
| 3 | Slack client CodeArts Agent Space | Use the Slack bot to deliver tasks to CodeArts Agent Space. |
Step 1: Preparations
- Create a Slack application.
- Sign in to the Slack developer console and click Create New App. The Create an app page is displayed.
- Select From scratch, set App Name, select a workspace, and click Create App.
App Name is the bot name.
- Enable Socket Mode and obtain the application token.
- Go to the Socket Mode page and toggle on Enable Socket Mode under Connect using Socket Mode.
- Enter a token name and click Generate. Copy the application token as prompted. Keep the token secure. It can be copied only once. This token will be used when you connect to the Slack bot in CodeArts Agent Space.Figure 1 Copying a token
- Obtain the bot token.
- Go to the page, click Add an OAuth Scope in Scopes > Bot Token Scopes, and add the following permissions:
- app_mentions:read
- channels:history
- chat:write
- groups:history
- im:history
- im:read
- im:write
- mpim:history
- users:read
- In OAuth Tokens, click Install to All FOR AI and click Allow to obtain the bot token. Keep the bot token secure. This token will be used when you connect to the Slack bot in CodeArts Agent Space.Figure 2 Bot token
- Go to the page, click Add an OAuth Scope in Scopes > Bot Token Scopes, and add the following permissions:
- Enable event subscription.
- Go to the Event Subscriptions page and toggle on Enable Events.
- After the function is enabled, click Add Bot User Event in Subscriptions to bot events.
- Add the following events and click Save Changes.
- message.im
- app_mention
- Enable the function of sending messages to the bot.
Go to the App Home page, enable Messages Tab, and select
Allow users to send Slash commands and messages from the messages tab.
- Obtain the key.
Go to the Basic Information page and obtain the client secret from App Credentials. The client secret will be used when you connect to the Slack bot in CodeArts Agent Space.
- Customize slash commands.
Go to the Slash Commands page and click Create New Command to create slash commands in Figure 3.
Table 3 Custom slash commands Command
Description
/stop
Stops the current session.
/help
Checks available commands.
/new
Initiates a new chat.
When a new chat is created, CodeArts Agent Space automatically saves the original chat to the history list. After this, you will enter a new chat environment and cannot return to the previous chat.
/models
Checks and switches models.
(Only CodeArts Agent Space built-in models)
Step 2: CodeArts Agent Space Configuration
- Access CodeArts Agent Space by referring to Enabling CodeArts Agent Space.
- In CodeArts Agent Space, click Select Project Folder, choose Open Project, and open a folder. Figure 4 Opening a folder
- Click
in the upper right corner of CodeArts Agent Space to open the settings page. - Choose IM Integration and click Configure next to Slack. The Register Slack Channel page is displayed.
- Enter the Slack bot credentials (Client ID/Client Secret) obtained in 6 and click Register. Set Bot Token to Bot User OAuth Token obtained in 3, App-Level Token to the token obtained in 2, and Signing Secret to Client Secret obtained in 6.Figure 5 Registering the Slack bot
Wait until the registration is complete. When the status changes from Connecting to Connected, the Slack bot is successfully registered.
Step 3: Remote Control from Slack
- Log in to the Slack client. In Apps & Agents, click the bot added in 1.
- Describe the task to the Slack bot and send it to submit the task.
The bot automatically receives feedback from CodeArts Agent Space. You can use slash commands customized in 7 on the Slack client to trigger corresponding functions more effectively.
- Confirm the task requirements and key information based on the feedback and complete the task creation.
- Check the task execution result.
- Slack bot: The Slack bot receives a completion message from CodeArts Agent Space, indicating that the task execution is complete and providing the location of the deliverables.
- CodeArts Agent Space: IN IM > Slack, you can check the task execution process and result in real time. Click
in the upper right corner of the chat window to view the generated deliverables in the task artifact list.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
