Skip to content

Commit 0b1429e

Browse files
feat: add nemotron to tool_preset options in CI workflows
Add nemotron to: - ToolPresetType literal in tests/integration/base.py - get_tools_for_preset() function to return nemotron tools - run-eval.yml workflow tool_preset dropdown - integration-runner.yml workflow tool_preset dropdown - run_infer.py argparse choices - test_tool_presets.py for nemotron validation This enables running evaluations with TOOL_PRESET=nemotron to test the Nemotron-3 Super model with its native tool names (bash, str_replace). Co-authored-by: openhands <openhands@all-hands.dev>
1 parent 2bade83 commit 0b1429e

5 files changed

Lines changed: 43 additions & 10 deletions

File tree

.github/workflows/integration-runner.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ on:
3333
type: string
3434
tool_preset:
3535
description: >-
36-
Tool preset for file editing (default, gemini, gpt5, planning).
36+
Tool preset for file editing (default, gemini, gpt5, planning, nemotron).
3737
'default' uses FileEditorTool, 'gemini' uses read_file/write_file/edit/list_directory,
38-
'gpt5' uses apply_patch tool.
38+
'gpt5' uses apply_patch tool, 'nemotron' uses bash/str_replace (Anthropic-compatible).
3939
required: false
4040
default: default
4141
type: choice
@@ -44,6 +44,7 @@ on:
4444
- gemini
4545
- gpt5
4646
- planning
47+
- nemotron
4748
schedule:
4849
- cron: 30 22 * * * # Runs at 10:30pm UTC every day
4950

.github/workflows/run-eval.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ on:
9292
description: >-
9393
Tool preset for file editing. 'default' uses FileEditorTool,
9494
'gemini' uses read_file/write_file/edit/list_directory,
95-
'gpt5' uses apply_patch tool.
95+
'gpt5' uses apply_patch tool,
96+
'nemotron' uses bash/str_replace (Anthropic-compatible).
9697
required: false
9798
default: default
9899
type: choice
@@ -101,6 +102,7 @@ on:
101102
- gemini
102103
- gpt5
103104
- planning
105+
- nemotron
104106
agent_type:
105107
description: >-
106108
Agent type: 'default' for standard Agent,

tests/integration/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
# Tool preset type for selecting which file editing toolset to use
32-
ToolPresetType = Literal["default", "gemini", "gpt5", "planning"]
32+
ToolPresetType = Literal["default", "gemini", "gpt5", "planning", "nemotron"]
3333

3434

3535
def get_tools_for_preset(
@@ -38,7 +38,7 @@ def get_tools_for_preset(
3838
"""Get the list of tools for the given preset.
3939
4040
Args:
41-
preset: The tool preset to use (default, gemini, gpt5, or planning).
41+
preset: The tool preset to use (default, gemini, gpt5, planning, or nemotron).
4242
enable_browser: Whether to include browser tools.
4343
4444
Returns:
@@ -58,6 +58,10 @@ def get_tools_for_preset(
5858

5959
# Planning preset is read-only and doesn't support browser tools
6060
return get_planning_tools()
61+
case "nemotron":
62+
from openhands.tools.preset.nemotron import get_nemotron_tools
63+
64+
return get_nemotron_tools(enable_browser=enable_browser)
6165
case "default":
6266
from openhands.tools.preset.default import get_default_tools
6367

tests/integration/run_infer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,15 @@ def main():
455455
parser.add_argument(
456456
"--tool-preset",
457457
type=str,
458-
choices=["default", "gemini", "gpt5", "planning"],
458+
choices=["default", "gemini", "gpt5", "planning", "nemotron"],
459459
default="default",
460460
help=(
461461
"Tool preset to use for file editing (default: 'default'). "
462462
"'default' uses FileEditorTool (claude-style), "
463463
"'gemini' uses read_file/write_file/edit/list_directory tools, "
464464
"'gpt5' uses apply_patch tool, "
465-
"'planning' uses planning-specific tools."
465+
"'planning' uses planning-specific tools, "
466+
"'nemotron' uses bash/str_replace tools (Anthropic-compatible)."
466467
),
467468
)
468469

tests/integration/test_tool_presets.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,29 @@ def test_get_tools_for_preset_invalid():
8080
get_tools_for_preset("invalid_preset", enable_browser=False) # type: ignore[arg-type]
8181

8282

83+
def test_get_tools_for_preset_nemotron():
84+
"""Test that nemotron preset returns Anthropic-compatible tools."""
85+
tools = get_tools_for_preset("nemotron", enable_browser=False)
86+
tool_names = {t.name for t in tools}
87+
88+
assert "bash" in tool_names
89+
assert "str_replace" in tool_names
90+
assert "task_tracker" in tool_names
91+
# Default terminal/file_editor should NOT be present
92+
assert "terminal" not in tool_names
93+
assert "file_editor" not in tool_names
94+
95+
8396
def test_tool_preset_type_literal_values():
8497
"""Verify ToolPresetType includes all expected values."""
8598
# This is a compile-time check but we document expected values here
86-
valid_presets: list[ToolPresetType] = ["default", "gemini", "gpt5", "planning"]
99+
valid_presets: list[ToolPresetType] = [
100+
"default",
101+
"gemini",
102+
"gpt5",
103+
"planning",
104+
"nemotron",
105+
]
87106
for preset in valid_presets:
88107
# Should not raise
89108
tools = get_tools_for_preset(preset, enable_browser=False)
@@ -104,12 +123,18 @@ def test_run_infer_argparse_accepts_all_tool_presets():
104123
parser.add_argument(
105124
"--tool-preset",
106125
type=str,
107-
choices=["default", "gemini", "gpt5", "planning"],
126+
choices=["default", "gemini", "gpt5", "planning", "nemotron"],
108127
default="default",
109128
)
110129

111130
# Test each valid preset value
112-
valid_presets: list[ToolPresetType] = ["default", "gemini", "gpt5", "planning"]
131+
valid_presets: list[ToolPresetType] = [
132+
"default",
133+
"gemini",
134+
"gpt5",
135+
"planning",
136+
"nemotron",
137+
]
113138

114139
for preset in valid_presets:
115140
# This should not raise an error

0 commit comments

Comments
 (0)