Skip to content

[Bug]: NVIDIA provider plugin omits apiKey field, silently breaks pi-coding-agent's models.json validation #73013

@bautrey

Description

@bautrey

Symptom

Any custom provider entry in ~/.openclaw/agents/<id>/agent/models.json
without an apiKey field causes pi-coding-agent's validateConfig() to
throw, which silently drops the entire models.json. The runtime
falls through to built-in models only — every other custom provider
(codex, xai, github-copilot, etc.) registered in the same file is also
dropped if any single entry lacks apiKey.

This is a silent failure: nothing logs at warn/error level, the file
just stops loading.

Reproduction

  1. Install OpenClaw 2026.4.23 (commit a979721).
  2. Set NVIDIA_API_KEY env var.
  3. Run openclaw models list.

Expected: nvidia/nemotron-3-super-120b-a12b row tagged configured.
Actual: row tagged configured,missing.

Direct probe:

ModelRegistry.find('nvidia', 'nemotron-3-super-120b-a12b')
// => null
// Underlying error: Failed to load models.json:
//   Provider nvidia: "apiKey" is required when defining custom models

Root cause

@openclaw/nvidia-provider's catalog.buildProvider writes
{ baseUrl, api, models, ... } to models.json without an apiKey
field.

pi-coding-agent's validateConfig() (line 373-380 of
model-registry.js) requires apiKey for any non-built-in provider
that declares custom models. When apiKey is missing it throws, and
the registry falls back to built-in models only — silently discarding
every other custom provider entry in the file.

Suggested fix

The plugin should write apiKey: "NVIDIA_API_KEY" (matching the env
var name declared in the plugin's auth manifest) when persisting
catalog.buildProvider output. OpenClaw's
resolveUsableCustomProviderApiKey already recognizes the bare env-var
name and resolves to process.env.NVIDIA_API_KEY at infer time.

Alternatively: don't write to models.json at all and let runtime
resolution use the catalog hook. The same fix likely applies to any
other plugin whose provider id matches the model id prefix.

Environment

  • OpenClaw 2026.4.23 (commit a979721)
  • Linux container
  • Node 22.22.1

Workaround

Configure the provider with an explicit apiKey field in models.json,
or in openclaw.json under models.providers.<id>.


Reported by FortiumPartners after running into both bugs while wiring
NVIDIA NIM into a multi-agent NemoClaw deployment. Happy to test patches.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions