feat(larklang): 自动删除文本结尾的空行 - #1352
Merged
Merged
Conversation
…tream Imports `ActionFailed` and moves token consumption to after a successful send, so a failed delivery no longer burns tokens or increments the consecutive-message counter. When the QQ adapter returns error code 40034005 (expired `reply_message_id`), the message is resent without its reply reference and a warning is appended via the new `message.reply_skipped` translation key, making the skipped reply visible to users instead of silently dropping the whole send.
…ning Refine the `MessageQueueItem` type to include an extra string field and mark `mq_text` as optional via `NotRequired` in `CachedMessage`. Remove the `reply_skipped` translation and its append logic in the processor since reply references are no longer skipped; this simplifies the message dispatch flow and aligns type annotations with actual usage.
get_text() 返回的文本现在会清理结尾的空行(含仅含空白字符的行), 避免 YAML 块标量(如 |)保留的换行符导致消息末尾出现多余空行。 不影响文本中间内容。 新增 remove_trailing_blank_lines 辅助函数及对应单元测试。
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
xxtg666
approved these changes
Aug 15, 2026
….com/Moonlark-Dev/Moonlark into merge-pr-1352 # Conflicts: # COMMANDS.md # poetry.lock
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.
改动内容
在 larklang 的
get_text()返回文本时,自动清理结尾的空行(包括仅含空白字符的行),避免 YAML 块标量(如|)保留的换行符导致消息末尾出现多余空行。实现方式
remove_trailing_blank_lines():用splitlines()拆行后从末尾弹出空行再重新拼接get_text()的 format 成功/失败两条返回路径上都应用清理[缺失: ...]兜底文案测试
新增
tests/test_larklang_trailing_blank_lines.py,覆盖:pytest tests/test_larklang_trailing_blank_lines.py通过 ✅