Skip to content

feat: add DingTalk channel connector with Stream-based auto-discovery - #540

Open
joe-lin wants to merge 3 commits into
andrewyng:mainfrom
joe-lin:custom/joe-lin
Open

feat: add DingTalk channel connector with Stream-based auto-discovery#540
joe-lin wants to merge 3 commits into
andrewyng:mainfrom
joe-lin:custom/joe-lin

Conversation

@joe-lin

@joe-lin joe-lin commented Aug 24, 2026

Copy link
Copy Markdown

What does this PR do?

新增钉钉(DingTalk)频道连接器,基于 Stream 模式实现消息订阅与回复,
并特别支持企业群(全员群/部门群)。

Why is it needed?

OpenWorker 此前缺少钉钉渠道。而钉钉「全员群/部门群」默认不显示群号
(conversationId),用户无法手动订阅、@ 机器人无响应。
本 PR 通过 Stream 自动发现群组,绕开群号限制。

Changes

  • coworker/connectors/dingtalk.py:钉钉 Stream 连接器(+650)
  • tests/test_dingtalk.pytests/test_mention_router.py:单元测试(+831)
  • coworker/{engine,server/*}.py:引擎与服务层集成
  • coworker/connectors/*.py:连接器框架扩展点
  • surfaces/gui/src/components/*.tsxconnectors/registry.tsx:前端 UI 适配

How to test

  1. 配置钉钉应用 AppKey/AppSecret
  2. 创建钉钉群(含全员群),加入 OpenWorker 机器人
  3. 群里 @ 机器人 → 验证自动订阅 + 收到回复
  4. pytest tests/test_dingtalk.py tests/test_mention_router.py

Checklist

  • 本地实测通过(钉钉全员群可正常回复)
  • 添加单元测试(831 行)
  • 遵循项目代码风格
  • 更新文档(如需要)

Previously the authorization prompt for DingTalk send commands only rendered on desktop clients, blocking mobile users from granting permission on mobile. This decouples the auth flow from client type in the routing/manager layer so authorization works on mobile too. Adds tests covering the mobile authorization path.
@joe-lin

joe-lin commented Aug 25, 2026

Copy link
Copy Markdown
Author

Update: 发现并修复了一个相关问题——钉钉发送命令的授权提示此前只在桌面端渲染,
手机端用户无法完成授权。

已在本 PR 中一并修复(见最新 commit fix: allow DingTalk command authorization on mobile clients):
将授权流程与客户端类型解耦(routing/manager 层),移动端现在也可正常授权。
补充了移动端授权路径的测试(test_mention_router.py +161)。

本地已在手机端实测通过。

Upstream internationalized the channel picker placeholder after this branch was created. This PR does not modify that file, so accepted the upstream i18n version to resolve the conflict.
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.

1 participant