Repository navigation
Fix Responses API null field serialization - #47184
Closed
shenoyvvarun wants to merge 1 commit into
Closed
shenoyvvarun wants to merge 1 commit into
shenoyvvarun wants to merge 1 commit into
Conversation
shenoyvvarun
requested review from
AndreasKaratzas,
DarkLight1337,
NickLucche,
aarnphm,
chaunceyjiang,
robertgshaw2-redhat and
russellb
as code owners
June 30, 2026 16:31
Signed-off-by: Varun Shenoy <varun.vinayak.shenoy@oracle.com>
shenoyvvarun
force-pushed
the
fix/responses-openapi-null-serialization
branch
from
June 30, 2026 18:35
afd25cc to
5c79282
Compare
Contributor
Author
|
@chaunceyjiang Could you provide any thoughts on this? |
1 task done
|
This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you! |
6 tasks done
6 tasks done
|
This pull request has been automatically closed due to inactivity. Please feel free to reopen if you intend to continue working on it. Thank you! |
6 tasks done
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
Fixes #47200.
Align the Responses API JSON serialization with OpenAI OpenAPI nullable semantics.
This fixes cases where vLLM serialized
nullfor fields that are optional but not nullable in the OpenAI schema, while preserving fields that are explicitly nullable.This is breaking SMG compatibility for the Responses API because SMG strictly deserializes the response schema and fails with:
Changes
error: nullto successfulResponsesResponseobjects, matching the OpenAI Response schema.Nonefields only at their exact response positions:text,user,kv_transfer_params,input_messages,output_messagesoutput[*].status,output[*].namespacetools[*].defer_loadingnull, includingincomplete_details,instructions,metadata,max_tool_calls,previous_response_id,prompt,reasoning,top_logprobs,encrypted_content, and function toolstrict.status: nullare preserved.Testing
python -m py_compile vllm/entrypoints/openai/responses/protocol.py vllm/entrypoints/openai/responses/api_router.py tests/entrypoints/openai/responses/test_protocol.pygit diff --checkgpt-oss-120b:before patch reproduced invalid
nullfieldsAfter no null fields