feat: add loop-times support for copilot#501
Merged
Conversation
There was a problem hiding this comment.
Hey - 我在这里给出了一些高层次的反馈:
- 建议对
loop_times做校验(例如,强制其为正数且非零,或者使用无符号类型),以避免明显无效的循环次数进入核心逻辑。 unreachable!("invalid raid mode must be rejected before stage resolution")依赖于之前的校验永远不退化;你可能希望在这里保留一个更防御性的bail!,这样未来修改导致出现的意料之外的值可以以对用户可见的错误形式暴露,而不是触发 panic。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- Consider validating `loop_times` (e.g., enforcing it is positive and non-zero or using an unsigned type) to avoid passing obviously invalid loop counts through to the core logic.
- The `unreachable!("invalid raid mode must be rejected before stage resolution")` depends on the earlier validation never regressing; you may want to keep a defensive `bail!` here instead so that unexpected values from future changes are surfaced as user-facing errors rather than panics.帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据这些反馈改进之后的评审。
Original comment in English
Hey - I've left some high level feedback:
- Consider validating
loop_times(e.g., enforcing it is positive and non-zero or using an unsigned type) to avoid passing obviously invalid loop counts through to the core logic. - The
unreachable!("invalid raid mode must be rejected before stage resolution")depends on the earlier validation never regressing; you may want to keep a defensivebail!here instead so that unexpected values from future changes are surfaced as user-facing errors rather than panics.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider validating `loop_times` (e.g., enforcing it is positive and non-zero or using an unsigned type) to avoid passing obviously invalid loop counts through to the core logic.
- The `unreachable!("invalid raid mode must be rejected before stage resolution")` depends on the earlier validation never regressing; you may want to keep a defensive `bail!` here instead so that unexpected values from future changes are surfaced as user-facing errors rather than panics.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #501 +/- ##
==========================================
+ Coverage 70.39% 70.44% +0.04%
==========================================
Files 61 61
Lines 5834 5847 +13
Branches 5834 5847 +13
==========================================
+ Hits 4107 4119 +12
- Misses 1411 1412 +1
Partials 316 316 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1396536 to
014dc1a
Compare
014dc1a to
db7b2df
Compare
This was referenced Mar 22, 2026
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.
Fixes #500
Summary
Testing
Summary by Sourcery
为 copilot 运行添加可配置的循环次数(loop-times)支持,并收紧 copilot 预设的 raid 模式校验。
New Features:
loop-timesCLI 选项,并将其传递到任务参数中,支持默认值和通过 CLI 覆盖。Enhancements:
Tests:
Original summary in English
Summary by Sourcery
Add configurable loop-times support to copilot runs and tighten raid mode validation for copilot presets.
New Features:
Enhancements:
Tests: