Skip to content

fix(dingtalk): route native voice media to STT - #38276

Closed
sweetcornna wants to merge 1 commit into
NousResearch:mainfrom
sweetcornna:codex/fix-38219-dingtalk-voice-stt
Closed

fix(dingtalk): route native voice media to STT#38276
sweetcornna wants to merge 1 commit into
NousResearch:mainfrom
sweetcornna:codex/fix-38219-dingtalk-voice-stt

Conversation

@sweetcornna

Copy link
Copy Markdown
Contributor

Summary

  • parse DingTalk native media payloads from message.extensions["content"] in addition to richText items
  • preserve MessageType.VOICE for DingTalk voice notes so the gateway STT path runs
  • add native audio/video/file mappings and regression coverage for extensions media download-code resolution

Root cause

DingTalk stream callbacks can keep native voice/audio/video/file payloads inside extensions["content"], and SDK-shaped richText voice items could be classified as VOICE before the richText fallback reset non-image content back to TEXT. That skipped the existing voice/STT pipeline.

Closes #38219.

Verification

  • /Users/cornna/project/hermes-agent/.venv/bin/python -m pytest tests/gateway/test_dingtalk.py -q
  • /Users/cornna/project/hermes-agent/.venv/bin/python -m ruff check gateway/platforms/dingtalk.py tests/gateway/test_dingtalk.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/dingtalk DingTalk adapter comp/gateway Gateway runner, session dispatch, delivery tool/tts Text-to-speech and transcription labels Jun 3, 2026
@sweetcornna
sweetcornna marked this pull request as ready for review June 3, 2026 15:15

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the focused DingTalk regression coverage. The underlying bug is still present on current main: plugins/platforms/dingtalk/adapter.py:797-804 assigns MessageType.VOICE, but :817-822 resets non-image richText messages to TEXT; its extraction and resolution paths also do not inspect extensions content (:774-813, :1316-1324).

Problems

  • The diff targets gateway/platforms/dingtalk.py, which was moved to plugins/platforms/dingtalk/adapter.py by 560010547; GitHub consequently reports this PR as conflicting.

Suggested changes

  • Salvage the media-item iteration, raw-extension preservation, and richText classification fix into plugins/platforms/dingtalk/adapter.py, then port the tests to its current import path.

Automated hermes-sweeper review.

@@ -1468,6 +1490,11 @@ async def process(self, message: "CallbackMessage"):
if raw_flag:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This preservation logic needs to be ported to plugins/platforms/dingtalk/adapter.py: commit 560010547 moved the active adapter there, and this old path no longer exists on current main.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing as stale target: this PR patches gateway/platforms/dingtalk.py, which was deleted when the platform adapters were rewritten as plugins — the live code now lives in plugins/platforms/*/adapter.py, so this diff can no longer apply.

DingTalk native voice→STT routing is being salvaged via #50014 against the live plugins/platforms/dingtalk/adapter.py. Your richText-reset analysis (VOICE reset back to TEXT/PHOTO) was correct and is being verified as covered during that salvage.

Thanks @sweetcornna — if anything in your change isn't covered by the salvage noted above, please resubmit against the current plugin adapter.

@teknium1 teknium1 closed this Jul 28, 2026
teknium1 added a commit that referenced this pull request Jul 28, 2026
…ication

The msg_type_str == "richText" branch reset msg_type to PHOTO/TEXT after
the rich-text item scan had already promoted it (e.g. a native voice item
→ VOICE), dropping voice notes from the auto-STT path. Only re-derive when
the scan left the type at TEXT.

Ports the root-cause analysis from PR #38276 (stale, targeted the deleted
gateway/platforms/dingtalk.py) onto the live plugin adapter, with
regression tests.

Refs #38211 #38219 #38276
teknium1 added a commit that referenced this pull request Jul 28, 2026
…ication

The msg_type_str == "richText" branch reset msg_type to PHOTO/TEXT after
the rich-text item scan had already promoted it (e.g. a native voice item
→ VOICE), dropping voice notes from the auto-STT path. Only re-derive when
the scan left the type at TEXT.

Ports the root-cause analysis from PR #38276 (stale, targeted the deleted
gateway/platforms/dingtalk.py) onto the live plugin adapter, with
regression tests.

Refs #38211 #38219 #38276
teknium1 added a commit that referenced this pull request Jul 28, 2026
…ication

The msg_type_str == "richText" branch reset msg_type to PHOTO/TEXT after
the rich-text item scan had already promoted it (e.g. a native voice item
→ VOICE), dropping voice notes from the auto-STT path. Only re-derive when
the scan left the type at TEXT.

Ports the root-cause analysis from PR #38276 (stale, targeted the deleted
gateway/platforms/dingtalk.py) onto the live plugin adapter, with
regression tests.

Refs #38211 #38219 #38276
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…ication

The msg_type_str == "richText" branch reset msg_type to PHOTO/TEXT after
the rich-text item scan had already promoted it (e.g. a native voice item
→ VOICE), dropping voice notes from the auto-STT path. Only re-derive when
the scan left the type at TEXT.

Ports the root-cause analysis from PR NousResearch#38276 (stale, targeted the deleted
gateway/platforms/dingtalk.py) onto the live plugin adapter, with
regression tests.

Refs NousResearch#38211 NousResearch#38219 NousResearch#38276
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/dingtalk DingTalk adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages tool/tts Text-to-speech and transcription type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DingTalk native voice messages are not routed to STT

3 participants