JSON parser fails on unescaped quotes in LLM output #46
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?
Problem
Sonnet (and likely other models) sometimes emit JSON responses with unescaped double quotes inside string values:
This causes
json.Unmarshalto fail withinvalid character '2' after object key:value pair, which makes the entire review fail even though the model produced valid content.Seen in gargoyle CI: sonnet-review on PR #551 (job 3173).
Fix
PR #45 adds a
repairJSONfallback that walks the JSON character-by-character and escapes interior quotes not followed by structural characters.TODO