Skip to content

openai_model 500s on gpt-oss hosted-MCP (mcp_call) output items, aborting rollout collection #1909

Closed

Description

@OliviaViessmann

Describe the bug

When the policy model is an endpoint that executes tools server-side via hosted MCP — e.g. NVIDIA-hosted openai/gpt-oss-120b on integrate.api.nvidia.com — the Responses API returns output items of type: "mcp_call" (and may return mcp_list_tools / mcp_approval_request). These are valid OpenAI Responses output-item types, but they are absent from the NeMoGymResponse output-item union in nemo_gym/openai_utils.py. As a result NeMoGymResponse.model_validate(...) in responses_api_models/openai_model/app.py raises a ValidationError, the model server returns HTTP 500, and since ng_collect_rollouts aborts on the first /run 500, a single such response kills the entire rollout collection.

Steps/Code to reproduce bug

from nemo_gym.openai_utils import NeMoGymResponse

NeMoGymResponse.model_validate({
"id": "r", "created_at": 0.0, "model": "gpt-oss-120b", "object": "response",
"parallel_tool_calls": True, "tool_choice": "auto", "tools": [],
"output": [{
"type": "mcp_call", "id": "m", "name": "python", "server_label": "exec",
"arguments": "{}", "output": "42", "status": "completed",
}],
})

pydantic_core.ValidationError: 42 validation errors for NeMoGymResponse

Input should be 'message'/'function_call'/'reasoning'/... [input_value='mcp_call']

End-to-end: serve openai_model against openai/gpt-oss-120b with a function tool available and run ng_collect_rollouts. When the model routes through its built-in server-side python tool it emits an mcp_call, the model server 500s, and the collection aborts.

Expected behavior

Hosted-MCP output items should validate and pass through so the rollout completes (the agent already stops when no function_call is present, and a server-executed mcp_call already carries its output).

Configs

openai_model policy pointed at https://integrate.api.nvidia.com/v1, model openai/gpt-oss-120b, with a function tool attached to the request.

Environment details

  • OS: Linux
  • Python: 3.12
  • openai==2.7.2 (defines McpCall / McpListTools / McpApprovalRequest in openai.types.responses.response_output_item)

Additional context

A related quirk on the same endpoint: it 500s with KeyError 'content' when its own content-less reasoning items are echoed back across tool-use turns. Fix for both is in the linked PR (adds the hosted-MCP items to the response schema; adds an opt-in drop_input_reasoning_items).

Activity

  1. added
    community-request
    on Jul 2, 2026
  2. added
    waiting-on-maintainers
    on Jul 4, 2026
  3. added a commit that references this issue on Jul 14, 2026
    21e6882
  4. removed
    waiting-on-maintainers
    on Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    community-request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions