LLM response body truncated: intermittent JSON parse failure #47
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
review-botintermittently fails to parse the LLM response with"unexpected end of JSON input"even when the response body is complete valid JSON.Evidence
From gargoyle CI run 1736 (job 4559), gpt-review log:
The raw response logged is complete, valid JSON (REQUEST_CHANGES verdict + 6 findings).
json.Unmarshalstill returns "unexpected end of JSON input."This suggests the response body is being partially read before being passed to the JSON parser. The logged bytes (4357) match what the server reported, but the buffer passed to
json.Unmarshalis truncated.Impact
Fix
Audit HTTP response body reading in
review-bot. Likely suspect: buffered reader not fully draining before passing tojson.Unmarshal. Consider:io.ReadAllinstead of buffered readsLinked
gargoyle issue #652