Repository navigation
openai_model: handle NVIDIA-hosted gpt-oss response quirks (hosted-MCP items + reasoning strip) - #1910
Merged
bxyu-nvidia merged 5 commits intoJul 14, 2026
Conversation
The openai_model server 500'd on two gpt-oss-via-Responses-API quirks, and a single 500 aborts the whole rollout collection: 1. Hosted-MCP output items. gpt-oss surfaces its built-in python tool as an 'mcp_call' output item (also mcp_list_tools / mcp_approval_request). These are valid OpenAI Responses output types but were absent from the NeMoGymResponse output-item union, so NeMoGymResponse.model_validate raised. Add lenient NeMoGymResponseMcpCall/McpListTools/McpApprovalRequest models to the union. The agent already stops when no function_call is present, so a server-executed mcp_call (output pre-populated) simply passes through. 2. Content-less reasoning items. Opt-in drop_input_reasoning_items strips type=reasoning input items before the upstream call, working around endpoints that 500 with KeyError 'content' when their own reasoning items are echoed back across tool turns. Wired via POLICY_DROP_REASONING_ITEMS. Tests: mcp_call/list_tools/approval_request validate (unit + server-level 200); drop_input_reasoning_items strips reasoning from the upstream input. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: OliviaViessmann <oviessmann@nvidia.com>
OliviaViessmann
marked this pull request as ready for review
July 2, 2026 13:27
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: OliviaViessmann <oviessmann@nvidia.com>
bxyu-nvidia
requested changes
Jul 14, 2026
… types Address review: NeMoGymResponseMcpCall/McpListTools/McpApprovalRequest redefined the upstream Responses output-item fields from scratch. Inherit from openai's McpCall/McpListTools/McpApprovalRequest instead, overriding only what NVIDIA-hosted gpt-oss requires: id/server_label relaxed to optional, McpCall status widened to str, and McpListTools tools kept as List[Any] so raw tool entries pass through. Add a test asserting the inheritance. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: OliviaViessmann <oviessmann@nvidia.com>
adil-a
reviewed
Jul 14, 2026
bxyu-nvidia
approved these changes
Jul 14, 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.
What
Two fixes so the openai_model server works with NVIDIA-hosted gpt-oss over the Responses API:
Why
The NVIDIA-hosted openai/gpt-oss-120b endpoint 500s the model server on both quirks; a single /run 500 aborts the entire ng_collect_rollouts batch. See #1909 for a minimal repro.
How it behaves
An mcp_call is executed server-side (its output is already populated), and the agent loop already stops when there is no function_call, so the item simply parses and passes through. The MCP items carry no training variant: the chat→responses training converter never produces them, so RESPONSES_TO_TRAIN is unaffected.
Tests
All pass (14); ruff clean; DCO signed-off.