Skip to content

Feature/feishu thread reply#1537

Open
clawaizhang wants to merge 1 commit intosipeed:mainfrom
clawaizhang:feature/feishu-thread-reply
Open

Feature/feishu thread reply#1537
clawaizhang wants to merge 1 commit intosipeed:mainfrom
clawaizhang:feature/feishu-thread-reply

Conversation

@clawaizhang
Copy link

@clawaizhang clawaizhang commented Mar 14, 2026

📝 Description

修复飞书(Feishu/Lark)话题群中机器人回复不进入话题的问题。

在飞书话题群(topic_group)中,当用户发送一条消息创建一个话题后,机器人回复时没有在该话题下回复,而是每条回复都创建一个新的话题。本 PR 修复了此问题,使机器人能够在正确的话题下回复。

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

Fixes: 飞书话题群回复不进入话题的问题

📚 Technical Context (Skip for Docs)

🧪 Test Environment

  • Hardware: PC
  • OS: Linux
  • Model/Provider: N/A
  • Channels: Feishu (飞书)

📸 Evidence (Optional)

Click to view code changes

主要改动:

  1. pkg/channels/feishu/feishu_64.go:

    • 接收消息时提取 ThreadId 并与 ChatID 组合
    • 添加 replyInThread 方法使用 ReplyMessage API
  2. pkg/channels/feishu/common.go:

    • 添加 parseFeishuChatID 辅助函数
  3. pkg/agent/loop.go:

    • processOptions 中添加 MessageID
    • 传递 ReplyToMessageID 到发送的消息

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

@CLAassistant
Copy link

CLAassistant commented Mar 14, 2026

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.
You have signed the CLA already but the status is still pending? Let us recheck it.

@clawaizhang
Copy link
Author

clawaizhang commented Mar 14, 2026

👥 Requested Reviewers

/assign @yinwm @alexhoshina

cc: @yinwm @alexhoshina

请帮忙 review 这个飞书话题回复的修复,感谢!

@clawaizhang clawaizhang force-pushed the feature/feishu-thread-reply branch 2 times, most recently from 0333eb4 to ca84a2a Compare March 14, 2026 07:21
@sipeed-bot sipeed-bot bot added type: bug Something isn't working domain: channel domain: agent go Pull requests that update go code labels Mar 14, 2026
Copy link
Collaborator

@alexhoshina alexhoshina left a comment

Choose a reason for hiding this comment

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

Based on my observation, this feature only requires modifications to the Feishu channel, and should not introduce coupling specific to a particular channel in the public domain

@clawaizhang clawaizhang force-pushed the feature/feishu-thread-reply branch from ca84a2a to 1cfb2d0 Compare March 14, 2026 14:00
@clawaizhang clawaizhang force-pushed the feature/feishu-thread-reply branch from 1cfb2d0 to 86da6a7 Compare March 14, 2026 14:20
When receiving messages in Feishu topic groups, the bot now correctly
replies within the same topic thread instead of creating new topics.

Changes:
- Extract ThreadId from incoming messages and combine with ChatID
- Use ReplyMessage API with ReplyInThread=true for topic replies
- Pass MessageID through agent loop for proper reply threading
- Add parseFeishuChatID helper function

Fixes issue where each bot reply created a new topic in Feishu groups.
@clawaizhang clawaizhang reopened this Mar 14, 2026
@clawaizhang clawaizhang requested a review from alexhoshina March 15, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: agent domain: channel go Pull requests that update go code type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants