Repository navigation
fix: read the walkthrough leniently and don't guess scores when it fails - #16
Merged
Merged
Conversation
A string where the walkthrough schema wants a list or object (cohorts, highlights, score_reasons) failed the whole walkthrough, marked the review partial and replaced the model's scores with ones derived from the findings, which went to 1 on large changes. Fields are now decoded one by one: a list sent as a JSON string is decoded, a field that still doesn't fit is ignored and logged. When the walkthrough fails or gives no scores, the review has none (scores_note says why) and the previous scores stay in the summary state for the next review to anchor to. Fixes #14 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #14.
What changes
"highlights": "[{...}]") is decoded; a field that still doesn't fit ("cohorts": "all files") is ignored and logged as a warning. The rest of the walkthrough is kept, and the review is no longer marked partial for it.fallbackScores(95 minus a penalty per finding, which hit 1 with 6 majors and 10 minors) is gone. When the walkthrough fails or gives no scores,scoresis left out of the JSON result andscores_notesays why. The summary says "No scores this time: …", the status and labels carry none, and--approve-min-scoretreats it as undecided.Console
scoreswas already optional there, so a review without scores is recorded without them, and the averages aren't dragged down.scores_noteisn't shown in the console yet.Tests
go test ./...passes. Addedwalkthrough_test.go, which covers string fields, JSON-in-string, a failed walkthrough carrying the previous scores, and the summary note. Three tests that expected guessed scores now expect none.🤖 Generated with Claude Code