fix: add retry logic for malformed LLM JSON responses#29
Merged
Conversation
Fixes #28 - LLM occasionally returns malformed JSON for short strings. Changes: - Add retry logic (up to 2 retries) when JSON parsing fails - Improve system prompt to be stricter about JSON-only output - Add tests for retry behavior
Owner
Author
Code reviewFound 1 issue:
stringly-typed/src/checkers/brand-style-checker.ts Lines 35 to 45 in 783cf34 Consider not caching error results, or only caching successful validations. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Only cache successful validations to avoid cache poisoning when LLM returns transient malformed responses. Subsequent calls will retry instead of returning cached failures.
ddnetters
pushed a commit
that referenced
this pull request
Jan 31, 2026
## [1.5.0](v1.4.14...v1.5.0) (2026-01-31) ### ✨ Features * **website:** add syntax highlighting to How It Works section ([b32741e](b32741e)) * **website:** update hero with real GitHub Action output ([da39353](da39353)) ### 🐛 Bug Fixes * add retry logic for malformed LLM JSON responses ([#29](#29)) ([0b99746](0b99746)), closes [#28](#28) ### 🎨 Styling * use inline code blocks for filenames in quickstart steps ([b2528fc](b2528fc))
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
Fixes #28 - LLM occasionally returns malformed JSON for short strings like "Submit" or "Execute Operation".
Changes:
Test plan