chore: update changelog for version 1.0.8 and enhance calendar sending error handling - #17
Merged
Conversation
Contributor
审阅者指南将多个 LLM 工具中的日历发送逻辑重构为一个共享的非致命(non-fatal)助手方法:发送失败时记录投递警告,而不是让主工具流程失败,并将变更记录和插件版本更新到 1.0.8。 带投递警告的非致命日历发送时序图sequenceDiagram
actor User
participant DeerPipePlugin
participant AstrMessageEvent
participant MessagingPlatform
User->>DeerPipePlugin: invoke tool_deer_self / tool_deer_other / tool_retro_deer / tool_get_user_deer_data
DeerPipePlugin->>DeerPipePlugin: service.render_calendar(...)
loop each_calendar_page
DeerPipePlugin->>DeerPipePlugin: _send_calendar_non_fatal(event, cal_result, is_text, result, tool_name)
alt is_text is true
DeerPipePlugin->>AstrMessageEvent: send(plain_result(cal_result))
else is_text is false
DeerPipePlugin->>AstrMessageEvent: send(image_result(cal_result))
end
alt send succeeds
AstrMessageEvent-->>DeerPipePlugin: ack delivered
else send raises ack timeout (retcode=1200 or timeout)
AstrMessageEvent-->>DeerPipePlugin: Exception exc
DeerPipePlugin->>DeerPipePlugin: _is_send_ack_timeout(exc) == true
DeerPipePlugin->>DeerPipePlugin: _append_delivery_warning(result, SEND_ACK_TIMEOUT_MAY_DELIVERED, exc)
DeerPipePlugin-->>DeerPipePlugin: continue main tool flow
else send raises other Exception
AstrMessageEvent-->>DeerPipePlugin: Exception exc
DeerPipePlugin->>DeerPipePlugin: _is_send_ack_timeout(exc) == false
DeerPipePlugin->>DeerPipePlugin: _append_delivery_warning(result, CALENDAR_SEND_FAILED, exc)
DeerPipePlugin-->>DeerPipePlugin: continue main tool flow
end
end
DeerPipePlugin-->>User: JSON result (includes delivery_warning and delivery_error when present)
DeerPipePlugin 日历发送辅助方法类图classDiagram
class DeerPipePlugin {
+tool_deer_self(event AstrMessageEvent) str
+tool_deer_other(event AstrMessageEvent) str
+tool_retro_deer(event AstrMessageEvent) str
+tool_get_user_deer_data(event AstrMessageEvent) str
-_append_delivery_warning(result dict, warning_code str, exc Exception) void
-_is_send_ack_timeout(exc Exception) bool
-_send_calendar_non_fatal(event AstrMessageEvent, cal_result str, is_text bool, result dict, tool_name str) void
}
class AstrMessageEvent {
+plain_result(content str) str
+image_result(content str) str
+send(payload str) void
}
DeerPipePlugin --> AstrMessageEvent : uses
class ToolResult {
+delivery_warning str
+delivery_error str
}
DeerPipePlugin --> ToolResult : populates
文件级变更
技巧与命令与 Sourcery 交互
自定义你的体验访问你的 dashboard 以:
获取帮助Original review guide in EnglishReviewer's GuideRefactors calendar sending in multiple LLM tools into a shared non-fatal helper that records delivery warnings instead of failing the main tool flow, while updating the changelog and plugin version to 1.0.8. Sequence diagram for non-fatal calendar sending with delivery warningssequenceDiagram
actor User
participant DeerPipePlugin
participant AstrMessageEvent
participant MessagingPlatform
User->>DeerPipePlugin: invoke tool_deer_self / tool_deer_other / tool_retro_deer / tool_get_user_deer_data
DeerPipePlugin->>DeerPipePlugin: service.render_calendar(...)
loop each_calendar_page
DeerPipePlugin->>DeerPipePlugin: _send_calendar_non_fatal(event, cal_result, is_text, result, tool_name)
alt is_text is true
DeerPipePlugin->>AstrMessageEvent: send(plain_result(cal_result))
else is_text is false
DeerPipePlugin->>AstrMessageEvent: send(image_result(cal_result))
end
alt send succeeds
AstrMessageEvent-->>DeerPipePlugin: ack delivered
else send raises ack timeout (retcode=1200 or timeout)
AstrMessageEvent-->>DeerPipePlugin: Exception exc
DeerPipePlugin->>DeerPipePlugin: _is_send_ack_timeout(exc) == true
DeerPipePlugin->>DeerPipePlugin: _append_delivery_warning(result, SEND_ACK_TIMEOUT_MAY_DELIVERED, exc)
DeerPipePlugin-->>DeerPipePlugin: continue main tool flow
else send raises other Exception
AstrMessageEvent-->>DeerPipePlugin: Exception exc
DeerPipePlugin->>DeerPipePlugin: _is_send_ack_timeout(exc) == false
DeerPipePlugin->>DeerPipePlugin: _append_delivery_warning(result, CALENDAR_SEND_FAILED, exc)
DeerPipePlugin-->>DeerPipePlugin: continue main tool flow
end
end
DeerPipePlugin-->>User: JSON result (includes delivery_warning and delivery_error when present)
Class diagram for DeerPipePlugin calendar sending helpersclassDiagram
class DeerPipePlugin {
+tool_deer_self(event AstrMessageEvent) str
+tool_deer_other(event AstrMessageEvent) str
+tool_retro_deer(event AstrMessageEvent) str
+tool_get_user_deer_data(event AstrMessageEvent) str
-_append_delivery_warning(result dict, warning_code str, exc Exception) void
-_is_send_ack_timeout(exc Exception) bool
-_send_calendar_non_fatal(event AstrMessageEvent, cal_result str, is_text bool, result dict, tool_name str) void
}
class AstrMessageEvent {
+plain_result(content str) str
+image_result(content str) str
+send(payload str) void
}
DeerPipePlugin --> AstrMessageEvent : uses
class ToolResult {
+delivery_warning str
+delivery_error str
}
DeerPipePlugin --> ToolResult : populates
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些整体层面的反馈:
- 在
_is_send_ack_timeout中,通过匹配通用子串"timeout"可能会把无关错误误判为超时错误;建议收紧匹配条件(例如使用更具体的异常类型或更精确的错误信息模式),以减少误报。 - 当在一次工具调用中发送多条日历消息时,
_append_delivery_warning会反复覆盖delivery_warning/delivery_error;如果你需要关心所有失败情况,建议将它们聚合起来(例如放入列表)或者只记录第一个失败。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- In `_is_send_ack_timeout`, matching on the generic substring `"timeout"` could misclassify unrelated errors; consider tightening the condition (e.g., specific exception types or more precise message patterns) to avoid false positives.
- When multiple calendar messages are sent in a single tool call, `_append_delivery_warning` will repeatedly overwrite `delivery_warning`/`delivery_error`; if you care about all failures, consider aggregating them (e.g., into a list) or only recording the first one.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进后续的评审。
Original comment in English
Hey - I've left some high level feedback:
- In
_is_send_ack_timeout, matching on the generic substring"timeout"could misclassify unrelated errors; consider tightening the condition (e.g., specific exception types or more precise message patterns) to avoid false positives. - When multiple calendar messages are sent in a single tool call,
_append_delivery_warningwill repeatedly overwritedelivery_warning/delivery_error; if you care about all failures, consider aggregating them (e.g., into a list) or only recording the first one.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `_is_send_ack_timeout`, matching on the generic substring `"timeout"` could misclassify unrelated errors; consider tightening the condition (e.g., specific exception types or more precise message patterns) to avoid false positives.
- When multiple calendar messages are sent in a single tool call, `_append_delivery_warning` will repeatedly overwrite `delivery_warning`/`delivery_error`; if you care about all failures, consider aggregating them (e.g., into a list) or only recording the first one.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
for more information, see https://pre-commit.ci
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 by Sourcery
提高日历发送的健壮性,并更新 1.0.8 版本的发布元数据。
错误修复(Bug Fixes):
功能增强(Enhancements):
构建(Build):
文档(Documentation):
Original summary in English
Summary by Sourcery
Improve calendar delivery robustness and update release metadata for version 1.0.8.
Bug Fixes:
Enhancements:
Build:
Documentation: