Skip to content

fix(channels): handle bot p2p chat entered event in Feishu channel#1830

Open
lysandre001 wants to merge 1 commit into
bytedance:mainfrom
lysandre001:fix/feishu-and-docker-experience
Open

fix(channels): handle bot p2p chat entered event in Feishu channel#1830
lysandre001 wants to merge 1 commit into
bytedance:mainfrom
lysandre001:fix/feishu-and-docker-experience

Conversation

@lysandre001
Copy link
Copy Markdown

Summary

  • Register a handler for the im.chat.access_event.bot_p2p_chat_entered_v1 event to prevent "processor not found" errors when users first open a private chat with the Feishu bot
  • Remove a redundant None check in FeishuChannel.send() error handling that was unreachable

Problem

When a user enters a bot's private chat in Feishu, the Feishu platform sends a bot_p2p_chat_entered_v1 event via the WebSocket connection. Since this event was not registered in the EventDispatcherHandler, the lark-oapi SDK logged an error on every bot entry:

[Lark] [ERROR] handle message failed, message_type: event, err: processor not found, type: im.chat.access_event.bot_p2p_chat_entered_v1

Fix

Added register_p2_im_chat_access_event_bot_p2p_chat_entered_v1(self._on_bot_chat_entered) to the event handler builder chain, with a simple logging handler that acknowledges the event without side effects.

Changes

File Change
backend/app/channels/feishu.py Register bot_p2p_chat_entered_v1 event handler + cleanup unreachable None check in send error path

Testing

  • Verified Feishu WebSocket connects successfully without processor not found errors
  • Confirmed Feishu channel started and ChannelService started with channels: ['feishu'] in gateway logs

- Register handler for im.chat.access_event.bot_p2p_chat_entered_v1 event
  to prevent 'processor not found' errors when users enter bot private chat
- Remove redundant None check in FeishuChannel.send() error handling

The lark-oapi SDK sends a bot_p2p_chat_entered_v1 event when a user first
opens a private chat with the bot. Without a registered handler, this caused
an error log on every bot entry. Added a no-op handler that logs the event.
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


yilin seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@WillemJiang
Copy link
Copy Markdown
Collaborator

@lysandre001 Thanks for your contribution. Please sign the CLA by clicking the CLA assistant button before we start to review the PR.

@WillemJiang WillemJiang added the question Further information is requested label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants