Skip to content

docs: clarify sub-agent setup prerequisites - #5521

Merged
cv merged 1 commit into
mainfrom
docs/fix-sub-agent-prereqs-5077
Jun 17, 2026
Merged

cv merged 1 commit into
mainfrom
docs/fix-sub-agent-prereqs-5077

Conversation

@miyoungc

@miyoungc miyoungc commented Jun 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Clarifies the task-specific sub-agent setup guide so readers know they need an installed NemoClaw host and a running sandbox before using Docker-based config edits.
The guide now also fills in the missing runnable steps for patching openclaw.json, uploading sub-agent credentials, and verifying hot reload.

Related Issue

Fixes #5077

Changes

  • Add a prerequisite callout before the docker exec workflow and a fail-fast guard when SANDBOX_CTR is empty.
  • Show how to run the Omni demo openclaw-patch.py helper to create /tmp/openclaw.updated.json.
  • Add commands to upload auth-profiles.json, set permissions, and verify the vision-operator sub-agent through logs and agents list.

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

  • Git hooks passed during commit and push, or npx prek run --from-ref main --to-ref HEAD passes
  • Targeted tests pass for changed behavior
  • Full npm test passes (broad runtime changes only)
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • npm run 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)

Verification run:

  • npm run docs passed with 0 errors and 1 existing Fern upgrade warning.
  • git diff --check main...HEAD passed.

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

Summary by CodeRabbit

  • Documentation
    • Enhanced sub-agent setup guide with detailed step-by-step configuration instructions
    • Added security best practices for protecting API credentials
    • Included verification procedures to confirm successful deployment

@miyoungc miyoungc added the area: docs Documentation, examples, guides, or docs build label Jun 16, 2026
@miyoungc miyoungc self-assigned this Jun 16, 2026
@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The set-up-sub-agent.mdx documentation is updated to add a prerequisite note requiring Quickstart completion, an expanded sandbox container discovery/config workflow with a security warning, a new post-upload verification step using NemoClaw CLI commands, and concrete auth-profiles.json upload and permission commands for sub-agent credentials.

Changes

Sub-Agent Setup Documentation

Layer / File(s) Summary
Sandbox config prereqs, container discovery, and security warning
docs/inference/set-up-sub-agent.mdx
Adds a Note block requiring the Quickstart to be complete and the sandbox to be running before executing docker exec commands. Expands the container discovery and openclaw-patch.py invocation steps, and adds an explicit warning against committing temporary JSON files containing real API keys.
Post-upload hot reload verification
docs/inference/set-up-sub-agent.mdx
Adds a new verification section after config upload, instructing users to check /tmp/gateway.log and run nemoclaw logs and nemoclaw agents list --json to confirm hot reload and that vision-operator is present in the agent list.
auth-profiles.json upload and file permissions
docs/inference/set-up-sub-agent.mdx
Replaces prior credential guidance with explicit commands to create /tmp/auth-profiles.json, upload it into the vision-operator agent directory inside the sandbox, and set restrictive file permissions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • NVIDIA/NemoClaw#5247: Modifies the same docs/inference/set-up-sub-agent.mdx file, updating Docker-driver $SANDBOX_CTR exec flow, config-hash handling, and auth/ownership guidance for task-specific sub-agents.

Suggested labels

area: skills, documentation

Poem

🐰 A rabbit hopped into the docs one day,
And found the prereqs had gone astray!
"Complete the Quickstart!" the Note now cries,
Check the gateway log with your own eyes.
Commit no secrets, the warning's clear —
The sub-agents are configured, never fear! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main objective of the PR: clarifying sub-agent setup prerequisites in documentation.
Linked Issues check ✅ Passed The PR addresses all primary requirements from issue #5077: adding prerequisite callout for NemoClaw installation and running sandbox, including steps for using openclaw-patch.py helper, uploading auth-profiles.json, and verifying hot reload through logs.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the documentation update requested in issue #5077; no unrelated alterations to code or other documentation files are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/fix-sub-agent-prereqs-5077

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

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

E2E Advisor Recommendation

Required E2E: None
Optional E2E: None

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • None. No E2E is recommended because this PR changes only documentation content under docs/. It does not alter executable code, packaged assets, CI workflows, tests, sandbox configuration, credentials logic, network policy, inference routing, or any user-flow implementation.

Optional E2E

  • None.

New E2E recommendations

  • None.

@github-actions

Copy link
Copy Markdown
Contributor

Vitest E2E Scenario Recommendation

Required Vitest E2E scenarios: None
Optional Vitest E2E scenarios: None

Workflow run

Full Vitest E2E advisor summary

Vitest E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required Vitest E2E scenarios

  • None. Docs-only change outside test/e2e-scenario/ and the Vitest scenario workflow; it cannot affect Vitest scenario behavior.

Optional Vitest E2E scenarios

  • None.

Relevant changed files

  • None.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 1 worth checking, 1 nice ideas
Top item: Tighten API key handling in the sample commands

Review findings

🛠️ Needs attention

  • None.

🔎 Worth checking

  • Avoid exposing provider keys through argv and leftover temp files (docs/inference/set-up-sub-agent.mdx:83): The new walkthrough passes "$NVIDIA_API_KEY" as a positional argument to the demo patch helper and creates credential-bearing files under /tmp. Command-line arguments can be visible to other local processes or audit tooling, and /tmp/openclaw.updated.json plus /tmp/auth-profiles.json may retain real API keys after the walkthrough. The page also asks users to run a demo helper with a live API key without pinning or verifying the demo asset revision.
    • Recommendation: Prefer a helper interface that reads the key from stdin or a protected environment/file path rather than argv. If the external helper cannot change here, add defensive guidance such as using a trusted/pinned demo checkout, setting umask 077 or chmod 600 before creating secret-bearing files, and removing /tmp/openclaw.updated.json and /tmp/auth-profiles.json after upload.
    • Evidence: New commands include `python3 "$VLM_DEMO_DIR/vlm-subagent/openclaw-patch.py" "$NVIDIA_API_KEY" < /tmp/openclaw.json > /tmp/openclaw.updated.json` and instructions to create `/tmp/auth-profiles.json` with a provider key.

🌱 Nice ideas

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/inference/set-up-sub-agent.mdx (1)

93-100: ⚠️ Potential issue | 🟡 Minor

Clarify that the config upload step is intentionally for mutable state, not the hardened posture.

The documentation on line 90 already states "In the default mutable state, this keeps the local hash consistent but does not make it tamper-proof," and line 91 defers hardening to "NemoClaw runtime controls."
However, the command block itself does not make this distinction explicit.
Consider adding a brief note above the code block (before line 93) to clarify: "The following commands upload the patched config for immediate use in the default mutable state; they do not provide tamper-proofing. Harden the config using NemoClaw runtime controls separately."
This resolves the reviewer's concern that chown sandbox:sandbox with chmod 444 allows the sandbox user to revert permissions, which contradicts a "hardened" intent.
The commands are correct for their intended mutable-state purpose; they just need clearer context in the example.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/inference/set-up-sub-agent.mdx` around lines 93 - 100, Add a clarifying
note above the bash code block containing the docker exec commands for uploading
the patched config. The note should explicitly state that these commands upload
the patched config for immediate use in the default mutable state and do not
provide tamper-proofing, with hardening to be handled separately using NemoClaw
runtime controls. This clarification will resolve confusion about the chmod and
chown operations (which are appropriate for mutable state) and align the code
block with the context already provided in the surrounding documentation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/inference/set-up-sub-agent.mdx`:
- Around line 79-87: The command example in the documentation passes the
NVIDIA_API_KEY as a positional argument to the openclaw-patch.py script, which
exposes the secret in shell history and process listings. Update the code block
to instead export NVIDIA_API_KEY as an environment variable before running the
script, and remove the "$NVIDIA_API_KEY" positional argument from the python3
command invocation. Verify with the vlm-demo maintainers that the
openclaw-patch.py script properly supports reading the API key from the
NVIDIA_API_KEY environment variable, or confirm if the recommended approach is
to use apply-omni-subagent.sh from the openclaw-omni-demo folder instead.

---

