Repository navigation
fix(responses): accept an empty include when downconverting to Chat Completions - #3314
Merged
ananthsub merged 2 commits intoOct 8, 2026
Merged
Conversation
ananthsub
requested changes
Sep 11, 2026
yaoyu-33
approved these changes
Oct 8, 2026
yaoyu-33
left a comment
Contributor
There was a problem hiding this comment.
Re-reviewed 481137a: only include=[] is treated as absent; nonempty include still fails explicitly. The original request and streaming passthrough are preserved. The earlier inline concern is addressed. 597 related tests and focused include-contract probes passed locally with openai==2.44.0; full CI was not run.
Contributor
|
/ok to test 481137a |
Signed-off-by: jiwasawa <[email protected]>
Signed-off-by: jiwasawa <[email protected]>
ananthsub
force-pushed
the
jiwasawa/responses-include-downconvert
branch
from
October 8, 2026 21:09
481137a to
921874f
Compare
Contributor
|
/ok to test 921874f |
ananthsub
approved these changes
Oct 8, 2026
ananthsub
enabled auto-merge
October 8, 2026 21:10
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37846969014 |
khazic
pushed a commit
to khazic/Gym-lao
that referenced
this pull request
Oct 14, 2026
…o#3976) ## What does this PR do? Adds `drop_unrepresentable_request_fields` to `VLLMModelConfig` (default `false`, today's behavior). It decides what the Responses-to-Chat-Completions conversion does with a request field that has no Chat Completions representation. Today `ResponsesConverter.responses_to_chat_completion_create_params` refuses such a request with `NotImplementedError`, so a caller can route it to a server that serves Responses natively. For a model server that has no such route, the refusal ends the rollout over a field the backend never needed. With the setting on, the reporting-only fields are dropped (logged at debug level) and the conversion proceeds: - a non-empty `include`, whatever its values; it names extra fields to report on the response object (an empty `include` is already treated as absent on `main` since NVIDIA-NeMo#3314); - `reasoning.summary` and its deprecated name `reasoning.generate_summary`, which ask for a summary of the reasoning on the response object; `reasoning.effort` still travels as `reasoning_effort`; - a message `phase`, which labels the message rather than changing its content. An image part in a `function_call_output` is replaced with the text placeholder `[image omitted from tool output]` in the tool message, so the surrounding text parts keep their positions and the conversion proceeds; this one does change the prompt the model sees, which is why the placeholder says only what happened to the tool's output. Every other unrepresentable field is still refused, `reasoning.context` included: it tells the provider which earlier reasoning items to render back to the model, which the conversion cannot honor (it renders every reasoning item the request carries and leaves the rest to the chat template). `VLLMModel.responses` and `VLLMModelWithCompaction._context_compaction_chat_params` pass the setting to the converter; the setting has no effect when `is_responses_native` is on, because that path skips the conversion. The vLLM model-server configuration reference documents it. Concrete trigger: the Codex CLI sends `include: ["reasoning.encrypted_content"]` and `reasoning.summary` on every request, and some of its tools return an image part in their output; each of those ended a session against a vLLM chat backend. ## Issue No issue filed; the refusals were observed in training transcripts of the Codex CLI harness against a vLLM chat backend. ## Validation - `tests/unit_tests/test_responses_converter.py`, `responses_api_models/vllm_model/tests/test_app.py`, `responses_api_models/vllm_model_with_compaction/tests/test_app.py`: 420 passed. New tests: an interleaved tool output (text, image, text) becomes the exact three-part message with the placeholder in place and the drop logged at debug; other part types are still refused; a message `phase` is refused by default and dropped when configured; `include` is dropped on the plain and the streaming path; `reasoning.summary` and `reasoning.generate_summary` are dropped while the effort travels; every `reasoning.context` value is still refused; the compaction server refuses `include` with the setting off and serves the request with it on, with the exact prefix still reaching the backend. - Full `tests/unit_tests` and every `responses_api_models/*/tests` suite on this branch: the only failures (opensandbox, telemetry, and the two servers that import `vllm`) are the same as on `main` f128d43 in the same environment. - `ruff check` and `ruff format --check` on the changed files: clean. - Rollout evidence: this setting has run for weeks in a downstream fork training with the OpenCode and Codex harnesses through this model server; with it on, no Codex session ends on one of these fields. ### Review follow-up Rebased onto `main` f128d43. The `huggingface-hub<2` bound that the validation merges had added to this branch lives in NVIDIA-NeMo#4362 now. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: alexandery <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: yaoyu-33 <[email protected]>
7 tasks done
This branch was previously deployed
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.
What does this PR do?
Closes #3312
ResponsesConverter.responses_to_chat_completion_create_paramsrejected any request carrying theincludekey.The Codex CLI sends
includeon every request ([]or["reasoning.encrypted_content"]), so it could not make a single call through a chat-backed model server (vllm_model,azure_openai_model,inference_provider).includeonly widens the response shape; it does not change what the model is asked.Codex sends
include=[]against a Gym model server, so the converter now treats anempty list as absent. Non-empty values still raise
NotImplementedError, because theconverter does not produce
reasoning.encrypted_contentormessage.output_text.logprobsand returning a response without them would hide a lossy conversion.
The fix lives in the converter rather than
sanitize_streaming_responses_body, which also serves the passthrough servers (openai_model,litellm_model) that forwardincludeto providers honouring it.Tests
test_downconverting_treats_empty_include_as_absent.includerejections per turn andturn.failed; after, the request downconverts. Completing the turn also needs fix(responses): null cached_tokens/reasoning_tokens in the synthesized response.completed event abort Codex CLI turns #3313 .Checklist
pre-commit run --all-files) (so CI lint/format/copyright pass).git commit -s) (so the DCO check passes).