Skip to content

fix(responses): avoid parsing incomplete structured output#1852

Open
cyphercodes wants to merge 1 commit intoopenai:masterfrom
cyphercodes:fix/responses-incomplete-structured-parse
Open

fix(responses): avoid parsing incomplete structured output#1852
cyphercodes wants to merge 1 commit intoopenai:masterfrom
cyphercodes:fix/responses-incomplete-structured-parse

Conversation

@cyphercodes
Copy link
Copy Markdown

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Fixes #1839.

  • Skip auto-parsing structured Responses output when the response is not completed, so incomplete responses can be inspected via status / incomplete_details instead of surfacing a JSON parse error first.
  • Keep completed response parsing behavior unchanged and add focused coverage for both paths.

Additional context & links

Verification:

  • yarn test tests/lib/ResponsesParser.test.ts --runInBand
  • yarn build
  • ./node_modules/.bin/prettier --check src/lib/ResponsesParser.ts tests/lib/ResponsesParser.test.ts
  • ./node_modules/.bin/eslint src/lib/ResponsesParser.ts tests/lib/ResponsesParser.test.ts
  • git diff --check

@cyphercodes cyphercodes requested a review from a team as a code owner April 29, 2026 12:12
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.

Structured responses fail with JSON parse error when incomplete

1 participant