cp: fix(responses-converter): strip strict from function tools before engine dispatch (2892) into r0.6.0 - #2899
Merged
Merged
Conversation
…ine dispatch (#2892) ## Summary The openai-2.44 pin rework (65129dd, #2456) stopped popping `strict` from function tool definitions in `responses_to_chat_completion_create_params`. This restores the pre-#2456 strip. `strict` is an OpenAI-hosted enforcement flag with no Chat Completions semantics on self-hosted engines: vLLM 0.25.1's `FunctionDefinition` keeps it, and chat templates that render unknown function keys (e.g. Nemotron's `render_extra_keys`) inject `<strict>True</strict>` into every `<function>` block. That perturbs the prompt of every tool-bearing request off-distribution. ## Observed impact In RL training (jobs 6707880/6712632 vs baseline 6682989): ~17% of sequences per step ran away to the max-token cap, collected reward-0 truncation penalties, and were masked by sequence logprob error (1e4–1e14). Restoring the strip returns the engine request to byte-parity with the pre-#2456 tree. ## Question for reviewers Was dropping the strip in #2456 intentional? If `strict` support on self-hosted engines is planned, a config flag may be preferable — but unconditional stripping matches pre-#2456 behavior and `strict` has no Chat Completions semantics today. ## Changes - `nemo_gym/responses_converter.py`: pop `strict` from function tool dicts before building `NeMoGymChatCompletionToolParam` - `tests/unit_tests/test_responses_converter.py`: assert `strict` does not reach the engine params 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Pranav Thombre <pthombre@nvidia.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
Author
|
/ok to test 236f198 |
ananthsub
approved these changes
Aug 31, 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.
beep boop [🤖]: Hi @pthombre 👋,