anomalyco / anomalyco/opencode
[Bug] Model resolution fails when the model ID itself contains "/" (NVIDIA NIM prefixed keys) — "Model not found" suggests the exact same ID
@nexxeln is already working on this.
Since Aug 24, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Model references do not resolve when the model ID itself contains a slash — notably all NVIDIA NIM models, whose API-facing IDs embed the vendor prefix (e.g. the model's real ID is literally nvidia/nemotron-3-ultra-550b-a55b, so under provider nvidia the registry key is nvidia/nemotron-3-ultra-550b-a55b).
A ref written in the natural bare form nvidia/nemotron-3-ultra-550b-a55b splits at the first slash → providerID=nvidia, modelID=nemotron-3-ultra-550b-a55b (bare) → the exact-match lookup misses the prefixed key → the fuzzy suggester then offers the real key, whose rendered form is byte-identical to the requested ref, producing this error:
ProviderModelNotFoundError: Model not found: nvidia/nemotron-3-ultra-550b-a55b. Did you mean: nvidia/nemotron-3-ultra-550b-a55b?
The identical-ID suggestion is this bug's structural signature — it is generated structurally whenever this class of miss occurs, not cosmetically. It also makes the error look absurd ("did you mean the thing I just asked for?").
This cannot be worked around client-side by renaming the model key: the key IS the API-facing model id that must be sent to the NIM endpoint, so it has to keep its prefix.
Related but distinct: #39926 reports the mirror-image failure of the same first-slash split, where a URL-based provider ID breaks. This report covers model IDs containing / under a normal named provider.
OpenCode version
1.18.20
Steps to reproduce
- Authenticate the NVIDIA provider (
opencode auth login nvidia). The registry then contains slash-prefixed keys such asnvidia/nemotron-3-ultra-550b-a55b(same shape asnvidia/moonshotai/kimi-k2.6reported in #40911). - Pin the model in bare form (single provider prefix) somewhere that resolves at session start — e.g. an agent file frontmatter:
--- model: nvidia/nemotron-3-ultra-550b-a55b --- - Spawn a fresh session with that agent.
- Observe the immediate failure below (~32 ms after session start, zero inference attempts / zero tokens).
Contrast step: reference the same model via the doubled full-key form nvidia/nvidia/nemotron-3-ultra-550b-a55b (= providerID nvidia + modelID nvidia/nemotron-3-ultra-550b-a55b). It resolves fine — which is why the same route succeeds mid-session in already-running sessions yet fails deterministically on every fresh spawn of a bare-form pin.
Observed behavior
Fresh spawn on the bare-form pin fails before any API call:
Model not found: nvidia/nemotron-3-ultra-550b-a55b. Did you mean: nvidia/nemotron-3-ultra-550b-a55b?
The suggestion is byte-identical to the requested ID. The model was simultaneously confirmed live in NVIDIA's catalog (present in /v1/models throughout the observation window), so this is a resolution defect, not catalog absence.
Same model succeeds mid-session when referenced through the already-resolved doubled form.
Expected behavior
- A bare-form ref
nvidia/nemotron-3-ultra-550b-a55bshould resolve to the registry keynvidia/nemotron-3-ultra-550b-a55bunder providernvidia— i.e., resolution should tolerate model IDs that themselves contain slashes. - At minimum, the suggester should never offer a candidate whose rendered
<providerID>/<modelID>is identical to the requested ref.
Suggested fix direction
- Resolution: after splitting
<provider>/<rest>and missing on exact match, attempt to interpret<rest>as the full model ID (exact/suffix match against that provider's keys) before falling back to fuzzy suggestions — this makes the bare form resolve the prefixed key. - Suggester hygiene: filter out suggestions equal to the requested ref. "Did you mean X?" where X === requested is misleading and masks the actual failure mode.
- Diagnostics (optional): when the would-be suggestion equals the request, emit a distinct message (e.g. "model ID may itself contain '/'; try doubling the provider segment") so scripts can recover.
Impact
Any agent/config pin or script that names a NIM model in the natural bare form fails deterministically at fresh-session spawn while the same model keeps working in sessions that were started interactively — intermittent-looking in aggregate, deterministic-by-form in reality. Easy to misdiagnose as provider outage/rate limiting.
Environment: opencode 1.18.20 standalone binary, macOS (darwin arm64), NVIDIA NIM endpoint https://integrate.api.nvidia.com/v1.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.