feat(feishu): enable streaming card replies in thread/topic mode#45278
feat(feishu): enable streaming card replies in thread/topic mode#45278maoku-family wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Previously, streaming card replies were disabled when threadReply mode was active (threadReplyMode === true). This was a conservative guard added because card streaming might miss thread affinity. In practice, the streaming card API already passes root_id correctly for topic routing, so there is no functional reason to disable it. Removing the !threadReplyMode guard allows streaming cards in topic groups, providing a consistent UX across all reply modes. Verified locally: streaming cards render correctly in Feishu topic groups with threadReply enabled.
Greptile SummaryThis PR removes the The change is safe for the most common scenario: when Confidence Score: 4/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/feishu/src/reply-dispatcher.ts
Line: 139-141
Comment:
**New comment contradicts existing `streaming-card.ts` caveat**
The updated comment states _"Card streaming with rootId should route to topics correctly"_, but `streaming-card.ts` lines 221–224 contain an explicit, opposing note:
```
// Prefer message.reply when we have a reply target — reply_in_thread
// reliably routes streaming cards into Feishu topics, whereas
// message.create with root_id may silently ignore root_id for card
// references (card_id format).
```
The `root_create` send-mode (used when `rootId` is set but `replyToMessageId` is absent) may **silently drop the `root_id`**, meaning the streaming card won't be threaded under the correct topic in that scenario. The change is safe for the common case where `replyToMessageId` is present (which selects the `reply` send-mode with `reply_in_thread: true`), but the justification comment overstates the reliability of `root_id` routing.
Consider updating the comment to reflect the nuance:
```suggestion
// reply_in_thread reliably routes cards into topics; root_create path may silently
// drop root_id for card references — but replyToMessageId is typically always set
// in thread contexts, making this safe in practice.
const streamingEnabled =
account.config?.streaming !== false && renderMode !== "raw";
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: 329bc5d |
| // Card streaming with rootId should route to topics correctly; enable for all modes. | ||
| const streamingEnabled = | ||
| !threadReplyMode && account.config?.streaming !== false && renderMode !== "raw"; | ||
| account.config?.streaming !== false && renderMode !== "raw"; |
There was a problem hiding this comment.
New comment contradicts existing streaming-card.ts caveat
The updated comment states "Card streaming with rootId should route to topics correctly", but streaming-card.ts lines 221–224 contain an explicit, opposing note:
// Prefer message.reply when we have a reply target — reply_in_thread
// reliably routes streaming cards into Feishu topics, whereas
// message.create with root_id may silently ignore root_id for card
// references (card_id format).
The root_create send-mode (used when rootId is set but replyToMessageId is absent) may silently drop the root_id, meaning the streaming card won't be threaded under the correct topic in that scenario. The change is safe for the common case where replyToMessageId is present (which selects the reply send-mode with reply_in_thread: true), but the justification comment overstates the reliability of root_id routing.
Consider updating the comment to reflect the nuance:
| // Card streaming with rootId should route to topics correctly; enable for all modes. | |
| const streamingEnabled = | |
| !threadReplyMode && account.config?.streaming !== false && renderMode !== "raw"; | |
| account.config?.streaming !== false && renderMode !== "raw"; | |
| // reply_in_thread reliably routes cards into topics; root_create path may silently | |
| // drop root_id for card references — but replyToMessageId is typically always set | |
| // in thread contexts, making this safe in practice. | |
| const streamingEnabled = | |
| account.config?.streaming !== false && renderMode !== "raw"; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/feishu/src/reply-dispatcher.ts
Line: 139-141
Comment:
**New comment contradicts existing `streaming-card.ts` caveat**
The updated comment states _"Card streaming with rootId should route to topics correctly"_, but `streaming-card.ts` lines 221–224 contain an explicit, opposing note:
```
// Prefer message.reply when we have a reply target — reply_in_thread
// reliably routes streaming cards into Feishu topics, whereas
// message.create with root_id may silently ignore root_id for card
// references (card_id format).
```
The `root_create` send-mode (used when `rootId` is set but `replyToMessageId` is absent) may **silently drop the `root_id`**, meaning the streaming card won't be threaded under the correct topic in that scenario. The change is safe for the common case where `replyToMessageId` is present (which selects the `reply` send-mode with `reply_in_thread: true`), but the justification comment overstates the reliability of `root_id` routing.
Consider updating the comment to reflect the nuance:
```suggestion
// reply_in_thread reliably routes cards into topics; root_create path may silently
// drop root_id for card references — but replyToMessageId is typically always set
// in thread contexts, making this safe in practice.
const streamingEnabled =
account.config?.streaming !== false && renderMode !== "raw";
```
How can I resolve this? If you propose a fix, please make it concise.|
Closing as superseded by #71542. The merged fix enables Feishu streaming cards for topic/thread replies and keeps the reply metadata ( Thanks for pushing the thread-mode path. If topic routing still misses affinity in a live Feishu room, reopen with the message/thread ids and we can narrow it to the send-mode layer. |
Summary
Remove the
!threadReplyModeguard fromstreamingEnabledinreply-dispatcher.ts, enabling streaming card replies in Feishu topic/thread mode.Problem
When
threadReply: trueis configured (topic group mode), streaming cards are disabled and responses fall back to plain textreplycalls. This means users in topic groups don't get the streaming card UX that works in normal chats.Change
Why this is safe
The streaming card API already passes
root_idfor topic routing. The original guard was conservative — in practice, cards render correctly in topic groups.Testing
Verified locally in a Feishu topic group with
threadReply: true: