Skip to content

docs: refresh for v0.0.20 and document context window, max tokens, and reasoning env vars#2108

Merged
ericksoa merged 2 commits into
mainfrom
docs/context-window-max-tokens-reasoning
Apr 20, 2026
Merged

docs: refresh for v0.0.20 and document context window, max tokens, and reasoning env vars#2108
ericksoa merged 2 commits into
mainfrom
docs/context-window-max-tokens-reasoning

Conversation

@miyoungc

@miyoungc miyoungc commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Documents the NEMOCLAW_CONTEXT_WINDOW, NEMOCLAW_MAX_TOKENS, and NEMOCLAW_REASONING build-time environment variables that landed in #1956. These variables now propagate through the Dockerfile ARG chain into openclaw.json, but were not mentioned anywhere in the published docs.

Changes

  • Add a "Tune Model Metadata" section to docs/inference/switch-inference-providers.md with a variable reference table, defaults, value constraints, an example, and the nemoclaw onboard --resume --recreate-sandbox flow for applying changes to existing sandboxes.
  • Regenerate .agents/skills/nemoclaw-user-configure-inference/SKILL.md from the updated source.
  • Sync .agents/skills/nemoclaw-user-reference/references/troubleshooting.md with the current docs/reference/troubleshooting.md (brings the autogen reference back in line with the openclaw update entry added in docs: catch up documentation for v0.0.18 changes #2033).

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • make docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

AI Disclosure

  • AI-assisted — tool: Cursor

Signed-off-by: Miyoung Choi miyoungc@nvidia.com

Made with Cursor

Summary by CodeRabbit

  • Documentation
    • Added guide for tuning model metadata via build-time configuration variables.
    • Documented three new parameters for context window, max tokens, and reasoning, including accepted values, defaults, and that invalid values are ignored.
    • Clarified that changes apply during image build and require recreating a sandbox to take effect.
    • Simplified update-timeout troubleshooting with a single rebuild workflow.
    • Updated documentation versioning to include the new release.

…nv vars

Adds a "Tune Model Metadata" section to the Switch Inference Models page
covering NEMOCLAW_CONTEXT_WINDOW, NEMOCLAW_MAX_TOKENS, and
NEMOCLAW_REASONING build-time env vars landed in #1956, plus the
--recreate-sandbox flow to apply changes on existing sandboxes.

Regenerates the nemoclaw-user-configure-inference skill and syncs the
nemoclaw-user-reference troubleshooting reference so autogen output
matches the published docs.

Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Made-with: Cursor
@coderabbitai

coderabbitai Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Documentation-only changes across four files adding a new "Tune Model Metadata" section with build-time environment variables (NEMOCLAW_CONTEXT_WINDOW, NEMOCLAW_MAX_TOKENS, NEMOCLAW_REASONING), renumbering configuration steps, simplifying a troubleshooting flow, and updating docs version metadata.

Changes

Cohort / File(s) Summary
Model Metadata Configuration
.agents/skills/nemoclaw-user-configure-inference/SKILL.md, docs/inference/switch-inference-providers.md
Adds a new "Tune Model Metadata" step/section introducing three build-time env vars (NEMOCLAW_CONTEXT_WINDOW, NEMOCLAW_MAX_TOKENS, NEMOCLAW_REASONING), documents allowed values/defaults/ignored-invalid-values, states these must be set before nemoclaw onboard image build, and renumbers subsequent steps in the SKILL.md file.
Troubleshooting Updates
.agents/skills/nemoclaw-user-reference/references/troubleshooting.md
Replaces manual backup-then-recreate guidance for "openclaw update hangs or times out" with a single nemoclaw <name> rebuild command that performs backup and restores state automatically.
Docs Version & Metadata
docs/project.json, docs/versions1.json
Bumps docs/project.json version from 0.0.180.0.20 and adds 0.0.20 (preferred) and 0.0.19 entries to docs/versions1.json with corresponding URLs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through docs to tune the frame,
Set env vars so models know their name,
Steps renumbered, tidy and bright,
Rebuild fixes woes with gentle might,
I thump my foot—deploys take flight! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately summarizes the main changes: documenting three environment variables and refreshing documentation for v0.0.20, which aligns with the changeset's primary focus of adding documentation for build-time model metadata configuration and bumping the version.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/context-window-max-tokens-reasoning

Comment @coderabbitai help to get the list of available commands and usage tips.

Promotes 0.0.20 to the preferred entry in docs/versions1.json and adds
the 0.0.19 entry that was missed during the previous version cut.
conf.py regenerates docs/project.json from the preferred entry at build
time, so project.json is updated to match.

Signed-off-by: Miyoung Choi <miyoungc@nvidia.com>
Made-with: Cursor

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
.agents/skills/nemoclaw-user-configure-inference/SKILL.md (2)

198-198: Use active voice.

The phrase "Invalid values are ignored" uses passive construction.
Consider: "NemoClaw ignores invalid values, and the default bakes into the image."

Note: This file is auto-generated from docs/inference/switch-inference-providers.md.
Fix the source file and regenerate.

LLM pattern detected.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/skills/nemoclaw-user-configure-inference/SKILL.md at line 198,
Replace the passive sentence "Invalid values are ignored, and the default bakes
into the image." with an active-voice version such as "NemoClaw ignores invalid
values, and the default bakes into the image." in the source document (the line
that currently contains that exact sentence) and then regenerate the
auto-generated SKILL.md so the change propagates to
.agents/skills/nemoclaw-user-configure-inference/SKILL.md.

192-198: Clarify validation rules and warn about silent failure.

The table lists value constraints as "Positive integer (tokens)" but doesn't specify the exact validation pattern.
Based on the implementation, NEMOCLAW_CONTEXT_WINDOW and NEMOCLAW_MAX_TOKENS must match /^[1-9][0-9]*$/ (no leading zeros, no zero value), and NEMOCLAW_REASONING must be exactly the string true or false.

More importantly, when validation fails, the code silently ignores the invalid value without logging a warning or error.
Users who set NEMOCLAW_CONTEXT_WINDOW=abc will get no indication their value was rejected until they inspect the baked openclaw.json.

Consider adding a note in the source documentation (docs/inference/switch-inference-providers.md) that explains:

  • Exact validation rules (e.g., "Positive integer with no leading zeros" or "Must be exactly true or false")
  • That invalid values fail silently and users should verify the baked config if uncertain

Example:

Invalid values are silently ignored and the image uses the default value instead.
To verify that your custom value was accepted, inspect `openclaw.json` inside the sandbox after creation.

Note: This file is auto-generated from docs/inference/switch-inference-providers.md.
Fix the source file and regenerate with python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix nemoclaw-user.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/skills/nemoclaw-user-configure-inference/SKILL.md around lines 192 -
198, Update the source docs/inference/switch-inference-providers.md to clarify
exact validation rules for NEMOCLAW vars: state that NEMOCLAW_CONTEXT_WINDOW and
NEMOCLAW_MAX_TOKENS must match the regex /^[1-9][0-9]*$/ (positive integers, no
leading zeros, no zero) and NEMOCLAW_REASONING must be exactly "true" or
"false"; add a short note that invalid values are silently ignored (the default
is baked into the image) and advise users to verify their accepted values by
inspecting openclaw.json inside the sandbox; then regenerate the SKILL.md by
running python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix
nemoclaw-user so the auto-generated file reflects these clarifications.
docs/inference/switch-inference-providers.md (1)

145-145: Use active voice.

The phrase "Invalid values are ignored" uses passive construction.
Consider: "NemoClaw ignores invalid values, and the default bakes into the image."

LLM pattern detected.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/inference/switch-inference-providers.md` at line 145, Replace the
passive sentence "Invalid values are ignored, and the default bakes into the
image." with an active-voice variant such as "NemoClaw ignores invalid values,
and the default bakes into the image." — update the sentence in
switch-inference-providers.md by locating the phrase "Invalid values are
ignored" and changing it to "NemoClaw ignores invalid values" (leave or slightly
adjust the remainder for grammatical flow if needed).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/inference/switch-inference-providers.md`:
- Around line 139-145: Update the docs to distinguish build-time vs runtime
validation: state that during image build (as in onboard logic) invalid env
values are silently ignored and Dockerfile defaults apply, while at sandbox
startup the function apply_model_override() performs runtime validation, writing
detailed errors to stderr and potentially causing startup to fail; explicitly
list the validation rules for NEMOCLAW_CONTEXT_WINDOW and NEMOCLAW_MAX_TOKENS
(must be positive integers) and NEMOCLAW_REASONING (must be exactly "true" or
"false"), and remove the phrasing that implies invalid values are silently
ignored at runtime.

---

