Skip to content

fix(model-ref): re-add nvidia/ prefix in normalizeStaticProviderModelId (#71552)#71660

Merged
fabianwilliams merged 2 commits into
openclaw:mainfrom
sudhindrat:fix/nvidia-model-prefix-71552
Apr 25, 2026
Merged

fix(model-ref): re-add nvidia/ prefix in normalizeStaticProviderModelId (#71552)#71660
fabianwilliams merged 2 commits into
openclaw:mainfrom
sudhindrat:fix/nvidia-model-prefix-71552

Conversation

@sudhindrat

Copy link
Copy Markdown
Contributor

Fix: Nvidia provider drops vendor model prefix (#71552)

Root cause: parseStaticModelRef splits nvidia/nemotron-3-super-120b-a12b on the first / → provider=nvidia, modelRaw=nemotron-3-super-120b-a12b. normalizeStaticProviderModelId has a re-prefixing case for openrouter but not nvidia, so the bare model id reaches integrate.api.nvidia.com → HTTP 404.

Fix: Added the missing nvidia re-prefixing case in normalizeStaticProviderModelId:

if (provider === "nvidia" && !model.includes("/")) {
  return `nvidia/${model}`;
}

Test: Added src/agents/model-ref-shared.test.ts covering:

  • Bare nvidia model ids get the prefix restored (nemotron-3-super-120b-a12bnvidia/nemotron-3-super-120b-a12b)
  • Already-prefixed models pass through unchanged (no double-prefix)

Closes #71552

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Apr 25, 2026
@greptile-apps

greptile-apps Bot commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a bug where nvidia model IDs lose their nvidia/ prefix after being parsed by parseStaticModelRef, causing HTTP 404s against integrate.api.nvidia.com. The fix adds a re-prefixing guard in normalizeStaticProviderModelId that mirrors the existing openrouter pattern, and adds a new test file to cover both the bare-id and already-prefixed cases.

Confidence Score: 4/5

Safe to merge — the fix is minimal and correct, with one minor test-description inaccuracy.

Only P2 findings; the core logic change is correct and consistent with the existing openrouter pattern. The second test case uses a misleading fixture but doesn't affect correctness of the implementation.

src/agents/model-ref-shared.test.ts — second test fixture could be more representative of the double-prefix scenario.

Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/agents/model-ref-shared.test.ts
Line: 11-15

Comment:
**Misleading test description and model fixture**

The test is named "does not double-prefix already prefixed models", suggesting the input is `nvidia/nemotron-3-super-120b-a12b` (already carrying the `nvidia/` prefix). Instead it uses `moonshotai/kimi-k2.5`, which is a third-party model hosted on NVIDIA's platform — a slightly different scenario. The guard works either way because it only checks for `/`, but the test doesn't actually prove the double-prefix case. Consider using `nvidia/nemotron-3-super-120b-a12b` as the fixture to make the intent unambiguous.

```suggestion
  it("does not double-prefix already prefixed models", () => {
    expect(normalizeStaticProviderModelId("nvidia", "nvidia/nemotron-3-super-120b-a12b")).toBe(
      "nvidia/nemotron-3-super-120b-a12b",
    );
  });
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(model-ref): re-add nvidia/ prefix in..." | Re-trigger Greptile

Comment thread src/agents/model-ref-shared.test.ts
@sudhindrat sudhindrat force-pushed the fix/nvidia-model-prefix-71552 branch from db9486f to 4f42db5 Compare April 25, 2026 16:49

@fabianwilliams fabianwilliams left a comment

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.

Mirrors the existing openrouter prefix handling pattern right above. Tests cover both bare and pre-prefixed input. LGTM. Approving + merging per @pSteiny's fix-and-merge directive.

@fabianwilliams fabianwilliams merged commit f92a8ae into openclaw:main Apr 25, 2026
65 checks passed
ayesha-aziz123 pushed a commit to ayesha-aziz123/openclaw that referenced this pull request Apr 26, 2026
…Id (openclaw#71552) (openclaw#71660)

* fix(model-ref): re-add nvidia/ prefix in normalizeStaticProviderModelId (openclaw#71552)

* fix(test): use nvidia-prefixed model fixture for double-prefix guard

---------

Co-authored-by: Sudhindra Tatti <sudhi@sudhindras-mini.lan>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…Id (openclaw#71552) (openclaw#71660)

* fix(model-ref): re-add nvidia/ prefix in normalizeStaticProviderModelId (openclaw#71552)

* fix(test): use nvidia-prefixed model fixture for double-prefix guard

---------

Co-authored-by: Sudhindra Tatti <sudhi@sudhindras-mini.lan>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…Id (openclaw#71552) (openclaw#71660)

* fix(model-ref): re-add nvidia/ prefix in normalizeStaticProviderModelId (openclaw#71552)

* fix(test): use nvidia-prefixed model fixture for double-prefix guard

---------

Co-authored-by: Sudhindra Tatti <sudhi@sudhindras-mini.lan>
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
…Id (openclaw#71552) (openclaw#71660)

* fix(model-ref): re-add nvidia/ prefix in normalizeStaticProviderModelId (openclaw#71552)

* fix(test): use nvidia-prefixed model fixture for double-prefix guard

---------

Co-authored-by: Sudhindra Tatti <sudhi@sudhindras-mini.lan>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…Id (openclaw#71552) (openclaw#71660)

* fix(model-ref): re-add nvidia/ prefix in normalizeStaticProviderModelId (openclaw#71552)

* fix(test): use nvidia-prefixed model fixture for double-prefix guard

---------

Co-authored-by: Sudhindra Tatti <sudhi@sudhindras-mini.lan>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…Id (openclaw#71552) (openclaw#71660)

* fix(model-ref): re-add nvidia/ prefix in normalizeStaticProviderModelId (openclaw#71552)

* fix(test): use nvidia-prefixed model fixture for double-prefix guard

---------

Co-authored-by: Sudhindra Tatti <sudhi@sudhindras-mini.lan>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
…Id (openclaw#71552) (openclaw#71660)

* fix(model-ref): re-add nvidia/ prefix in normalizeStaticProviderModelId (openclaw#71552)

* fix(test): use nvidia-prefixed model fixture for double-prefix guard

---------

Co-authored-by: Sudhindra Tatti <sudhi@sudhindras-mini.lan>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nvidia provider sends bare model id to integrate.api.nvidia.com → HTTP 404 (vendor prefix dropped in normalizeStaticProviderModelId)

2 participants