Outside diff comments:
In `@docs/inference/set-up-sub-agent.mdx`:
- Around line 93-100: Add a clarifying note above the bash code block containing
the docker exec commands for uploading the patched config. The note should
explicitly state that these commands upload the patched config for immediate use
in the default mutable state and do not provide tamper-proofing, with hardening
to be handled separately using NemoClaw runtime controls. This clarification
will resolve confusion about the chmod and chown operations (which are
appropriate for mutable state) and align the code block with the context already
provided in the surrounding documentation.
🪄 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: Enterprise

Run ID: d516ff3f-3485-46bf-b685-4c8aadc14594

📥 Commits

Reviewing files that changed from the base of the PR and between c2c6590 and ec7918c.

📒 Files selected for processing (1)
  • docs/inference/set-up-sub-agent.mdx

Comment on lines +79 to +87
Set `VLM_DEMO_DIR` to the local `vlm-demo` directory from the demo assets, then run the patch helper:

```bash
export VLM_DEMO_DIR=/path/to/nemoclaw-demos/vlm-demo
python3 "$VLM_DEMO_DIR/vlm-subagent/openclaw-patch.py" "$NVIDIA_API_KEY" < /tmp/openclaw.json > /tmp/openclaw.updated.json
```

The helper reads `/tmp/openclaw.json` from standard input, adds the Omni provider and `vision-operator` entry, and writes the patched config to `/tmp/openclaw.updated.json`.
Do not commit `/tmp/openclaw.updated.json` or any other file that contains a real API key.

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 | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

helper=$(fd -a 'openclaw-patch.py' . | head -n1)
sed -n '1,220p' "$helper"
rg -n --context 2 'argparse|sys\.argv|NVIDIA_API_KEY|openclaw-patch' "$(dirname "$helper")"

Repository: NVIDIA/NemoClaw

Length of output: 103


🏁 Script executed:

git ls-files | grep -i 'openclaw-patch\|vlm-demo' | head -20

Repository: NVIDIA/NemoClaw

Length of output: 41


🏁 Script executed:

fd -type f -name '*patch*.py' | grep -v node_modules | head -20

Repository: NVIDIA/NemoClaw

Length of output: 230


🏁 Script executed:

rg -l 'openclaw-patch' --type python

Repository: NVIDIA/NemoClaw

Length of output: 90


🏁 Script executed:

rg -i 'vlm-demo|openclaw-patch' --max-count 20

Repository: NVIDIA/NemoClaw

Length of output: 3377


🏁 Script executed:

cat docs/inference/set-up-sub-agent.mdx | head -100

Repository: NVIDIA/NemoClaw

Length of output: 6305


🌐 Web query:

openclaw-patch.py NVIDIA_API_KEY brevdev nemoclaw-demos vlm-demo usage

💡 Result:

The term openclaw-patch.py refers to a specific utility script provided within the brevdev/nemoclaw-demos repository [1][2], designed to help users configure and patch OpenClaw environments, particularly for setting up advanced sub-agents like the Vision Language Model (VLM) demo [3][2]. Usage Summary: 1. Context and Purpose: The script is part of the vlm-demo and openclaw-omni-demo workflows [1][3][2]. It is used to programmatically modify the OpenClaw configuration (openclaw.json) to include auxiliary providers, such as the NVIDIA Omni provider, and to update agent configurations for task-specific delegation [3][2]. 2. NVIDIA API Key: To use the NVIDIA provider (required for these demos), you must set the NVIDIA_API_KEY environment variable [4][3]. This key is obtained from build.nvidia.com and follows the nvapi- prefix format [4][5][6]. OpenClaw natively recognizes this variable for authentication without needing explicit provider configuration in many cases [4]. 3. Patching Workflow: When running the VLM or Omni sub-agent demos, the workflow typically involves: - Using the provided openclaw-patch.py script to automate the injection of the sub-agent provider and agent list settings into your local openclaw.json [3][2]. - Ensuring the sandbox environment is correctly configured with the necessary network policies and credentials [3][7][2]. - Validating the setup via provided verification scripts (e.g., verify-omni-demo.sh) [3]. Important Technical Notes: - Config Management: OpenClaw has evolved its configuration management. While older or community workflows like those in brevdev/nemoclaw-demos use custom scripts like openclaw-patch.py [2], recent versions of OpenClaw have introduced a native openclaw config apply command to handle JSON5 configuration patches directly [8]. - Plugin Caveats: Be aware that some older versions of the NVIDIA provider plugin had issues with correctly persisting API keys, which could lead to validation errors in models.json [9]. Ensure your OpenClaw installation is up to date to avoid these issues. - Security: Never share or commit your NVIDIA_API_KEY to public repositories [5]. Use environment variables to keep keys out of shell history and configuration files whenever possible [4].

Citations:


🌐 Web query:

github.com brevdev nemoclaw-demos vlm-subagent openclaw-patch.py

💡 Result:

The reference to openclaw-patch.py in the context of brevdev/nemoclaw-demos likely relates to automated scripts for configuring or patching OpenClaw environments. The brevdev/nemoclaw-demos repository provides a collection of guides and demo setups for users who have completed the initial installation of NemoClaw [1]. Within this repository, specifically in the openclaw-omni-demo project, there is a focus on configuring sub-agents, such as the Nemotron Omni vision sub-agent [1][2]. While the repository contains several scripts to automate these setups—such as apply-omni-subagent.sh, verify-omni-demo.sh, and fix-spark-gateway.sh [2]—the specific filename openclaw-patch.py is not listed as a primary, documented component of the main demo directory structure [2][3]. However, OpenClaw-related patching and configuration scripts are common in the ecosystem; for instance, the mahsumaktas/openclaw-patchkit repository utilizes various Python-based patching strategies and scripts for maintaining OpenClaw environments [4][5]. Additionally, there is a documented apply_patch tool within the OpenClaw framework used for structured file changes [6], and other community packs have historically included files such as ensure-openclaw-postfix-patch.py [7]. If you are looking for specific functionality related to patching an OpenClaw instance for a VLM sub-agent, the recommended approach is to use the scripts/apply-omni-subagent.sh provided in the openclaw-omni-demo folder, which handles the necessary modifications to openclaw.json, policy.yaml, and workspace agent files [2].

Citations:


Use an environment variable instead of a positional argument for the API key.

The search results confirm a security best practice: "Never share or commit your NVIDIA_API_KEY to public repositories. Use environment variables to keep keys out of shell history and configuration files whenever possible."

Passing "$NVIDIA_API_KEY" as a positional argument in the command line exposes the secret in shell history and process listings. Update the docs to show the helper accepting the key via the NVIDIA_API_KEY environment variable instead:

export VLM_DEMO_DIR=/path/to/nemoclaw-demos/vlm-demo
export NVIDIA_API_KEY=your-api-key
python3 "$VLM_DEMO_DIR/vlm-subagent/openclaw-patch.py" < /tmp/openclaw.json > /tmp/openclaw.updated.json

Also verify with the vlm-demo maintainers that the script supports environment variable input, or confirm whether the recommended approach is to use apply-omni-subagent.sh from the openclaw-omni-demo folder instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/inference/set-up-sub-agent.mdx` around lines 79 - 87, The command
example in the documentation passes the NVIDIA_API_KEY as a positional argument
to the openclaw-patch.py script, which exposes the secret in shell history and
process listings. Update the code block to instead export NVIDIA_API_KEY as an
environment variable before running the script, and remove the "$NVIDIA_API_KEY"
positional argument from the python3 command invocation. Verify with the
vlm-demo maintainers that the openclaw-patch.py script properly supports reading
the API key from the NVIDIA_API_KEY environment variable, or confirm if the
recommended approach is to use apply-omni-subagent.sh from the
openclaw-omni-demo folder instead.

@miyoungc miyoungc removed their assignment Jun 16, 2026
@cv
cv merged commit ef31073 into main Jun 17, 2026
40 checks passed
@cv
cv deleted the docs/fix-sub-agent-prereqs-5077 branch June 17, 2026 00:47
@wscurran wscurran added the NV QA Bugs found by the NVIDIA QA Team label Jun 26, 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 NV QA Bugs found by the NVIDIA QA Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[All Platforms][Docs] Set Up Sub-Agents doc: missing prerequisite for running NemoClaw sandbox / openshell-cluster-nemoclaw container

3 participants