Nitpick comments:
In @.agents/skills/nemoclaw-user-configure-inference/SKILL.md:
- Line 198: Replace the passive sentence "Invalid values are ignored, and the
default bakes into the image." with an active-voice version such as "NemoClaw
ignores invalid values, and the default bakes into the image." in the source
document (the line that currently contains that exact sentence) and then
regenerate the auto-generated SKILL.md so the change propagates to
.agents/skills/nemoclaw-user-configure-inference/SKILL.md.
- Around line 192-198: Update the source
docs/inference/switch-inference-providers.md to clarify exact validation rules
for NEMOCLAW vars: state that NEMOCLAW_CONTEXT_WINDOW and NEMOCLAW_MAX_TOKENS
must match the regex /^[1-9][0-9]*$/ (positive integers, no leading zeros, no
zero) and NEMOCLAW_REASONING must be exactly "true" or "false"; add a short note
that invalid values are silently ignored (the default is baked into the image)
and advise users to verify their accepted values by inspecting openclaw.json
inside the sandbox; then regenerate the SKILL.md by running python3
scripts/docs-to-skills.py docs/ .agents/skills/ --prefix nemoclaw-user so the
auto-generated file reflects these clarifications.

In `@docs/inference/switch-inference-providers.md`:
- Line 145: Replace the passive sentence "Invalid values are ignored, and the
default bakes into the image." with an active-voice variant such as "NemoClaw
ignores invalid values, and the default bakes into the image." — update the
sentence in switch-inference-providers.md by locating the phrase "Invalid values
are ignored" and changing it to "NemoClaw ignores invalid values" (leave or
slightly adjust the remainder for grammatical flow if needed).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a135c013-a162-44a0-bd33-bdef08f2b377

📥 Commits

Reviewing files that changed from the base of the PR and between ed38d45 and 7209849.

📒 Files selected for processing (3)
  • .agents/skills/nemoclaw-user-configure-inference/SKILL.md
  • .agents/skills/nemoclaw-user-reference/references/troubleshooting.md
  • docs/inference/switch-inference-providers.md

Comment on lines +139 to +145
| Variable | Values | Default |
|---|---|---|
| `NEMOCLAW_CONTEXT_WINDOW` | Positive integer (tokens) | `131072` |
| `NEMOCLAW_MAX_TOKENS` | Positive integer (tokens) | `4096` |
| `NEMOCLAW_REASONING` | `true` or `false` | `false` |

Invalid values are ignored, and the default bakes into the image.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that the validation code does not log warnings for invalid values
rg -nP -A5 -B5 'NEMOCLAW_CONTEXT_WINDOW|NEMOCLAW_MAX_TOKENS|NEMOCLAW_REASONING' src/lib/onboard.ts | rg -i 'console\.(warn|error|log)'

Repository: NVIDIA/NemoClaw

Length of output: 41


🏁 Script executed:

# Search for where these environment variables are used/validated in the codebase
rg -n 'NEMOCLAW_CONTEXT_WINDOW|NEMOCLAW_MAX_TOKENS|NEMOCLAW_REASONING' --type ts --type js src/

Repository: NVIDIA/NemoClaw

Length of output: 807


🏁 Script executed:

# Search more broadly including config and setup files
rg -n 'NEMOCLAW_CONTEXT_WINDOW|NEMOCLAW_MAX_TOKENS|NEMOCLAW_REASONING' --type ts --type js --type json --type yaml

Repository: NVIDIA/NemoClaw

Length of output: 2211


🏁 Script executed:

# Read the validation implementation in onboard.ts
sed -n '1235,1270p' src/lib/onboard.ts

Repository: NVIDIA/NemoClaw

Length of output: 1623


🏁 Script executed:

# Read the test to understand how validation errors are checked
sed -n '361,378p' test/nemoclaw-start.test.ts

Repository: NVIDIA/NemoClaw

Length of output: 817


🏁 Script executed:

# Find where apply_model_override function is defined
rg -n 'apply_model_override' --type ts --type sh --type dockerfile src/ test/

Repository: NVIDIA/NemoClaw

Length of output: 93


🏁 Script executed:

# Search for where these error messages are generated
rg -n 'must be a positive integer|must be "true" or "false"' src/

Repository: NVIDIA/NemoClaw

Length of output: 41


🏁 Script executed:

# Search for apply_model_override without specifying dockerfile type
rg -n 'apply_model_override' --type ts --type sh src/ test/

Repository: NVIDIA/NemoClaw

Length of output: 2793


🏁 Script executed:

# Look at more context in the test file to understand what 'src' is
sed -n '335,365p' test/nemoclaw-start.test.ts

Repository: NVIDIA/NemoClaw

Length of output: 1247


🏁 Script executed:

# Look at the start of the test file to understand what 'src' is
head -50 test/nemoclaw-start.test.ts

Repository: NVIDIA/NemoClaw

Length of output: 2310


🏁 Script executed:

# Also look for where the apply_model_override function is actually generated
rg -n 'apply_model_override.*{' src/ --type ts -A 10 | head -40

Repository: NVIDIA/NemoClaw

Length of output: 168


🏁 Script executed:

# Search for where apply_model_override is generated in the codebase
rg -n 'apply_model_override' src/ --type ts -B 2 -A 2

Repository: NVIDIA/NemoClaw

Length of output: 41


🏁 Script executed:

# Let's look at the actual script that the test is checking
head -100 scripts/nemoclaw-start.sh | tail -50

Repository: NVIDIA/NemoClaw

Length of output: 2239


🏁 Script executed:

# Find where the error messages are generated in the TypeScript code
rg -n '".*must be.*"' src/lib/ --type ts

Repository: NVIDIA/NemoClaw

Length of output: 866


🏁 Script executed:

# Look for where the shell script is generated/written
rg -n 'apply_model_override' src/lib/ --type ts -B 5 -A 5

Repository: NVIDIA/NemoClaw

Length of output: 41


🏁 Script executed:

# Search for the error messages in shell script templates
rg -n 'must be a positive integer' --type sh --type ts

Repository: NVIDIA/NemoClaw

Length of output: 758


🏁 Script executed:

# Look for where apply_model_override function might be generated or templated
rg -n 'apply_model_override' src/lib/onboard.ts -B 5 -A 10

Repository: NVIDIA/NemoClaw

Length of output: 41


🏁 Script executed:

# Check if nemoclaw-start.sh is a static file or generated
ls -la scripts/nemoclaw-start.sh
file scripts/nemoclaw-start.sh
head -20 scripts/nemoclaw-start.sh

Repository: NVIDIA/NemoClaw

Length of output: 1429


🏁 Script executed:

# Look at the actual apply_model_override function in the shell script
sed -n '250,310p' scripts/nemoclaw-start.sh

Repository: NVIDIA/NemoClaw

Length of output: 2583


🏁 Script executed:

# Check for NEMOCLAW_REASONING validation in the shell script
sed -n '280,300p' scripts/nemoclaw-start.sh

Repository: NVIDIA/NemoClaw

Length of output: 937


Consider clarifying validation behavior — values are not silently ignored at runtime.

The current text states "Invalid values are ignored, and the default bakes into the image," which accurately describes build-time behavior (in src/lib/onboard.ts). However, this may mislead readers about runtime validation: at sandbox startup, the apply_model_override() function validates these environment variables and logs detailed errors to stderr if they are invalid, rather than silently ignoring them.

For clarity, update the explanation to distinguish build-time and runtime:

  • Build-time (image creation): Invalid values are silently ignored; defaults from the Dockerfile apply.
  • Runtime (sandbox startup): Invalid values trigger validation errors logged to stderr; startup may fail depending on how the error is handled.

You may also clarify the exact validation rules: NEMOCLAW_CONTEXT_WINDOW and NEMOCLAW_MAX_TOKENS must be positive integers; NEMOCLAW_REASONING must be exactly "true" or "false".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/inference/switch-inference-providers.md` around lines 139 - 145, Update
the docs to distinguish build-time vs runtime validation: state that during
image build (as in onboard logic) invalid env values are silently ignored and
Dockerfile defaults apply, while at sandbox startup the function
apply_model_override() performs runtime validation, writing detailed errors to
stderr and potentially causing startup to fail; explicitly list the validation
rules for NEMOCLAW_CONTEXT_WINDOW and NEMOCLAW_MAX_TOKENS (must be positive
integers) and NEMOCLAW_REASONING (must be exactly "true" or "false"), and remove
the phrasing that implies invalid values are silently ignored at runtime.

@miyoungc miyoungc changed the title docs(inference): document context window, max tokens, and reasoning env vars docs: refresh for v0.0.20 and document context window, max tokens, and reasoning env vars Apr 20, 2026

@ericksoa ericksoa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs-only change, clean diff, CI green. LGTM.

@ericksoa ericksoa merged commit a7dca9c into main Apr 20, 2026
16 checks passed
@ericksoa ericksoa deleted the docs/context-window-max-tokens-reasoning branch April 20, 2026 19:40
@wscurran wscurran added area: docs Documentation, examples, guides, or docs build chore Build, CI, dependency, or tooling maintenance and removed documentation labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation, examples, guides, or docs build chore Build, CI, dependency, or tooling maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants