fix: remove suggestion blocks from inline comments#33
Merged
Conversation
… fix as plain markdown GitHub suggestion blocks (suggestion) mean code replacement, but LLM suggested_fix values are natural language advice, not verbatim code. Rendering them as suggestion blocks caused the entire comment body to appear as a proposed code change in the Files Changed UI.
Comment on lines
424
to
429
| return diffs[path] | ||
| } | ||
|
|
||
| // buildInlineCommentBody renders the markdown for a group of findings on the | ||
| // same file:line. Includes a logo header, severity badge, suggestion block | ||
| // (when SuggestedFix is single-line), and an ignore hint. | ||
| func buildInlineCommentBody(findings []verdict.Finding) string { | ||
| var body strings.Builder | ||
| body.WriteString(acigMarker) |
There was a problem hiding this comment.
[🟡 medium] Missing tests for GitHubReporter.Report error handling when GitHub API returns 403 · adjudicator
The new 403 error handling branch in GitHubReporter.Report (lines 424-429) is not exercised by any test. Add a test that simulates a 403 response and verifies the expected behavior.
Suggested change
| return diffs[path] | |
| } | |
| // buildInlineCommentBody renders the markdown for a group of findings on the | |
| // same file:line. Includes a logo header, severity badge, suggestion block | |
| // (when SuggestedFix is single-line), and an ignore hint. | |
| func buildInlineCommentBody(findings []verdict.Finding) string { | |
| var body strings.Builder | |
| body.WriteString(acigMarker) | |
| Add a test case in internal/reporters/github_test.go that mocks a 403 Forbidden response from the GitHub API and asserts the correct error handling logic is triggered. |
To suppress: add # acig-ignore: adjudicator near this line.
WARN · risk=high · 2 finding(s) · $0.0002🟡 medium ×1 · ℹ️ info ×1
Findings outside the diffThese findings were produced by critics but couldn't be anchored to a line in this PR's diff (e.g. references to deleted files or lines outside any hunk).
Validation notes
Verdict JSON{"schema_version":"1","repo":"https://github.com/helloodokai/acig","sha":"df58f429d884e4d357c5e50c3d9f6515b4921e8f","base_sha":"main","risk":"high","decision":"warn","summary":"Decision: warn | Risk: high | Findings: 0 blocking, 0 high, 1 medium, 0 low, 1 info | Cost: $0.0002","findings":[{"critic":"test_coverage_smell","severity":"info","title":"Failed to parse critic output","detail":"Model returned invalid JSON (531 bytes). This usually means the output was truncated. Raw: {\"findings\":[{\"severity\":\"medium\",\"title\":\"Missing tests for GitHubReporter.Report error handling when GitHub API returns 403\",\"detail\":\"The new 403 error handling branch in GitHubReporter.Report (lines 424-429) is not exercised by any test. Add a test that simulates a 403 response and verifies the ..."},{"critic":"adjudicator","severity":"medium","title":"Missing tests for GitHubReporter.Report error handling when GitHub API returns 403","detail":"The new 403 error handling branch in GitHubReporter.Report (lines 424-429) is not exercised by any test. Add a test that simulates a 403 response and verifies the expected behavior.","file":"internal/reporters/github.go","line_start":424,"line_end":429,"suggested_fix":"Add a test case in internal/reporters/github_test.go that mocks a 403 Forbidden response from the GitHub API and asserts the correct error handling logic is triggered."}],"critic_results":[{"critic":"style_conformance","model":"gpt-oss:20b","findings":null,"cost_usd":0.00001787,"duration_ms":2521,"tokens_in":956,"tokens_out":277},{"critic":"risk_classifier","model":"gpt-oss:20b","findings":null,"cost_usd":0.0000213,"duration_ms":3180,"tokens_in":564,"tokens_out":522,"reasoning":"Modified GitHub reporter adds new network calls, creating a new I/O surface.","risk":"high"},{"critic":"test_coverage_smell","model":"gpt-oss:20b","findings":[{"critic":"test_coverage_smell","severity":"info","title":"Failed to parse critic output","detail":"Model returned invalid JSON (531 bytes). This usually means the output was truncated. Raw: {\"findings\":[{\"severity\":\"medium\",\"title\":\"Missing tests for GitHubReporter.Report error handling when GitHub API returns 403\",\"detail\":\"The new 403 error handling branch in GitHubReporter.Report (lines 424-429) is not exercised by any test. Add a test that simulates a 403 response and verifies the ..."}],"cost_usd":0.00007083,"duration_ms":10076,"tokens_in":939,"tokens_out":2048,"notes":["JSON parse failed; raw response truncated"]},{"critic":"perf_smell","model":"qwen3-coder:480b","findings":null,"cost_usd":0.00006024,"duration_ms":30029,"tokens_in":965,"tokens_out":13},{"critic":"security_smell","model":"qwen3-coder:480b","findings":null,"cost_usd":0.00007301999999999999,"duration_ms":30843,"tokens_in":1178,"tokens_out":13},{"critic":"adjudicator","model":"glm-5.1","findings":[{"critic":"adjudicator","severity":"medium","title":"Missing tests for GitHubReporter.Report error handling when GitHub API returns 403","detail":"The new 403 error handling branch in GitHubReporter.Report (lines 424-429) is not exercised by any test. Add a test that simulates a 403 response and verifies the expected behavior.","file":"internal/reporters/github.go","line_start":424,"line_end":429,"suggested_fix":"Add a test case in internal/reporters/github_test.go that mocks a 403 Forbidden response from the GitHub API and asserts the correct error handling logic is triggered."}],"cost_usd":0,"duration_ms":104285,"tokens_in":1412,"tokens_out":1235}],"total_cost_usd":0.00024325999999999997,"total_duration_ms":180934,"budget_remaining_usd":0.24975674,"generated_at":"2026-05-11T18:02:19.085471494Z"} |
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.
Summary
GitHub's
```suggestionblock means "replace this line of code with this exact content." The LLMsuggested_fixvalues are natural language advice (e.g., "Use parameterized queries"), not verbatim code replacements — so rendering them as suggestion blocks caused the entire comment to appear as a proposed code change in "Files Changed."Fix
isSingleLineSuggestion()and the```suggestionblock renderingSuggestedFixas a blockquote:> **Suggested fix:** ...SuggestedFixthe same way (no more single-line vs multi-line branching)Testing
go build ./...— cleango vet ./...— cleango test ./...— all pass