fix(feishu): use consistent msg_type across all message chunks - #29472
Closed
nasymonk wants to merge 1 commit into
Closed
fix(feishu): use consistent msg_type across all message chunks#29472nasymonk wants to merge 1 commit into
nasymonk wants to merge 1 commit into
Conversation
Determine msg_type once from the full (pre-chunk) content instead of per-chunk. When a long message is split, the first chunk may lack markdown hints while later chunks contain them, causing the first chunk to be sent as msg_type=text (raw markdown) while the rest are msg_type=post (rendered). Fixes #26841
Collaborator
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.
Summary
msg_typeonce from the full (pre-chunk) content instead of per-chunk_resolve_outbound_msg_type()and_build_chunk_payload()as clean helpers_build_outbound_payload()delegates to the new helpers (backward compatible — still used byedit_message)Problem
When a long message is split by
truncate_message, each chunk independently calls_build_outbound_payload. The first chunk may lack markdown hints (e.g.**bold**,## heading) if the split point falls before the markdown-heavy section. This causes:msg_type=text→ raw**bold**displayed literallymsg_type=post→ renders correctlyFix
Resolve
msg_typeonce from the full formatted text before chunking, then build each chunk's payload using that consistent type.Fixes #29471