Skip to content

fix(dingtalk): adapt message handler to dingtalk-stream SDK CallbackMessage format#10003

Closed
PeterGuy326 wants to merge 1 commit into
NousResearch:mainfrom
PeterGuy326:fix/dingtalk-stream-adapter
Closed

fix(dingtalk): adapt message handler to dingtalk-stream SDK CallbackMessage format#10003
PeterGuy326 wants to merge 1 commit into
NousResearch:mainfrom
PeterGuy326:fix/dingtalk-stream-adapter

Conversation

@PeterGuy326

Copy link
Copy Markdown

Summary

  • DingTalk adapter read business fields (msgId, senderId, text, sessionWebhook, etc.) from top-level ChatbotMessage attributes, but dingtalk-stream SDK delivers them inside message.data dict — causing all messages to be silently dropped
  • Fixed data extraction to read from message.data dict with proper JSON parsing fallback
  • Removed unnecessary thread bridging: DingTalkStreamClient.start() is a native async coroutine, now awaited directly
  • _CallbackHandler.process() is now async def, awaiting _on_message() directly
  • Added diagnostic logging for session webhook routing

Test plan

  • Verify 1:1 DM messages are received and replied to correctly
  • Verify group @mention messages are processed and replied via session webhook
  • Verify rich text fallback still works
  • Verify message deduplication by msgId still functions
  • Confirm stream client runs without event loop conflicts

🤖 Generated with Claude Code

…essage format

The dingtalk-stream SDK delivers messages as CallbackMessage objects where
business fields live in message.data dict, not as top-level attributes.
Also fixed async handling: start() is a native coroutine, no thread bridging needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@meng93

meng93 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

fix my problem

@teknium1

Copy link
Copy Markdown
Contributor

Closing — CallbackMessage → ChatbotMessage conversion and the broader SDK-compat rewrite are now on main as of #11471 (#11471). Thanks for the investigation!

@teknium1 teknium1 closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants