fix(dingtalk): standalone fallback uses markdown instead of text / 钉钉 fallback 路径改为 Markdown 渲染 - #53163
Conversation
73a729b to
d3c90c9
Compare
teknium1
left a comment
There was a problem hiding this comment.
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:337still 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:337to expect the proposed Markdown payload, includingtitle: "Hermes"andtext: "hello dingtalk".
Automated hermes-sweeper review.
| @@ -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}}, | |||
There was a problem hiding this comment.
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.
ba21972 to
b8fdd37
Compare
b307530 to
a78d8d3
Compare
GottZ
left a comment
There was a problem hiding this comment.
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: changestools/send_message_tool.pyto 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 changesplugins/platforms/dingtalk/adapter.pyfrom 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'skeep_openreview, the patch must also updatetests/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"
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.
61568b6 to
7c193f8
Compare
0b0702f to
5a44dce
Compare
5a44dce to
4f123db
Compare
4f123db to
b7fc9b5
Compare
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.
b7fc9b5 to
8fbdd54
Compare
What / 改动
Cron delivery falls back to standalone
_standalone_send()when the live adaptersession_webhookis invalid. The fallback was usingmsgtype: "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.