Updated on 2026-07-25 GMT+08:00

Lark

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 Lark, allowing you to quickly integrate capabilities and enable collaborative workflows.

Constraints

Table 1 Constraints

Category

Description

Function

A Lark bot can connect to only one CodeArts Agent Space.

Procedure

Table 2 Connecting CodeArts Agent Space to Lark

No.

Operation Platform

Step

Description

1

Lark developer console

Step 1: Preparations

Before connecting CodeArts Agent Space to a Lark bot, perform the following operations:

  1. Create a custom application.
  2. Add a bot.
  3. Add application identity permissions for the bot.
  4. Add events and callbacks for the bot.
  5. Release the application.
  1. Obtain the application credential.

2

CodeArts Agent Space

Step 2: CodeArts Agent Space Configuration

In CodeArts Agent Space, register a Lark bot to receive and reply to messages.

3

Lark client

CodeArts Agent Space

Step 3: Remote Control from Lark

Use the Lark bot to deliver tasks to CodeArts Agent Space.

Step 1: Preparations

  1. Create a custom application.

    Log in to the Lark open platform, click Developer Console in the upper right corner, and click Create Custom App on the Custom Apps tab.

  2. Add a bot.

    Go to the Add Features page. On the By Feature tab, click Add under a bot to add the bot for the application.

  3. Add application permissions for the bot.

    Go to the Permissions & Scopes page and click Add permission scopes to app. On the Tenant token scopes tab, add the following permissions for the bot:

    • Obtain group information (im:chat:readonly)
    • Obtain and send direct messages and group chat messages (im:message)
    • Obtain and update group information (im:chat)
    • Receive users' mentions (im:message.group_at_msg:readonly)
    • Receive other bots' and users' mentions (im:message.group_at_msg.include_bot:readonly)
    • Get direct messages sent to bot (im:message.p2p_msg:readonly)
    • Send messages as an app (im:message:send_as_bot)
    • Read and upload images or other files (im:resource)
    • Get card information (cardkit:card:read)
    • Create and update card (cardkit:card:write)

  4. Add events and callbacks for the bot.

    1. Go to the Events & Callbacks page. In the Event configuration area, select Receive events through persistent connection under Subscription mode and click Save.

      Subscription mode must be set to Receive events through persistent connection.

    2. Click Add Events. On the Tenant Token-Based Subscription tab, add the following events:
      • Bot added to group (im.chat.member.bot.added_v1)
      • Bot removed from group (im.chat.member.bot.deleted_v1)
      • Message_received (im.message.receive_v1)
      • Message-read (im.message.message_read_v1)
    3. Go to the Events & Callbacks page. In the Callback configuration area, select Receive callbacks through persistent connection under Subscription mode and click Save.

      Subscription mode must be set to Receive callbacks through persistent connection.

    4. Click Add callback, search for and add Card callback communication (card.action.trigger).

  5. Release the application.

    Go to the Credentials & Basic Info page, click Create Version in the upper part of the page, and submit the application release request. Then, choose Version Management & Release under App Versions to check the progress. If the version status is Released, the application has been successfully released.

  6. Obtain the application credential.

    Go to the Credential & Basic Info page. In the Credentials area, obtain App ID and App Secret. This credential will be used when you connect to the Lark bot in CodeArts Agent Space.

Step 2: CodeArts Agent Space Configuration

  1. Access CodeArts Agent Space by referring to Enabling CodeArts Agent Space.
  2. In CodeArts Agent Space, click Select Project Folder, choose Open Project, and open a folder.

    Figure 1 Opening a folder

  3. Click in the upper right corner of CodeArts Agent Space to open the settings page.
  4. Choose IM Integration and click Configure next to Lark. The Register Lark Channel page is displayed.
  5. Enter the Lark application credentials (Client ID/Client Secret) obtained in 6 and click Register.

    Figure 2 Registering Lark

    Wait until the registration is complete. When the status changes from Connecting to Connected, the Lark bot is successfully registered.

Step 3: Remote Control from Lark

  1. Log in to the Lark client and add the bot.

    • One-to-one chat: In the search box of the Lark client, search for the bot created in 2. Click the search result to access it.
    • Group chat: In the upper right corner of the Lark client, click ... and choose Settings. In the Bots area, click Add Bot. Search for the bot created in 2, click the search result, and click Add to add the bot to the group chat.

  2. Describe the task to the Lark bot and click Send to submit the task.

    The bot automatically receives feedback from CodeArts Agent Space. You can use slash commands on the Lark client to trigger corresponding functions more effectively.

  3. Confirm the task requirements and key information based on the feedback and complete the task creation.
  4. Check the task execution result.

    • Lark bot: The Lark 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 > Lark, 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.

Slash Commands Supported by the Lark Client

Table 3 Supported 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)