Bug: breaking_change_check.go truncation always shows "...and 0 more"
File
internal/agent/breaking_change_check.go lines 92-96
Problem
The truncation logic for breaking change warnings always reports "0 more" breaking changes regardless of how many were actually truncated:
if len(warnings) > 2 {
warnings = warnings[:2] // ← len(warnings) is now 2
warnings = append(warnings, fmt.Sprintf("...and %d more breaking change(s)", len(warnings)-2))
// ^^^^^^^^^^^^^^^^ = 2-2 = 0, ALWAYS
}
Root Cause
warnings = warnings[:2] truncates the slice to length 2 BEFORE computing len(warnings)-2. So the count is always 2-2=0.
Impact
When 3+ exported symbols are modified simultaneously (common in refactoring), the agent sees only 2 warnings and is told there are "0 more" — misleading it into thinking all breaking changes are covered. This causes the agent to miss updating callers of the remaining changed symbols.
Comparison with correct pattern
close_error_check.go (lines 82-86) implements the same truncation correctly:
if len(warnings) > maxCloseErrWarnings {
truncMsg := fmt.Sprintf("... and %d more ignored Close() error warning(s)", len(warnings)-maxCloseErrWarnings)
warnings = warnings[:maxCloseErrWarnings]
warnings = append(warnings, truncMsg)
}
Here the count is computed BEFORE truncation, which is correct.
Fix
if len(warnings) > 2 {
moreCount := len(warnings) - 2 // compute before truncation
warnings = warnings[:2]
warnings = append(warnings, fmt.Sprintf("...and %d more breaking change(s)", moreCount))
}
Severity
Medium — functional but misleading. No crash, but causes the agent to miss breaking changes during refactoring.
Verification
Independently verified by sub-agent with a constructed test case showing 5 warnings produce "...and 0 more" instead of "...and 3 more".
Bug: breaking_change_check.go truncation always shows "...and 0 more"
File
internal/agent/breaking_change_check.golines 92-96Problem
The truncation logic for breaking change warnings always reports "0 more" breaking changes regardless of how many were actually truncated:
Root Cause
warnings = warnings[:2]truncates the slice to length 2 BEFORE computinglen(warnings)-2. So the count is always2-2=0.Impact
When 3+ exported symbols are modified simultaneously (common in refactoring), the agent sees only 2 warnings and is told there are "0 more" — misleading it into thinking all breaking changes are covered. This causes the agent to miss updating callers of the remaining changed symbols.
Comparison with correct pattern
close_error_check.go(lines 82-86) implements the same truncation correctly:Here the count is computed BEFORE truncation, which is correct.
Fix
Severity
Medium — functional but misleading. No crash, but causes the agent to miss breaking changes during refactoring.
Verification
Independently verified by sub-agent with a constructed test case showing 5 warnings produce "...and 0 more" instead of "...and 3 more".