fix: set content type header consistently for responses api requests - #4935
Merged
Pratham-Mishra04 merged 1 commit intoJul 6, 2026
Conversation
|
tejas ghatte seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
TejasGhatte
marked this pull request as ready for review
July 6, 2026 06:54
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
📝 WalkthroughWalkthroughThe Content-Type header setting in executeResponsesLifecycleUnary was refactored to always apply application/json regardless of HTTP method or body content, while body defaulting behavior for empty POST requests remains unchanged. ChangesContent-Type Header Fix
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
Collaborator
Merge activity
|
Pratham-Mishra04
deleted the
07-06-fix_set_content_type_header_consistently_for_responses_api_requests
branch
July 6, 2026 07:21
18 tasks
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.

Summary
The
Content-Type: application/jsonheader was previously only set when the request method wasPOSTor when a body was present. This meant non-POST requests with no body (e.g.,GETorDELETE) would not include the header, which could cause inconsistent behavior. The header is now always set regardless of method or body presence.Changes
Content-Type: application/jsonon the method beingPOSTor the body being non-emptyexecuteResponsesLifecycleUnaryPOSTbody defaults to{}Type of change
Affected areas
How to test
go test ./core/providers/openai/...Verify that requests made via the OpenAI Responses lifecycle (including non-POST methods) include the
Content-Type: application/jsonheader, and that POST requests with no body still default to{}.Screenshots/Recordings
N/A
Breaking changes
Related issues
N/A
Security considerations
No security implications. This change only affects request header construction.
Checklist
docs/contributing/README.mdand followed the guidelines