Skip to content

fix(agent): add nvidia/ to OpenRouter reasoning model prefixes (#75386) - #75407

Open
JonthanaHanh wants to merge 1 commit into
NousResearch:mainfrom
JonthanaHanh:fix/nvidia-reasoning-effort-none
Open

JonthanaHanh wants to merge 1 commit into
NousResearch:mainfrom
JonthanaHanh:fix/nvidia-reasoning-effort-none

Conversation

@JonthanaHanh

Copy link
Copy Markdown
Contributor

Summary

_supports_reasoning_extra_body() uses a hardcoded allowlist of OpenRouter model-family prefixes to decide whether to send reasoning.enabled: false in the API extra_body. nvidia/ was absent, so NVIDIA Nemotron reasoning models routed through OpenRouter never received the disable-reasoning signal — reasoning remained active (247-263 tokens/turn) even with explicit reasoning_effort: none.

Changes

  • Added "nvidia/" to reasoning_model_prefixes in run_agent.py:6473
  • Added regression test test_nvidia_models_are_treated_as_reasoning_capable covering three NVIDIA model variants

Test Plan

  • pytest tests/run_agent/test_run_agent.py::TestSupportsReasoningExtraBody -xvs — 2 passed

Fixes #75386

NVIDIA Nemotron reasoning models routed through OpenRouter were not
receiving the `reasoning.enabled: false` extra_body when
`reasoning_effort: none` was configured, because `nvidia/` was
absent from the hardcoded allowlist in
`_supports_reasoning_extra_body()`.

This caused reasoning to remain active (247-263 tokens per turn) even
with explicit `reasoning_effort: none`.

Added `nvidia/` prefix and a regression test covering three NVIDIA
model variants on OpenRouter.

Fixes NousResearch#75386
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/openrouter OpenRouter aggregator provider/nvidia NVIDIA NIM P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Jul 31, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #75402: both patches add nvidia/ to the same OpenRouter reasoning prefix allowlist for #75386 and cover the same Nemotron behavior.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracing the report to the OpenRouter gate. The current main path does still block the reporter's configuration: run_agent.py:6473-6484 lacks nvidia/, and agent/chat_completion_helpers.py:1337 passes that result to the OpenRouter profile.

Problems

  • run_agent.py:6480 enables reasoning for every nvidia/ slug. The allowlist was introduced because reasoning configuration sent to NVIDIA via OpenRouter caused 400s (3f0f4a04a951bd5d64ba1f1c00be4f01945774fd). The issue establishes support for the reported Nemotron model, not the whole vendor namespace.
  • tests/run_agent/test_run_agent.py:5688 checks only the boolean gate. It does not exercise the resulting request body, which is emitted by plugins/model-providers/openrouter/__init__.py:141-179.

Suggested changes

  • Scope the new allowlist entry to model identifiers demonstrated to support the OpenRouter reasoning field, or establish a safe capability-based gate.
  • Add a _build_api_kwargs() regression asserting the reporter's reasoning_effort: none becomes extra_body.reasoning = {"enabled": false}.

Automated hermes-sweeper review.

Comment thread run_agent.py
"x-ai/",
"google/gemini-2",
"google/gemma-4",
"nvidia/",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This opts every nvidia/ model into extra_body.reasoning, but the original gate explicitly excluded NVIDIA after OpenRouter returned 400s for its reasoning payload (commit 3f0f4a04). Please restrict this to NVIDIA models known to accept the payload, or establish a safe capability gate rather than widening the entire vendor namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists provider/nvidia NVIDIA NIM provider/openrouter OpenRouter aggregator sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: reasoning_effort: none is ignored for NVIDIA models on OpenRouter

4 participants