Skip to content

fix: pass rootId to streaming card in Feishu topic groups#28346

Merged
Takhoffman merged 3 commits intoopenclaw:mainfrom
Sid-Qin:fix/feishu-topic-rootid-streaming-28273
Feb 28, 2026
Merged

fix: pass rootId to streaming card in Feishu topic groups#28346
Takhoffman merged 3 commits intoopenclaw:mainfrom
Sid-Qin:fix/feishu-topic-rootid-streaming-28273

Conversation

@Sid-Qin
Copy link
Copy Markdown
Contributor

@Sid-Qin Sid-Qin commented Feb 27, 2026

Summary

  • Problem: In Feishu topic groups, when the agent uses streaming cards to reply, the streaming card message creates a new topic instead of replying under the original topic. The first plain-text reply is correct, but subsequent streaming card replies break topic threading.
  • Why it matters: This creates a confusing UX where agent responses are scattered across multiple topics instead of being grouped under the user's original message thread.
  • What changed: Thread rootId through the entire reply chain: bot.ts (has ctx.rootId) → reply-dispatcher.ts (new rootId param) → streaming-card.ts (root_id in im.message.create payload).
  • What did NOT change: Plain-text reply path using client.im.message.reply() is unaffected (it already handles topic threading implicitly).

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Channel: Feishu

Linked Issue/PR

User-visible / Behavior Changes

Streaming card replies in Feishu topic groups now appear under the original topic instead of creating new topics.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No — same im.message.create API, just adding root_id field
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Evidence

  • npx vitest run extensions/feishu/ — 64/64 passed
  • npx oxfmt --check — clean

Human Verification (required)

  • Verified scenarios: Code review confirms root_id is correctly threaded through all three files; root_id is only included when non-null (conditional spread)
  • What you did not verify: Live Feishu topic group streaming card reply (requires Feishu bot setup)

Compatibility / Migration

  • Backward compatible? Yes — root_id is optional in Feishu API; omitting it (non-topic chats) is unchanged
  • Config/env changes? No
  • Migration needed? No

Failure Recovery (if this breaks)

  • Revert commit; streaming card replies return to creating new topics (existing behavior)

Risks and Mitigations

root_id is spread conditionally (...(rootId ? { root_id: rootId } : undefined)), so non-topic group chats and DM chats are completely unaffected.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Correctly threads rootId from Feishu message context through the reply dispatcher to the streaming card API, fixing the bug where streaming replies in topic groups created new topics instead of replying under the original topic. The implementation properly handles the optional nature of rootId (only present in topic group messages) by using optional parameters throughout the chain and conditional spreading in the final API payload.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are minimal, focused, and correctly implement the fix by threading an optional parameter through the call chain. All existing tests pass, the implementation follows existing patterns in the codebase, and the change is backwards compatible (rootId is optional).
  • No files require special attention

Last reviewed commit: 437830e

@openclaw-barnacle openclaw-barnacle bot added the scripts Repository scripts label Feb 28, 2026
SidQin-cyber and others added 3 commits February 27, 2026 20:03
When replying in a Feishu topic group, the streaming card message was
created without root_id, causing it to spawn a new topic instead of
replying under the original one.

Thread rootId through bot.ts → reply-dispatcher.ts → streaming-card.ts
so that im.message.create includes root_id for topic-scoped replies.

Closes openclaw#28273

Made-with: Cursor
@Takhoffman Takhoffman force-pushed the fix/feishu-topic-rootid-streaming-28273 branch from 4da3b8d to 2290224 Compare February 28, 2026 02:05
@Takhoffman Takhoffman merged commit 4221b5f into openclaw:main Feb 28, 2026
26 checks passed
@Takhoffman
Copy link
Copy Markdown
Contributor

PR #28346 - fix: pass rootId to streaming card in Feishu topic groups (#28346)

Merged via squash.

  • Merge commit: cdc48f9f256bc484f8ec35e0f5390f972a6689eb
  • Verified: pnpm check, pnpm test extensions/feishu/src/reply-dispatcher.test.ts
  • Changes made:
    M extensions/feishu/src/reply-dispatcher.test.ts
    M extensions/feishu/src/reply-dispatcher.ts
    M extensions/feishu/src/streaming-card.ts
    M scripts/check-no-raw-channel-fetch.mjs
  • Why these changes were made:
    Resolve rebase conflicts while preserving existing replyInThread behavior and ensure topic-group streaming card replies include rootId routing with regression coverage.
  • Changelog: CHANGELOG.md updated=false required=true opt_out=false

Thanks @Sid-Qin!

@Takhoffman
Copy link
Copy Markdown
Contributor

Correction: the merge commit SHA is 4221b5f.

r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 28, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 5dd2a37)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 5dd2a37)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 5dd2a37)
vincentkoc pushed a commit to Sid-Qin/openclaw that referenced this pull request Feb 28, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
vincentkoc pushed a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
newtontech pushed a commit to newtontech/openclaw-fork that referenced this pull request Feb 28, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 4221b5f)

# Conflicts:
#	extensions/feishu/src/bot.ts
#	extensions/feishu/src/reply-dispatcher.test.ts
#	extensions/feishu/src/reply-dispatcher.ts
#	extensions/feishu/src/streaming-card.ts
#	scripts/check-no-raw-channel-fetch.mjs
ansh pushed a commit to vibecode/openclaw that referenced this pull request Mar 2, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
venjiang pushed a commit to venjiang/openclaw that referenced this pull request Mar 2, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 4221b5f)

# Conflicts:
#	extensions/feishu/src/bot.ts
#	extensions/feishu/src/reply-dispatcher.test.ts
#	extensions/feishu/src/reply-dispatcher.ts
#	extensions/feishu/src/streaming-card.ts
#	scripts/check-no-raw-channel-fetch.mjs
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 15, 2026
…8346) thanks @Sid-Qin

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts

Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 4221b5f)
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 15, 2026
…8346) thanks @Sid-Qin (#1459)

Verified:
- pnpm check
- pnpm test extensions/feishu/src/reply-dispatcher.test.ts



(cherry picked from commit 4221b5f)

Co-authored-by: Sid <[email protected]>
Co-authored-by: Sid-Qin <[email protected]>
Co-authored-by: Tak Hoffman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu scripts Repository scripts size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feishu 话题群流式回复创建新话题问题

2 participants