Skip to content

fix(dingtalk): standalone fallback uses markdown instead of text / 钉钉 fallback 路径改为 Markdown 渲染 - #53163

Open
WenhuaXia wants to merge 1 commit into
NousResearch:mainfrom
WenhuaXia:fix/dingtalk-standalone-markdown
Open

fix(dingtalk): standalone fallback uses markdown instead of text / 钉钉 fallback 路径改为 Markdown 渲染#53163
WenhuaXia wants to merge 1 commit into
NousResearch:mainfrom
WenhuaXia:fix/dingtalk-standalone-markdown

Conversation

@WenhuaXia

Copy link
Copy Markdown

What / 改动

Cron delivery falls back to standalone _standalone_send() when the live adapter session_webhook is invalid. The fallback was using msgtype: "text", causing Markdown tables to render as plain pipe characters in DingTalk.

Fix / 修复

Align standalone fallback with live adapter by using msgtype: "markdown".

Testing / 测试

Manually triggered 雪球日报 cron job, verified DingTalk renders Markdown tables correctly.

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins platform/dingtalk DingTalk adapter P3 Low — cosmetic, nice to have labels Jun 26, 2026
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-standalone-markdown branch from 73a729b to d3c90c9 Compare July 8, 2026 15:36

@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 fixing the standalone DingTalk payload mismatch. The premise is confirmed on current main: plugins/platforms/dingtalk/adapter.py:1556 sends msgtype: text, while the live webhook path uses the Markdown payload at plugins/platforms/dingtalk/adapter.py:906-909.

Problems

  • tests/tools/test_send_message_missing_platforms.py:337 still asserts the old text payload. This PR's changed line will make that existing test fail.

Suggested changes

  • Update the assertion at tests/tools/test_send_message_missing_platforms.py:337 to expect the proposed Markdown payload, including title: "Hermes" and text: "hello dingtalk".

Automated hermes-sweeper review.

Comment thread plugins/platforms/dingtalk/adapter.py Outdated
@@ -1553,7 +1553,7 @@ async def _standalone_send(
async with httpx.AsyncClient(timeout=30.0) as client:
resp = await client.post(
webhook_url,
json={"msgtype": "text", "text": {"content": message}},
json={"msgtype": "markdown", "markdown": {"title": "Hermes", "text": message}},

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.

Please update tests/tools/test_send_message_missing_platforms.py:337 with this Markdown payload. It currently asserts the old msgtype: text structure, so this otherwise-correct change will fail the existing standalone DingTalk success test.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-standalone-markdown branch 3 times, most recently from ba21972 to b8fdd37 Compare July 21, 2026 17:23
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-standalone-markdown branch 2 times, most recently from b307530 to a78d8d3 Compare July 29, 2026 17:46

@GottZ GottZ 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.

This was generated by AI during triage.

Summary

Three PRs address the DingTalk Markdown-rendering problem. #37345 changes the legacy standalone sender and adds text fallback behavior, while the supplied complete Graph-Cache diffs for #51994 and #53163 each replace the standalone adapter's text payload with the corresponding Markdown payload.

Related pull requests

  • #37345 [closed] related — (+29/-5) — broader closed alternative: changes tools/send_message_tool.py to send DingTalk Markdown, truncate messages, and retry with plain text after an API rejection. It remains relevant as a broader implementation reference, although a non-contributor reports that #39510 superseded it.
  • #51994 [closed] duplicate — (+1/-1) — closed precursor: the supplied Graph-Cache diff changes plugins/platforms/dingtalk/adapter.py from a text payload to {"msgtype": "markdown", "markdown": {"title": "Hermes", "text": message}}. It remains relevant because it records the same payload-level correction later proposed by #53163, but it is already closed.
  • #53163 related — (+1/-1) — keep open with a salvage path: the supplied complete Graph-Cache diff directly changes the standalone adapter from the text payload to the Markdown payload, matching the confirmed live-path behavior. Consistent with the contributor's keep_open review, the patch must also update tests/tools/test_send_message_missing_platforms.py:337, which still expects the old text payload.

Duplicates

The supplied complete Graph-Cache diffs show that #51994 and #53163 make the same one-line payload substitution in plugins/platforms/dingtalk/adapter.py; treat closed #51994 as superseded by #53163. #37345 addresses the same rendering cause through a different sender and adds fallback and truncation behavior, so it is overlapping rather than an exact duplicate.

Suggested consolidation

Keep #53163 open with a concrete salvage path: add the test update requested in the contributor's keep_open review so the asserted payload includes title: "Hermes" and text: "hello dingtalk". Leave #51994 closed as the superseded duplicate of #53163; leave #37345 closed because it targets a different sender and its discussion identifies broader successor #39510, while retaining it only as a reference for fallback behavior.

Complex graph

flowchart LR
    classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
    classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
    classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
    classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
    classDef best stroke-width:3px,stroke:#b45309
    classDef target stroke-width:3px,stroke:#4338ca
    subgraph Dup51994 ["PRs duplicating each other"]
        P51994["PR #51994 (closed)"]
        P53163["PR #53163 (open)"]
    end
    class P51994 closed
    class P53163 open
    class P53163 target
    click P51994 "https://github.com/NousResearch/hermes-agent/pull/51994"
    click P53163 "https://github.com/NousResearch/hermes-agent/pull/53163"
Loading

Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label).

Cross-PR triage: Reviewed 3 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 4 kB of PR diffs, 2 kB of issue/PR text, <1 kB of discussion (3 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-standalone-markdown branch 2 times, most recently from 61568b6 to 7c193f8 Compare August 6, 2026 09:48
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-standalone-markdown branch 3 times, most recently from 0b0702f to 5a44dce Compare August 23, 2026 04:55
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-standalone-markdown branch from 5a44dce to 4f123db Compare August 24, 2026 18:40
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-standalone-markdown branch from 4f123db to b7fc9b5 Compare September 1, 2026 09:13
Cron delivery falls back to standalone _standalone_send when live
adapter session_webhook is invalid. The fallback was using msgtype:
text, causing Markdown tables to render as plain pipe characters.

Align standalone path with live adapter by using msgtype: markdown
with title and text fields.
@WenhuaXia
WenhuaXia force-pushed the fix/dingtalk-standalone-markdown branch from b7fc9b5 to 8fbdd54 Compare September 4, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/dingtalk DingTalk adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants