Skip to content

Tolerate unescaped control characters in AI JSON output#3

Open
kevinmatspie wants to merge 1 commit into
simion:mainfrom
kevinmatspie:fix/extract-json-control-chars
Open

Tolerate unescaped control characters in AI JSON output#3
kevinmatspie wants to merge 1 commit into
simion:mainfrom
kevinmatspie:fix/extract-json-control-chars

Conversation

@kevinmatspie
Copy link
Copy Markdown

json.loads(strict=False) allows literal newlines and tabs inside string values, a common LLM failure mode when emitting multi-line issue or fix fields without escaping. Previously a stray newline would discard the entire (paid-for) review with no way to recover the AI output.

On final parse failure, dump the full AI output to /tmp/reviewd-failed-.txt so the review can be salvaged manually rather than losing all but the first 1000 chars to the error log.

json.loads(strict=False) allows literal newlines and tabs inside string
values, a common LLM failure mode when emitting multi-line `issue` or
`fix` fields without escaping. Previously a stray newline would discard
the entire (paid-for) review with no way to recover the AI output.

On final parse failure, dump the full AI output to
/tmp/reviewd-failed-<timestamp>.txt so the review can be salvaged
manually rather than losing all but the first 1000 chars to the error
log.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant