Skip to content

managed llama.cpp request guard caps request bodies at 16 KB, so every OpenClaw agent turn is rejected with HTTP 413 #10239

Closed

Description

@wangericnv

Summary

The managed llama.cpp request guard is now deployed and enforcing, but its request-body ceiling is set to 16384 bytes. A normal OpenClaw agent turn (system prompt + tool catalog + user message) is larger than that, so every agent request through the managed route is rejected with HTTP 413 and the agent reports LLM request failed.

Small direct chat requests succeed, the inference route is healthy from inside the sandbox, and doctor reports healthy — so the sandbox looks correct while the product's own default agent cannot be used at all.

This is the state left after the two earlier guard defects were fixed: the guard used to be absent entirely (#9600), and an oversized request used to take down the runtime (#9592). The guard now exists and returns 413 instead of crashing — but the limit it enforces is below the product's own agent traffic.

Environment

Device DGX Spark (NVIDIA GB10)
OS Ubuntu 24.04.4 LTS, aarch64
NemoClaw v0.0.114
OpenShell 0.0.106
Docker 29.2.1
Model muse-glimmer (managed llama.cpp)

Platform scope: reproduced on DGX Spark only; other platforms not tested.
Regression: unknown — the guard was not deployed in earlier builds, so this ceiling was never previously reachable.

Steps to reproduce

  1. Onboard a managed llama.cpp sandbox:
    NEMOCLAW_EXPERIMENTAL=1 NEMOCLAW_PROVIDER=install-llama-cpp NEMOCLAW_YES=1 \
      nemoclaw onboard --non-interactive --name llama-port-happy
  2. Confirm it looks healthy: nemoclaw llama-port-happy status and ... doctor
  3. Run the product's own agent through the managed route:
    nemoclaw llama-port-happy exec --no-tty -- openclaw agent --agent main -m "Reply with exactly: LLAMA_OK"
  4. Read the guard ceiling: docker inspect <llama container> --format '{{json .Args}}' → --max-request-body-bytes
  5. Bracket the limit directly against the guard:
    K=$(cat ~/.nemoclaw/managed-llama-cpp/api-key)
    for N in 8000 20000; do
      BODY=$(python3 -c "import json;print(json.dumps({'model':'default','messages':[{'role':'user','content':'x'*$N}]}))")
      curl -s -o /dev/null -w "%{http_code}\n" -X POST http://127.0.0.1:8081/v1/chat/completions \
        -H "Authorization: Bearer $K" -H 'Content-Type: application/json' -d "$BODY"
    done

Expected

A managed llama.cpp sandbox that reports Ready and healthy can serve the product's own default agent; step 3 returns LLAMA_OK.

Actual

  • Step 2 — Phase: Ready, provider llama-cpp-local, Inference: healthy; doctor exits 0 with [ok] Inference route (gateway): https://inference.local/v1/models reachable / Summary: healthy.
  • Step 3 — the agent prints LLM request failed. and returns no answer.
  • Step 4 — the guard runs with --max-request-body-bytes 16384.
  • Step 5 — 8067-byte body → 200; 20067-byte body → 413.

Gateway log during the agent turn

[provider-transport-fetch] [model-fetch] response provider=inference api=openai-completions model=muse-glimmer status=413
[agent/embedded] embedded run agent end: isError=true model=muse-glimmer provider=inference
                 error=LLM request failed. rawError=413 Request body exceeds the declared limit.
[agent/embedded] [empty-error-retry] stopReason=error non-visible-output; resubmitting attempt=1/3
... attempts 2/3 and 3/3 fail identically ...
LLM request failed.

Guard configuration (limits only):

--max-request-body-bytes   = 16384
--max-request-header-bytes = 32768
--request-timeout-seconds  = 900
--listen-port  = 8081
--upstream-host = 127.0.0.1
--upstream-port = 8082

Controls run (rule out an unhealthy backend or broken route)

Check Result
Direct guard chat, small body 200, valid completion from muse-glimmer
Inside sandbox, /v1/models 200
Inside sandbox, /v1/chat/completions 200, valid completion
Body bracketing at the guard 8067 B → 200, 20067 B → 413

Related, deliberately checked — not duplicates

Activity

  1. self-assigned this
    on Aug 25, 2026
  2. jason-ma-nv commented on Aug 25, 2026

    @jason-ma-nv
    Collaborator

    Investigated as part of the auto-fix loop. Deferring — this is a product/safety-tradeoff decision, not a routine bug fix.

    The 16 KiB ceiling is not an arbitrary default; it's the hardware-qualified safety boundary for this exact model.

    managed-inference/recipes/llama-cpp.muse-glimmer-30b.spark-single.v1.yaml sets spec.serve.limits.maxRequestBodyBytes: 16384 (consumed by buildLlamaCppRequestGuardCommandArgv in src/lib/inference/llama-cpp/host-local-runtime.ts:433-465, which passes it to the request guard as --max-request-body-bytes). That value came from #9669 ("bound Spark llama.cpp request bodies"), which fixed #9592: on real DGX Spark GB10 hardware, the raw Muse Glimmer llama.cpp runtime crashes and reloads the model on an exact 50,000-byte request — not an OOM, a hard runtime failure. #9669's own hardware qualification table shows the next candidate boundary they tried, 32,768 bytes, also failed (upstream became unavailable, 502s) — 16,384 was the largest boundary that passed. The Nemotron recipe in the same repo is qualified separately at 32 KiB precisely because different models/configs have different safe ceilings on this hardware.

    So simply raising maxRequestBodyBytes in the Muse Glimmer recipe to fit real OpenClaw agent traffic (system prompt + tool catalog + user message) risks reintroducing the exact crash #9669 was written to prevent — the guard is doing its job; the ceiling it enforces is the actual hardware/runtime limit, not a misconfigured default.

    Why this needs a maintainer/product decision, not an unattended fix:

    1. A new, larger boundary can only be established by repeating the hardware qualification fix(inference): bound Spark llama.cpp request bodies #9669 already did (real DGX Spark GB10 + the exact model, bisecting for the largest request body that doesn't crash or degrade the runtime) — that's not reproducible on the auto-fix loop's current hosts (neither has OpenShell/GPU/the managed llama.cpp image deployed).
    2. If hardware qualification shows Muse Glimmer genuinely cannot safely serve the product's own default agent request size at any usable limit, the fix isn't a config bump at all — it's either a llama.cpp server-arg change (context/batch size affecting how it buffers requests), a different quantization/build, or descoping Muse Glimmer as a default-agent-compatible profile. Any of those needs product-scope sign-off per this repo's Product Scope Gate.
    3. This is a declared security/reliability limit on a sensitive path (inference guard) with a paper trail of prior incidents ([DGX Spark][Inference] a 50 KB authenticated chat request takes down the managed llama.cpp runtime and forces a full model reload #9592, [DGX Spark][Inference] managed llama.cpp request guard is never deployed, so every serve limit declared in the shipped catalog is unenforced #9600) — changing it deserves the same rigor (hardware evidence table) the original fix used, not a same-loop bump.

    Unassigning so a maintainer with DGX Spark hardware access (cc the #9669 author's context) can decide whether to re-qualify a higher boundary, adjust the runtime config, or scope Muse Glimmer differently for default-agent traffic.

  3. removed their assignment
    on Aug 25, 2026
  4. added
    area: inference
    integration: openclaw
    platform: arm64
    platform: dgx-spark
    platform: ubuntu
    on Aug 25, 2026
  5. added theissue type on Aug 25, 2026
  6. prekshivyas commented on Aug 25, 2026

    @prekshivyas
    Collaborator

    Decision: Accept

    Reason and placement: Core NemoClaw. Automatic DGX Spark onboarding must select a qualified managed llama.cpp preset that can serve a default OpenClaw request. Keep the Muse Glimmer request guard at its qualified 16,384-byte limit and make that preset explicit-only. Select Nemotron automatically with its separately qualified 32,768-byte limit. Do not migrate existing Muse Glimmer owners automatically.

    Accountable maintainer: @prekshivyas

    Validation plan:

    • Confirm the managed inference catalog keeps Muse Glimmer explicit-only and Nemotron automatic.
    • Confirm automatic DGX Spark selection chooses Nemotron.
    • Confirm explicit Muse Glimmer selection remains available.
    • Confirm equal-priority automatic selections remain rejected.
    • Run the catalog check, both focused behavior-test files, the test-title check, and the CLI type check.
  7. added a commit that references this issue on Aug 25, 2026
    5ca34cd
  8. added
    area: local-models
    area: providers
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area: inferencearea: local-modelsarea: providersintegration: openclawplatform: arm64platform: dgx-sparkplatform: ubuntu

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions