Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions run_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6477,6 +6477,7 @@ def _supports_reasoning_extra_body(self) -> bool:
"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.

"qwen/qwen3",
"tencent/hy3",
"xiaomi/",
Expand Down
13 changes: 13 additions & 0 deletions tests/run_agent/test_run_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5688,6 +5688,19 @@ def test_xiaomi_models_are_treated_as_reasoning_capable(self):
agent.model = model
assert agent._supports_reasoning_extra_body() is True, model

def test_nvidia_models_are_treated_as_reasoning_capable(self):
"""NVIDIA Nemotron reasoning models on OpenRouter must support
reasoning extra_body so that ``reasoning_effort: none`` can disable
reasoning (GH #75386)."""
agent = self._make_agent()
for model in (
"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free",
"nvidia/nemotron-ultra-253b",
"nvidia/llama-3.1-nemotron-70b-instruct:free",
):
agent.model = model
assert agent._supports_reasoning_extra_body() is True, model


class TestMemoryContextSanitization:
"""sanitize_context() helper correctness — used at provider boundaries."""
Expand Down
Loading