Conversation
0c2b231 to
3123565
Compare
When the analyzer LLM returns truncated JSON, parseAnalysisResponse was catching the error, printing to stderr where nobody reads it, and returning a zeroed-out result. Every caller then printed "Analysis complete" with a green checkmark. And then every load site that read the result back from disk would render all-zero scores as if the model genuinely scored zero on everything. Added a parseFailed flag to AnalysisResult so callers can distinguish "the model scored you low" from "we couldn't even read the response." All three analysis call sites now show a warning with retry instructions. Added a shared loadAnalysisResult helper that returns null for parseFailed results — all five disk load sites (results list, compare, challenge view, report, interactive browser) now use it instead of inline JSON.parse. Failed analyses show as "-" in tables and are excluded from reports, same as if no analysis was run. Closes #56
3123565 to
1fdeac2
Compare
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.
When the analyzer LLM returns truncated or malformed JSON,
parseAnalysisResponsewas catching theSyntaxError, logging to stderr, and returning a zeroed-outAnalysisResult. All three callers — interactive run-flow, CLI run command, and analyze command — then unconditionally printed "Analysis complete" with a green checkmark. The user sees all-zero scores and has no idea the analysis actually failed.This adds a
parseFailedflag toAnalysisResult. When the JSON parse fails, the flag is set. All three callers now check it and show a yellow warning with retry instructions instead of a green success message.Observed in the wild: Gemini 3 Pro on substring-bypass hit its output token limit, truncating the JSON response at position 3526.
Closes #56