Repository navigation
fix(openai_model): normalize provider reasoning text discriminators - #5138
weijiac0619 merged 2 commits into
Conversation
Signed-off-by: RyaliNvidia <[email protected]>
Signed-off-by: RyaliNvidia <[email protected]>
yaoyu-33
left a comment
There was a problem hiding this comment.
LGTM. The normalization is narrowly scoped and preserves strict validation; 36 focused tests passed. Full CI is still required.
|
/ok to test b2fa138 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41121333193 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41124377288 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41124466753 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41129252459 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41130477492 |
What does this PR do?
Responses-compatible providers can return a reasoning item's
contentwith anoutput_textdiscriminator, which Gym's strict response schema rejects because it requiresreasoning_text. Correct that narrow shape inopenai_modelimmediately after receiving provider JSON and before response validation.Only a dictionary reasoning content part with string
text, exactly thetype/textkeys and optionally emptyannotations: []is corrected. Copy only changed containers and preserve text, ciphertext, usage, metadata and item order without mutating the provider response. Unknown fields, malformed values and invalid summaries still reach strict validation unchanged. Requests and continuation replay are unchanged.Related merged #3413 handles provider normalization in
litellm_model; this focused change handles the same discriminator mismatch at theopenai_modelresponse boundary. No separate issue is needed for this reproducible compatibility bug.Validation
gym env test +entrypoint=responses_api_models/openai_model +should_validate_data=true— 128 passed, including the new regression suite, in the server's isolated environment.pre-commit run --all-files, focused Ruff/format checks andgit diff --check— passed. The guardwords hook skipped its private scan because its catalog was unavailable.cd fern && npm run check— passed with zero errors; its redirect-history check was skipped without Fern authentication. Scoped hooks passed after the documentation update.Rollouts and compatibility
Live model rollout: N/A for this response-transport correction. Deterministic provider-response tests cover accepted and rejected shapes; no model-quality or benchmark improvement is claimed. Full core, sandbox and all-server suites were not run for this server-only change.
No schema, dependency, retry or configuration change. Ordinary messages, valid reasoning content, Chat Completions, embeddings and outbound requests retain their behavior. The existing Fern OpenAI model page documents the supported normalization. Fixtures are synthetic and new source carries Apache-2.0 SPDX headers. Both commits include DCO sign-off.
Proposed maintainer labels:
bug,area:model,needs-review.