feat(openai): Gate response output collection on data collection options - #7035
Merged
Conversation
Gate OpenAI response text and tool calls collection on the new data_collection settings, giving precedence over the legacy send_default_pii flag for backwards compatibility. Applies to Chat Completions API, Responses API, and their streaming variants. Refs PY-2588
Contributor
Codecov Results 📊✅ 98904 passed | ⏭️ 6479 skipped | Total: 105383 | Pass Rate: 93.85% | Execution Time: 350m 16s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 95.45%. Project has 2497 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 89.90% 89.96% +0.06%
==========================================
Files 193 193 —
Lines 24822 24859 +37
Branches 8924 8962 +38
==========================================
+ Hits 22315 22362 +47
- Misses 2507 2497 -10
- Partials 1417 1412 -5Generated by Codecov Action |
ericapisani
marked this pull request as ready for review
August 5, 2026 13:54
alexander-alderman-webb
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gate OpenAI response text and tool calls collection on the new data_collection settings, giving precedence over the legacy send_default_pii flag for backwards compatibility.
Applies to Chat Completions API, Responses API, and their streaming variants.
Refs PY-2588
For reviewers
The git diff, while large, is not as large as Github is making it out to be. My suggestion would be to review the changes in
openai.pyhere and, for reviewing the tests, checkout this branch and look up the following tests individually that were added as part of these changes: