fix(dingtalk): restore card auto layout - #2423
Open
Iams4kura wants to merge 1 commit into
Open
Conversation
Contributor
|
Thank you for your contribution! ❤️ Before we can merge this pull request, we need you to sign the LangBot Contributor License Agreement (CLA). You keep full copyright of your code — the CLA grants us a license to use and distribute your contribution. Signing takes 10 seconds and covers all repositories in this organization, permanently. 感谢您的贡献!合并前请阅读并签署贡献者许可协议(CLA)。您保留代码的全部版权,签署仅需回复下方指定内容,一次签署对本组织全部仓库永久有效。 I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述 / Overview
Fixes #2361.
DingTalk streaming cards ignored
card_auto_layoutbecausecreate_and_deliver_cardplaced the serializedconfigbesidecardParamMap. DingTalk template variables are read fromcardData.cardParamMap, so the setting never reached the card template.This change merges
card_data_configinto a copy of the parameter map before the existing stringification step. Existing template parameters remain intact, caller-owned data is not mutated, and the request now carriesconfigat the level expected by DingTalk.更改前后对比截图 / Screenshots
This is a request-payload fix with no local UI to screenshot. The regression test captures the before/after payload shape:
cardData.config = "{\"autoLayout\": true}"cardData.cardParamMap.config = "{\"autoLayout\": true}"Regression evidence
uv run --python 3.12 --no-sync pytest tests/unit_tests/platform/test_dingtalk_api.py::test_create_and_deliver_card_places_config_in_card_param_map -qexited1withKeyError: 'config'.0.Verification
uv run --python 3.12 --no-sync pytest tests/unit_tests/platform/test_dingtalk_api.py tests/unit_tests/platform/test_dingtalk_adapter.py -q— 19 passed.bash scripts/test-quick.sh— Ruff passed; 2,764 unit tests and 15 smoke tests passed.uv run --python 3.12 --no-sync pre-commit run --files src/langbot/libs/dingtalk_api/api.py tests/unit_tests/platform/test_dingtalk_api.py --show-diff-on-failure— passed.git diff --cached --check— passed.Scope
检查清单 / Checklist
PR 作者完成 / For PR author
项目维护者完成 / For project maintainer
Additional context
An all-files pre-commit run was also attempted. The repository's current hooks proposed mass-formatting 79 unrelated baseline files, so those unrelated changes were discarded. Both files in this focused patch pass the same configured Ruff hooks.