Skip to content

Fix json parsing with escapted characters producing corrupted jsons#3158

Merged
plengauer merged 2 commits intomainfrom
plengauer-patch-1
Mar 19, 2026
Merged

Fix json parsing with escapted characters producing corrupted jsons#3158
plengauer merged 2 commits intomainfrom
plengauer-patch-1

Conversation

@plengauer
Copy link
Owner

No description provided.

Remove temporary stdout file after processing JSON response.
@plengauer plengauer self-assigned this Mar 10, 2026
@plengauer plengauer marked this pull request as ready for review March 10, 2026 10:11
@plengauer plengauer requested a review from moflwi as a code owner March 10, 2026 10:11
Copilot AI review requested due to automatic review settings March 10, 2026 10:11
@plengauer plengauer enabled auto-merge (squash) March 10, 2026 10:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes OpenAI API response parsing to avoid corrupted JSON when escaped characters are present by changing how raw stdout is preserved/forwarded while still extracting structured fields with jq.

Changes:

  • Introduces a temp path and uses tee to duplicate the raw response stream.
  • Removes the jq ( . | tostring ) capture/print of the full JSON to avoid escaping-related corruption.
  • Adds cleanup for the temporary stdout artifact.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@plengauer plengauer merged commit 4a33855 into main Mar 19, 2026
1680 of 1686 checks passed
@plengauer plengauer deleted the plengauer-patch-1 branch March 19, 2026 18:00
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.

3 participants