Fix/line number validation#31
Open
supasympa wants to merge 14 commits into
Open
Conversation
Prevent 422 'Path could not be resolved' errors when creating review comments on files that don't exist in the PR's diff (e.g., deleted files). - Add ListPRFiles() to fetch PR's changed files - Filter buildReviewComments() to only include files present in PR diff - Add tests for groupFindings and buildReviewComments
- TestReport_RetryWithoutCommentsOnPositionError: verifies retry logic - TestReport_FallsBackToStickyCommentWhenBothReviewAttemptsFail - TestReport_SuccessfulReviewOnFirstTry - TestReport_UsesPRFilesFilter Also converts GitHubReporter.client to use interface for testability.
- Add GetPRFileDiffs() to fetch file diffs with line counts - Add validateLine() to cap line numbers to actual changed lines - buildReviewComments now validates line numbers against actual diff - Skip comments for invalid/outsized line numbers instead of failing This should fix 'Line could not be resolved' errors when AI reports line numbers beyond the actual changes in the diff.
There was a problem hiding this comment.
acig: pass | risk=low | 0 finding(s) | $0.0007
| Severity | Critic | Title | File |
|---|
Verdict JSON
{"schema_version":"1","repo":"https://github.com/helloodokai/acig","sha":"41fe47113336938ffd735072c7057cbf25369648","base_sha":"main","risk":"low","decision":"pass","summary":"Decision: pass | Risk: low | Findings: 0 blocking, 0 high, 0 medium, 0 low, 0 info | Cost: $0.0007","findings":[],"critic_results":[{"critic":"perf_smell","model":"qwen3-coder:480b","findings":[],"cost_usd":0.00019878,"duration_ms":1365,"tokens_in":3274,"tokens_out":13},{"critic":"security_smell","model":"qwen3-coder:480b","findings":[],"cost_usd":0.00020082000000000002,"duration_ms":3329,"tokens_in":3308,"tokens_out":13},{"critic":"risk_classifier","model":"gpt-oss:20b","findings":null,"cost_usd":0.00009397,"duration_ms":16022,"tokens_in":3253,"tokens_out":2048},{"critic":"test_coverage_smell","model":"gpt-oss:20b","findings":null,"cost_usd":0.00009366999999999999,"duration_ms":16118,"tokens_in":3223,"tokens_out":2048},{"critic":"style_conformance","model":"gpt-oss:20b","findings":null,"cost_usd":0.00009353,"duration_ms":16450,"tokens_in":3209,"tokens_out":2048}],"total_cost_usd":0.00068077,"total_duration_ms":53284,"budget_remaining_usd":0.24931923,"generated_at":"2026-05-08T00:09:30.076574888Z"}
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.
No description provided.