Repository navigation
fix(cli): count zero-count recommendations removed by --max-instances or --min-count as dropped - #2285
Merged
Conversation
…tances report reportInstanceLimit decided "removed" by comparing the kept count with the original count, so a zero-Count entry past the end of the cap result looked unchanged and was skipped. dropTruncatedBelowMinCount still counted it as a floor drop, so dropped-belowMinCount went negative and DropSummary.Add panicked. Decide removal by position (the result is a prefix of the input) and panic with context if the floor count ever exceeds the removed count. Closes #1742 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 48 minutes for your next included review. View limit details
Comment |
Member
Author
Merge gate verdict (claude-cc-libs)Every gate holds at head 4302f8f:
CodeRabbit is waived as a merge gate under the 2026-10-19 decision. Squash-merging. |
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.
Closes #1742
The go library's
DropSummary.Addnow panics on a negative count (go#518, already in the cli's pin). The cli could feed it one: inreportInstanceLimit(cmd/multi_service.go) a zero-Count recommendation removed by the--min-countfloor was treated as unchanged (kept == rec.Count, with kept 0).dropTruncatedBelowMinCountdid count it as a floor drop, sodropped - belowMinCountwent negative at :519 and panicked. Example: counts [4, 0, 6], cap 7, floor 4 gives -1. A zero-Count entry the cap removed was also never reported as a--max-instancesdrop.reportInstanceLimitnow decides removal by position. The cap result is a prefix of its input, so every entry pastlen(after)is counted and named as dropped, whatever its Count.DropSummary.Addcalls in cmd/ pass lengths or non-negative counts.Tests (
multi_service_drop_attribution_test.go): the end-to-end panic case, the zero-Count budget drop, and the impossible state. All three fail on main (two panic withnegative count -1/-2).🤖 Generated with Claude Code