Skip to content
Closed
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
49 changes: 26 additions & 23 deletions nemoclaw/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,42 +136,45 @@ export interface NemoClawConfig {
function activeModelEntries(
onboardCfg: ReturnType<typeof loadOnboardConfig>,
): ModelProviderEntry[] {
if (!onboardCfg?.model) {
// Use the configured model if it exists and is non-empty, otherwise use defaults
const configuredModel = onboardCfg?.model;
if (configuredModel && configuredModel.trim().length > 0) {
return [
{
id: "nvidia/nemotron-3-super-120b-a12b",
label: "Nemotron 3 Super 120B (March 2026)",
id: `inference/${configuredModel}`,
label: configuredModel,
Comment on lines +140 to +145

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for any test fixtures or config examples that might show the expected model format
rg -n "inference/" --type=ts --type=json -C2 | grep -i "model"

# Check how model values are being set in tests
ast-grep --pattern 'model: "$_"'

Repository: NVIDIA/NemoClaw

Length of output: 720


🏁 Script executed:

cat -n nemoclaw/src/index.ts | sed -n '130,180p'

Repository: NVIDIA/NemoClaw

Length of output: 1730


🏁 Script executed:

# Find how loadOnboardConfig loads the model value
rg -n "loadOnboardConfig" --type=ts -A 20 | grep -E "(model|trim|load)" -B 2 -A 2

# Check the definition of loadOnboardConfig
ast-grep --pattern 'function loadOnboardConfig($_) { $$$ }'

Repository: NVIDIA/NemoClaw

Length of output: 8081


🏁 Script executed:

cat -n nemoclaw/src/onboard/config.ts | sed -n '85,115p'

Repository: NVIDIA/NemoClaw

Length of output: 852


🏁 Script executed:

# Check the NemoClawOnboardConfig type definition
rg -n "NemoClawOnboardConfig" --type=ts -B 3 -A 10 | head -60

# Check if there's any UI form that accepts model input
rg -n "model" nemoclaw/src/onboard --type=ts | grep -E "(input|prompt|stdin|read)"

Repository: NVIDIA/NemoClaw

Length of output: 4114


Trim the configured model value to prevent whitespace in ID and label.

The validation checks configuredModel.trim().length > 0, but the untrimmed value is used in the ID and label. If the model config has leading/trailing whitespace (e.g., from manual JSON editing), it would create an invalid ID like "inference/ nvidia/model ".

Apply .trim() at assignment:

Proposed fix
  const configuredModel = onboardCfg?.model;
  if (configuredModel && configuredModel.trim().length > 0) {
    return [
      {
-       id: `inference/${configuredModel}`,
+       id: `inference/${configuredModel.trim()}`,
-       label: configuredModel,
+       label: configuredModel.trim(),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const configuredModel = onboardCfg?.model;
if (configuredModel && configuredModel.trim().length > 0) {
return [
{
id: "nvidia/nemotron-3-super-120b-a12b",
label: "Nemotron 3 Super 120B (March 2026)",
id: `inference/${configuredModel}`,
label: configuredModel,
const configuredModel = onboardCfg?.model;
if (configuredModel && configuredModel.trim().length > 0) {
return [
{
id: `inference/${configuredModel.trim()}`,
label: configuredModel.trim(),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nemoclaw/src/index.ts` around lines 140 - 145, The code uses the untrimmed
configuredModel when building the menu entry (id: `inference/${configuredModel}`
and label: configuredModel) even though you validate with
configuredModel.trim(), so trim and reuse the cleaned value: compute a
trimmedModel = configuredModel.trim() after reading onboardCfg?.model, check
trimmedModel.length > 0, and then use trimmedModel for the id and label (e.g.,
`inference/${trimmedModel}` and label: trimmedModel) to avoid leading/trailing
whitespace in IDs and labels.

contextWindow: 131072,
maxOutput: 8192,
},
{
id: "nvidia/llama-3.1-nemotron-ultra-253b-v1",
label: "Nemotron Ultra 253B",
contextWindow: 131072,
maxOutput: 4096,
},
{
id: "nvidia/llama-3.3-nemotron-super-49b-v1.5",
label: "Nemotron Super 49B v1.5",
contextWindow: 131072,
maxOutput: 4096,
},
{
id: "nvidia/nemotron-3-nano-30b-a3b",
label: "Nemotron 3 Nano 30B",
contextWindow: 131072,
maxOutput: 4096,
},
];
}

// Default models when no config or model is set
return [
{
id: `inference/${onboardCfg.model}`,
label: onboardCfg.model,
id: "inference/nvidia/nemotron-3-super-120b-a12b",
label: "Nemotron 3 Super 120B (March 2026)",
contextWindow: 131072,
maxOutput: 8192,
},
{
id: "inference/nvidia/llama-3.1-nemotron-ultra-253b-v1",
label: "Nemotron Ultra 253B",
contextWindow: 131072,
maxOutput: 4096,
},
{
id: "inference/nvidia/llama-3.3-nemotron-super-49b-v1.5",
label: "Nemotron Super 49B v1.5",
contextWindow: 131072,
maxOutput: 4096,
},
{
id: "inference/nvidia/nemotron-3-nano-30b-a3b",
label: "Nemotron 3 Nano 30B",
contextWindow: 131072,
maxOutput: 4096,
},
];
}

Expand Down