Skip to content

fix(dingtalk): remove stale card_template_id config entries after adapter refactor (#4590/#4986 context)#5701

Open
wyeeeee wants to merge 2 commits intoAstrBotDevs:masterfrom
wyeeeee:fix/remove-dingtalk-card-template-config
Open

fix(dingtalk): remove stale card_template_id config entries after adapter refactor (#4590/#4986 context)#5701
wyeeeee wants to merge 2 commits intoAstrBotDevs:masterfrom
wyeeeee:fix/remove-dingtalk-card-template-config

Conversation

@wyeeeee
Copy link

@wyeeeee wyeeeee commented Mar 3, 2026

Motivation / 动机

在项目历史上,#4590 曾为钉钉引入过基于 card_template_id 的互动卡片流式回复能力;但在后续 #4986 的钉钉适配器重构中,为适配主动消息推送与多媒体发送,项目已弃用原回复方案,也无法继续适配互动卡片流式回复能力,因此card_template_id 未继续被运行时使用,保留字段会引起用户误解。

This PR removes the stale DingTalk card_template_id configuration entries so that config templates/UI stay consistent with the current runtime behavior after the adapter refactor.

Modifications / 改动点

  • 删除钉钉默认配置模板中的 card_template_id

    • astrbot/core/config/default.py
  • 删除后端配置元数据中的 card_template_id

    • astrbot/core/config/default.py
  • 删除 Dashboard 配置元数据中的 card_template_id

    • dashboard/src/i18n/locales/zh-CN/features/config-metadata.json
    • dashboard/src/i18n/locales/en-US/features/config-metadata.json
  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

Verification Steps:

  1. 静态检查:
uvx ruff check astrbot/core/config/default.py

Result:

  • All checks passed!
  1. 配置项移除验证:
rg -n "card_template_id" astrbot dashboard -S

Result:

  • 无匹配结果。
  1. 本地手动验证:
  • 项目可正常启动与使用。

Checklist / 检查清单

  • 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
  • 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

移除已弃用的 DingTalk card_template_id 配置,以使可用设置与当前适配器行为保持一致。

增强内容:

  • 从 DingTalk 默认配置模板中移除未使用的 card_template_id 字段。
  • 从后端和 Dashboard 配置元数据中删除 card_template_id 元数据,使其不再出现在 UI 中。
Original summary in English

Summary by Sourcery

Remove deprecated DingTalk card_template_id configuration to align available settings with current adapter behavior.

Enhancements:

  • Remove unused card_template_id field from DingTalk default configuration template.
  • Drop card_template_id metadata from backend and Dashboard config metadata so it no longer appears in the UI.

@auto-assign auto-assign bot requested review from Raven95676 and anka-afk March 3, 2026 07:29
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 3, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

嘿,我已经审查了你的更改,一切看起来都很棒!


Sourcery 对开源项目是免费的——如果你觉得我们的代码审查有帮助,欢迎分享给更多人 ✨
帮我变得更有用吧!请在每条评论上点 👍 或 👎,我会根据你的反馈改进之后的代码审查。
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dosubot
Copy link

dosubot bot commented Mar 3, 2026

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@dosubot dosubot bot added area:core The bug / feature is about astrbot's core, backend area:webui The bug / feature is about webui(dashboard) of astrbot. labels Mar 3, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此 PR 旨在移除钉钉适配器中已废弃的 card_template_id 配置项。由于先前的适配器重构,该字段已不再被运行时使用,保留它可能会导致用户混淆。通过删除这些过时的配置条目,本 PR 确保了配置模板和用户界面与当前的运行时行为保持一致,提升了用户体验和配置的清晰度。

Highlights

  • 移除钉钉配置模板中的 card_template_id: 从 astrbot/core/config/default.py 中删除了钉钉默认配置模板中的 card_template_id 字段。
  • 移除后端配置元数据中的 card_template_id: 从 astrbot/core/config/default.py 中删除了后端配置元数据中关于 card_template_id 的定义。
  • 移除 Dashboard 配置元数据中的 card_template_id: 从 dashboard/src/i18n/locales/zh-CN/features/config-metadata.jsondashboard/src/i18n/locales/en-US/features/config-metadata.json 中删除了 card_template_id 的 Dashboard 配置元数据,使其不再显示在 UI 中。
Changelog
  • astrbot/core/config/default.py
    • 移除了钉钉配置模板中不再使用的 card_template_id 字段。
    • 删除了后端配置元数据中关于 card_template_id 的定义。
  • dashboard/src/i18n/locales/en-US/features/config-metadata.json
    • 删除了 card_template_id 的英文版 Dashboard 配置元数据。
  • dashboard/src/i18n/locales/zh-CN/features/config-metadata.json
    • 删除了 card_template_id 的中文版 Dashboard 配置元数据。
Activity
  • 已通过静态检查,所有检查均通过。
  • 已验证配置项移除成功,未发现 card_template_id 的匹配结果。
  • 已进行本地手动验证,项目可正常启动和使用。
  • PR 检查清单中的所有项均已完成。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

本次 PR 旨在移除已废弃的钉钉 card_template_id 配置项,以保持配置与运行时行为的一致性。您已经从默认配置、后端元数据以及 Dashboard 的国际化文件中正确地移除了所有相关的 card_template_id 条目。代码变更清晰、正确,符合预期。我没有发现任何问题,感谢您的贡献。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core The bug / feature is about astrbot's core, backend area:webui The bug / feature is about webui(dashboard) of astrbot. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant