fix(openai): openai sdk validation error not surfaced in `with_structured_output`
by LouisAuneau
·
Feb 06, 2026 at 19:28 UTC
·
scan-c210b0cc20dfb857
Get this automatically on every PR
Install the Axiomo GitHub App to get Signals as check runs and PR comments on every pull request.
Risk level: Low (20%)
Surface OpenAI SDK validation errors in `with_structured_output` using parsing_error.
BaseChatOpenAI wraps LLM call to capture ValidationError in `parsing_error`.
`RunnableBranch` checks for parsing errors before proceeding.
Only `_get_raw_structured_output_chain` logic is changed.
Has 2 merged PRs to this repo. unfamiliar with 2 files.
Review 1 high-priority file(s)
libs/partners/openai/langchain_openai/chat_models/base.py
+86
86 lines changed; Source code
libs/partners/openai/tests/unit_tests/chat_models/test_base.py
+68
68 lines changed; Source code
24
minutes to review
medium
effort level
none
staleness risk
Standard review process
Some concerns to address before approval
Why is security_scan_clean missing? Consider adding this check.
Why is coverage_maintained missing? Consider adding this check.