Skip to content

Note the unparseable-output case in OpenAIResponseOperator XCom docs - #74519

Merged
kaxil merged 2 commits into
apache:mainfrom
YAshhh29:openai-structured-followup
Nov 5, 2026
Merged

kaxil merged 2 commits into
apache:mainfrom
YAshhh29:openai-structured-followup

Conversation

@YAshhh29

@YAshhh29 YAshhh29 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #69812, addressing the two non-blocking notes from @kaxil's approval.

  • The class docstring said a structured response that fails the task "still records its id and token usage". That doesn't hold when the SDK raises ValidationError (JSON cut off mid-object), because no response object comes back, so neither key is pushed. The docstring now carries the same caveat as the guide.
  • test_rejected_response_still_records_id_and_usage only covered a refusal. It is now parametrized with an incomplete response too, which pins that the push happens before the status check.

No behaviour change.


Was generative AI tooling used to co-author this PR?
  • Yes. I used Claude Code as an assistant for the edit and the test. I reviewed the change before pushing and I'm responsible for it.

Generated-by: Claude Code following the guidelines

@YAshhh29

YAshhh29 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@kaxil this is the small follow-up for your two notes on #69812, whenever you have a moment.

@YAshhh29
YAshhh29 force-pushed the openai-structured-followup branch from 8b17e50 to 7eddfdb Compare October 10, 2026 14:23
The class docstring said a structured response that fails the task still
records its id and token usage. That does not hold when the SDK cannot
parse the output, because it raises before returning a response object.

The test for a rejected response now also covers an incomplete response,
which pins that both keys are pushed before the status check.
@YAshhh29
YAshhh29 force-pushed the openai-structured-followup branch from 7eddfdb to 0d3e9d2 Compare October 24, 2026 12:50
@YAshhh29
YAshhh29 requested a review from kaxil as a code owner October 24, 2026 12:50
@YAshhh29

Copy link
Copy Markdown
Contributor Author

Checked on the released provider 2.1.0: an incomplete response still pushes response_id and usage, and cut-off JSON pushes neither key, which is the case the docstring now mentions. A live run with gpt-4o-mini earlier showed the same.

download

The workflows for the latest push are waiting for approval, if a maintainer could approve them.

@YAshhh29

Copy link
Copy Markdown
Contributor Author

Renamed to response_fields in 562cdab, thanks!

@kaxil
kaxil merged commit d46d97f into apache:main Nov 5, 2026
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants