Skip to content

Improve JSON parse error logging#52

Merged
hemanth-asirvatham merged 1 commit intomainfrom
print-full-underlying-error-for-troubleshooting
Feb 10, 2026
Merged

Improve JSON parse error logging#52
hemanth-asirvatham merged 1 commit intomainfrom
print-full-underlying-error-for-troubleshooting

Conversation

@hemanth-asirvatham
Copy link
Collaborator

Motivation

  • Make it easier to diagnose intermittent JSON parsing failures (e.g. the early "JSON parsing failed" bursts seen during high-concurrency runs) by surfacing the underlying parse exception in logs and error records.
  • Provide richer diagnostics for JSON-mode validation so callers can see both a snippet of the invalid payload and the exact parsing error type/message.

Description

  • Change parse_json_with_status in src/gabriel/utils/parsing.py to return an optional Exception alongside the parsed value and success flag via the signature -> Tuple[Optional[Union[dict, list]], bool, Optional[Exception]] so callers can access the underlying parse exception.
  • Extend JSONParseError in src/gabriel/utils/openai_utils.py to accept a parse_error field and store the original exception.
  • Update JSON-mode validation in get_all_responses to collect parse errors for invalid payloads and include the parse error details in the logged/emitted error text and Error Log entries so operators see Cause: <ExceptionType>: <message> plus the payload snippet.

Testing

  • No automated tests were run for this change.

Codex Task

@github-actions
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant