Skip to content

chore: update changelog for version 1.0.8 and enhance calendar sending error handling - #17

Merged
FlanChanXwO merged 2 commits into
masterfrom
v1.0.8
Apr 17, 2026
Merged

chore: update changelog for version 1.0.8 and enhance calendar sending error handling#17
FlanChanXwO merged 2 commits into
masterfrom
v1.0.8

Conversation

@FlanChanXwO

@FlanChanXwO FlanChanXwO commented Apr 17, 2026

Copy link
Copy Markdown
Member

Summary by Sourcery

提高日历发送的健壮性,并更新 1.0.8 版本的发布元数据。

错误修复(Bug Fixes):

  • 使 LLM 工具中的日历消息发送变为非致命操作,这样发送问题不会将原本成功的业务逻辑变为失败。
  • 将发送确认(send-ack)超时场景(例如 retcode=1200/timeout)视作潜在的成功发送,同时降低日志级别,并在工具结果中加入明确的发送警告。

功能增强(Enhancements):

  • 在工具结果中新增结构化的发送警告字段,以提高对日历发送问题的可观测性。

构建(Build):

  • 将插件元数据版本从 v1.0.7 升级为 v1.0.8。

文档(Documentation):

  • 更新变更日志,加入 1.0.8 版本说明,包括日历发送行为以及超时处理方式的变更。
Original summary in English

Summary by Sourcery

Improve calendar delivery robustness and update release metadata for version 1.0.8.

Bug Fixes:

  • Make calendar message sending in LLM tools non-fatal so delivery issues do not flip successful business logic to failures.
  • Handle send-ack timeout scenarios (e.g., retcode=1200/timeout) as potential successful deliveries with downgraded logging and explicit delivery warnings in tool results.

Enhancements:

  • Add structured delivery warning fields to tool results to improve observability of calendar sending issues.

Build:

  • Bump plugin metadata version from v1.0.7 to v1.0.8.

Documentation:

  • Update changelog with notes for version 1.0.8, including calendar sending behavior and timeout handling changes.

@sourcery-ai

sourcery-ai Bot commented Apr 17, 2026

Copy link
Copy Markdown
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)
Loading

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
Loading

文件级变更

Change Details Files
将多个 LLM 工具的日历消息发送逻辑改为非致命且集中处理,并添加结构化投递警告以提升可观测性。
  • 引入辅助方法,将投递警告和错误详情追加到工具结果的 payload 中。
  • 引入辅助方法,根据异常信息内容("retcode=1200" 或 "timeout")检测 ACK 超时错误。
  • 添加共享的异步辅助方法:以文本或图片形式发送日历消息;在失败时适当记录日志,并将 delivery_warning / delivery_error 写入 result,而不是抛出异常。
  • 更新 deer_self、deer_other、retro_deer 和 get_user_deer_data 工具,使用新的非致命发送辅助方法替代内联的发送逻辑。
main.py
更新版本 1.0.8 的发布元数据和文档。
  • 在 changelog 中新增 1.0.8 小节,描述非致命日历发送行为以及 ACK 超时处理。
  • 将插件版本从 v1.0.7 提升到 v1.0.8(写入元数据)。
CHANGELOG.md
metadata.yaml

技巧与命令

与 Sourcery 交互

  • 触发新审阅: 在 pull request 上评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 从审阅评论生成 GitHub issue: 在某条审阅评论下回复,要求 Sourcery 从该评论创建一个 issue。你也可以直接回复该评论 @sourcery-ai issue 来从中创建 issue。
  • 生成 pull request 标题: 在 pull request 标题中任意位置写入 @sourcery-ai,即可随时生成标题。也可以在 pull request 中评论 @sourcery-ai title 以(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 内容中任意位置写入 @sourcery-ai summary,即可在该位置生成 PR 摘要。也可以在 pull request 中评论 @sourcery-ai summary 以在任意时间(重新)生成摘要。
  • 生成审阅者指南: 在 pull request 中评论 @sourcery-ai guide,即可在任意时间(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,即可一次性标记所有 Sourcery 评论为已解决。如果你已经处理完所有评论且不想再看到它们,这会很有用。
  • 忽略所有 Sourcery 审阅: 在 pull request 中评论 @sourcery-ai dismiss,即可忽略所有已有的 Sourcery 审阅。特别适用于你想从一个全新的审阅开始——别忘了再评论 @sourcery-ai review 来触发新的审阅!

自定义你的体验

访问你的 dashboard 以:

  • 启用或停用审阅功能,例如 Sourcery 生成的 pull request 摘要、审阅者指南等。
  • 修改审阅语言。
  • 添加、移除或编辑自定义审阅指令。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Refactors 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 warnings

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)
Loading

Class diagram for DeerPipePlugin calendar sending helpers

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
Loading

File-Level Changes

Change Details Files
Make calendar message sending non-fatal and centralized for multiple LLM tools, adding structured delivery warnings for observability.
  • Introduce helper to append delivery warning and error details into the tool result payload.
  • Introduce helper to detect ACK timeout errors based on exception message content ("retcode=1200" or "timeout").
  • Add shared async helper that sends calendar messages as text or image and on failure logs appropriately and writes delivery_warning / delivery_error into result instead of raising.
  • Update deer_self, deer_other, retro_deer, and get_user_deer_data tools to use the new non-fatal send helper instead of inlined send logic.
main.py
Update release metadata and documentation for version 1.0.8.
  • Add 1.0.8 section to changelog describing non-fatal calendar send behavior and ACK timeout handling.
  • Bump plugin version from v1.0.7 to v1.0.8 in metadata.
CHANGELOG.md
metadata.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进后续的评审。
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_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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@FlanChanXwO
FlanChanXwO merged commit 58df6a5 into master Apr 17, 2026
2 checks passed
@FlanChanXwO
FlanChanXwO deleted the v1.0.8 branch April 17, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant