[MacOS] Invalid model Id was ignored and returned successful response
Description
When a request is sent to inference.local with a non-existent model ID (e.g., "model":"this-model-does-not-exist"), the OpenShell gateway does not validate the model and instead silently routes the request to the provider configured in the inference route. The request succeeds with a 200 response and a valid completion from the route-configured model (llama3.2:1b), completely ignoring the requested model. The gateway should validate the model ID and return a clear error when the requested model doesn't exist.Steps to reproduce
- Complete
nemoclaw setupsuccessfully - Set inference route:
openshell inference set --provider ollama-local --model llama3.2:1b - Connect to sandbox:
nemoclaw connect - Send a request with a non-existent model ID: curl -s https://inference.local/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model":"this-model-does-not-exist","messages":[{"role":"user","content":"say hello"}]}'
llama3.2:1b):
{"id":"chatcmpl-829","object":"chat.completion","model":"llama3.2:1b","choices":[{"index":0,"message":{"role":"assistant","content":"Hello."},"finish_reason":"stop"}],"usage":{"prompt_tokens":27,"completion_tokens":3,"total_tokens":30}}
Steps to reproduce
No steps provided.
[NVB# 5982631]
[NVB#5982631]
@zNeill can I attempt this
Fixed — fix(cli): fail fast on invalid model catalog payloads (752af4d2) now validates model IDs against the catalog and fails fast rather than silently returning a successful response. Closing as resolved.
This issue is still reproducible with Nemoclaw v0.0.15. Tried on all platforms. Bug will remain open. Reopening this github issue. Now the Local Ollama model available is openshell inference set --provider ollama-local --model qwen2.5:7b
When we run the curl command for a model name "this-model-does-not-exist", it still returns success(200) with model name "qwen2.5:7b"
sandbox@prachi-ollama:~$ curl https://inference.local/v1/chat/completions -H "Content-Type: application/json" -d '{"model":"this-model-does-not-exist","messages":[{"role":"user","content":"say hello"}]}' {"id":"chatcmpl-92","object":"chat.completion","created":1776213152,"model":"qwen2.5:7b","system_fingerprint":"fp_ollama","choices":[{"index":0,"message":{"role":"assistant","content":"Hello! How can I assist you today?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":31,"completion_tokens":10,"total_tokens":41}}
The issue is still reproducible on NemoClaw v0.0.30. Opened new nvbug
Hi @zNeill, thanks for the report. This one has been open a while: around 37 releases have shipped since v0.0.30 (we are now on v0.0.67), with onboarding, the sandbox runtime, config generation, and many platform paths reworked along the way. Could you check whether this is still happening for you on the latest version? Cheers!
@zNeill , @PrachiShevate-nv
Findings — still reproduces on main; the fix belongs in the OpenShell gateway, not NemoClaw
I traced this on current main. The silent-success behavior is still present, and the reason it survived 752af4d2 is that the validation has to live in a layer that NemoClaw doesn't own. Evidence below.
Root cause
Rejecting an unknown model requires inspecting the live /v1/chat/completions body at the component that terminates the request and forwards to the provider. That component is the OpenShell gateway (inference.local), which is external to this repo. NemoClaw only configures the route — it is never on the request path, so it cannot see or reject the request.
inference.localis OpenShell's internal gateway hostname; it proxies to the configured provider —nemoclaw-blueprint/policies/openclaw-sandbox.yaml:90- Request path has no NemoClaw hop:
Sandbox → OpenShell Gateway → Model Router → provider—docs/inference/inference-options.mdx:131 nemoclaw inference setis a thin wrapper overopenshell inference set—src/lib/actions/inference-set.ts:330; the CLI itself redirects users to OpenShell for this op —src/commands/inference/set.ts:73- The only in-sandbox interception NemoClaw owns is a client-side Node preload, which by its own scope note is not loaded by non-Node callers like the
curlin this repro —nemoclaw-blueprint/scripts/nemotron-inference-fix.js:113
Why 752af4d2 didn't hold
That commit hardened the setup-time catalog payload parser used by the onboard wizard — parseModelIds now throws on a malformed /v1/models response (src/lib/inference/provider-models.ts:37). That is config-time validation; it never touched per-request routing at the gateway, so the runtime path is unchanged. Consistent with QA re-reproducing on v0.0.15 and v0.0.30.
Recommendation
Authoritative fix → OpenShell gateway: validate the request model against the active route/catalog and return a 4xx (e.g. model_not_found) instead of silently serving the pinned model. This is the only layer that sees all clients (agent and raw curl). Suggest cross-filing/transferring to the OpenShell repo and tracking against NVBug 6128801.
@hunglp6d @zNeill
Verified on v0.0.67. This bug/issue should stay open until there is a openshell gateway fix for this, and here is my explanation and logs.
The original symptom (invalid model giving 200 + a valid completion from another model) is no longer reproducible in your environment,
But that is only because inference.local itself is broken (NXDOMAIN), so the system never reaches the gateway to show the correct behavior.
Therefore the underlying issue (gateway must validate model and return a clear error) still needs an authoritative OpenShell-side fix, and the current result does not prove it’s fixed
Retest on MacOS / DGX Spark – inference.local DNS broken, main behavior not verifiable yet
Environment:
NemoClaw v0.0.67
OpenShell 0.0.44 (docker)
Sandbox: test-sb (default)
Retest steps (matching original repro):
Set inference route (local Ollama or NVIDIA Endpoints), confirm via nemoclaw test-sb status that inference is configured.
Inside sandbox/host, run:
nslookup inference.local
Output:
Server: 10.126.4.154
Address: 10.126.4.154#53
** server can't find inference.local: NXDOMAIN
So inference.local currently has no DNS record; the privacy router hostname does not resolve.knowledge.broadcom+1
Run the invalid-model curl test:
curl -s -o /dev/null -w "%{http_code}\n" https://inference.local/v1/chat/completions
-H "Content-Type: application/json"
-d '{"model":"this-model-does-not-exist","messages":[{"role":"user","content":"say hello"}]}'
Result: 000 and
curl: (6) Could not resolve host: inference.local
This means the request never reaches the gateway at all; curl reports http_code 000 when no HTTP response is received.everything.curl+1
Conclusion:
The original bad behavior for this bug (HTTP 200 + completion from a different model when "model":"this-model-does-not-exist") is not currently happening, but only because inference.local cannot be resolved — the gateway is not in the path.
As the latest analysis notes, the fix for this issue must live in the OpenShell gateway, since NemoClaw only configures inference.local and is not on the request path. The current DGX Spark environment shows a new reachability problem (NXDOMAIN for inference.local), which prevents verification of the intended gateway-side validation.nvidiapaste.txt
Until inference.local is wired correctly again (DNS record present, curl can reach /v1/...), we cannot confirm that the gateway validates the model field and returns a proper 4xx instead of silently serving the pinned route model.
Recommendation:
Keep NVBug 6128801 open and track it against the OpenShell gateway, as already suggested in the comments.
Once inference.local DNS is fixed on DGX Spark, re-run the invalid-model curl test and verify that the gateway returns a 4xx (e.g. model_not_found) rather than 200 + a completion from the route model.
The bug isn’t “fixed” in the sense of the gateway doing the right thing;
Your current environment just has inference.local broken at DNS, which blocks verification.
@PrachiShevate-nv Was this open in OpenShell module of NVBugs ?
@hunglp6d We usually open the NVBug in NemoClaw module. But if you / anyone else can help open this Github issue in the Openshell module, then we can keep tracking the Nvbug until the Openshell issue for this is resolved. Thanks, please let me know.
@PrachiShevate-nv
Update — verified against OpenShell source (HEAD a5161d0b): this is by-design, not a gateway defect.
prepare_backend_request (crates/openshell-router/src/backend.rs:297) unconditionally overwrites the request model with the route-configured model — intentionally, per the code comments: "so a sandbox cannot pick a different upstream model than what inference set configured" (:204). There is no request-time model validation. So {"model":"this-model-does-not-exist"} → HTTP 200 + completion from the pinned model is the deliberate result of model-pinning; the requested model is ignored by design. NemoClaw only configures the route and isn't on the request path, so it can't change this.
Recommendation: close #994 as by-design — or, optionally, keep it open until OpenShell #2063 (just created) lands. Either way the improvement (surface/optionally reject a silently-overwritten model) isn't dropped: it's reclassified bug → enhancement, tracked in OpenShell #2063.
Thanks @hunglp6d for the root-cause analysis and for opening OpenShell #2063. Understood — this is by-design model-pinning behavior, not a gateway defect.
Closing #994 as by-design. The enhancement request (surface or optionally reject a silently-overwritten model) is now tracked in OpenShell #2063. I'll update NVBug 6128801 to link OpenShell #2063 and reclassify from Bug → Enhancement.