fix(agent): add nvidia/ to OpenRouter reasoning model prefixes (#75386) - #75407
Open
JonthanaHanh wants to merge 1 commit into
Open
JonthanaHanh wants to merge 1 commit into
JonthanaHanh wants to merge 1 commit into
Conversation
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
Contributor
teknium1
reviewed
Jul 31, 2026
teknium1
left a comment
Collaborator
There was a problem hiding this comment.
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:6480enablesreasoningfor everynvidia/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:5688checks only the boolean gate. It does not exercise the resulting request body, which is emitted byplugins/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'sreasoning_effort: nonebecomesextra_body.reasoning = {"enabled": false}.
Automated hermes-sweeper review.
| "x-ai/", | ||
| "google/gemini-2", | ||
| "google/gemma-4", | ||
| "nvidia/", |
Collaborator
There was a problem hiding this comment.
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.
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.
Summary
_supports_reasoning_extra_body()uses a hardcoded allowlist of OpenRouter model-family prefixes to decide whether to sendreasoning.enabled: falsein 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 explicitreasoning_effort: none.Changes
"nvidia/"toreasoning_model_prefixesinrun_agent.py:6473test_nvidia_models_are_treated_as_reasoning_capablecovering three NVIDIA model variantsTest Plan
pytest tests/run_agent/test_run_agent.py::TestSupportsReasoningExtraBody -xvs— 2 passedFixes #75386