fix: build_summary_post returns incorrect format for Feishu reply API - #1
Merged
Conversation
The function was returning:
{"title": ..., "content": ...}
But Feishu reply API requires post type to be wrapped in zh_cn:
{"post": {"zh_cn": {"title": ..., "content": ...}}}
This fixes the 'content format of the post type is incorrect' error (code 230001)
when sending summary replies in thread mode.
自动审查结果✅ 已通过自动代码审查。 AI 审查服务暂时不可用,本次 PR 已通过低风险规则审查并允许自动合并。 |
|
已通过自动审查并完成合并,感谢贡献。当前使用了低风险规则兜底审查,因为外部 AI 审查服务暂时不可用。 |
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.
Bug Description\n\nThe "build_summary_post()" function was returning a flat JSON structure:\n\n```json\n{\n "title": "...",\n "content": [...]\n}\n```\n\nBut the Feishu reply API requires the "post" type to be wrapped in a "zh_cn" structure:\n\n```json\n{\n "post": {\n "zh_cn": {\n "title": "...",\n "content": [...]\n }\n }\n}\n```\n\nThis caused error 230001: "content format of the post type is incorrect" when sending summary replies in thread mode.\n\n## Fix\n\nUpdated "build_summary_post()" in "src/openclaw_feishu_cron_kit/renderer.py" to return the correct nested structure.\n\n## Testing\n\n- [x] Verified the new format matches Feishu API requirements\n- [x] Tested locally with example payload\n\n## Related\n\nFixes the summary reply failure when using thread mode with "channel": "post".