Description
nemoclaw <sandbox> inference set --provider nvidia-prod <model> (switching from a different provider) can configure the sandbox with api: "openai-responses" even though NVIDIA Build / NIM / Gemini do not expose /v1/responses. The agent then gets a hard 404 ("page not found") on every turn. The switch path runs no validation probe, so the misconfiguration is silent until first use.
Root cause
On a provider switch, resolveRuntimeInferenceApi (src/lib/actions/inference-route-api.ts) returns null because both its session and config branches are gated on currentProvider === provider. The caller runInferenceSet (src/lib/actions/inference-set.ts) then falls back to getPreferredInferenceApi(config), which reads models.providers.inference.api — the shared managed-provider block. If the previously-active provider was a compatible endpoint validated as openai-responses, that value is still there and is carried into the switch.
getSandboxInferenceConfig (src/lib/inference/config.ts) does not reset inferenceApi for nvidia-prod / nvidia-nim / gemini-api (unlike anthropic-prod, which forces anthropic-messages), so buildProviderConfig writes api: "openai-responses" for a provider that shouldSkipResponsesProbe (src/lib/validation.ts) already documents has no /v1/responses.
Steps to reproduce
- Configure a sandbox with a compatible endpoint that validates as the Responses API (so
models.providers.inference.api becomes openai-responses).
nemoclaw <sandbox> inference set --provider nvidia-prod <model>.
- Inspect the generated
openclaw.json: channels/models.providers.inference.api is openai-responses.
- Send a turn: every request 404s against NVIDIA Build, which has no
/v1/responses.
Expected
Switching to a provider without a /v1/responses endpoint always configures openai-completions, regardless of the prior provider's persisted api.
Fix
In getSandboxInferenceConfig, force inferenceApi = "openai-completions" when shouldSkipResponsesProbe(provider) is true (the canonical no-responses set: nvidia-prod, nvidia-nim, gemini-api), mirroring how anthropic-prod forces its api.
Description
nemoclaw <sandbox> inference set --provider nvidia-prod <model>(switching from a different provider) can configure the sandbox withapi: "openai-responses"even though NVIDIA Build / NIM / Gemini do not expose/v1/responses. The agent then gets a hard 404 ("page not found") on every turn. The switch path runs no validation probe, so the misconfiguration is silent until first use.Root cause
On a provider switch,
resolveRuntimeInferenceApi(src/lib/actions/inference-route-api.ts) returnsnullbecause both its session and config branches are gated oncurrentProvider === provider. The callerrunInferenceSet(src/lib/actions/inference-set.ts) then falls back togetPreferredInferenceApi(config), which readsmodels.providers.inference.api— the shared managed-provider block. If the previously-active provider was a compatible endpoint validated asopenai-responses, that value is still there and is carried into the switch.getSandboxInferenceConfig(src/lib/inference/config.ts) does not resetinferenceApifornvidia-prod/nvidia-nim/gemini-api(unlikeanthropic-prod, which forcesanthropic-messages), sobuildProviderConfigwritesapi: "openai-responses"for a provider thatshouldSkipResponsesProbe(src/lib/validation.ts) already documents has no/v1/responses.Steps to reproduce
models.providers.inference.apibecomesopenai-responses).nemoclaw <sandbox> inference set --provider nvidia-prod <model>.openclaw.json:channels/models.providers.inference.apiisopenai-responses./v1/responses.Expected
Switching to a provider without a
/v1/responsesendpoint always configuresopenai-completions, regardless of the prior provider's persisted api.Fix
In
getSandboxInferenceConfig, forceinferenceApi = "openai-completions"whenshouldSkipResponsesProbe(provider)is true (the canonical no-responses set:nvidia-prod,nvidia-nim,gemini-api), mirroring howanthropic-prodforces its api.