diff --git a/docs/inference/set-up-sub-agent.mdx b/docs/inference/set-up-sub-agent.mdx index f27bcc7a9a4..2bfdfc2ba8c 100644 --- a/docs/inference/set-up-sub-agent.mdx +++ b/docs/inference/set-up-sub-agent.mdx @@ -51,6 +51,12 @@ The primary orchestration model remains responsible for conversation, planning, ## Update the Sandbox Config + +Finish the [Quickstart](../get-started/quickstart) and start the target sandbox before you run the `docker exec` commands in this section. +These commands run on the host that owns the sandbox containers and discover the running sandbox container from the `openshell.ai/sandbox-name` Docker label. +If you have not created a sandbox yet, onboard one first, such as `my-assistant`. + + Fetch the current OpenClaw config from the sandbox, patch it with your auxiliary provider and `agents.list` changes, then upload it back. On Docker-driver sandboxes, run these commands from the host that owns the sandbox containers. The container name includes a runtime suffix, so discover it from the OpenShell sandbox label: @@ -58,11 +64,27 @@ The container name includes a runtime suffix, so discover it from the OpenShell ```bash export SANDBOX=my-assistant export SANDBOX_CTR=$(docker ps --filter "label=openshell.ai/sandbox-name=$SANDBOX" --format "{{.Names}}" | sed -n '1p') +if [ -z "$SANDBOX_CTR" ]; then + echo "No running sandbox container found for $SANDBOX. Start the sandbox before editing its config." + exit 1 +fi docker exec --user root "$SANDBOX_CTR" cat /sandbox/.openclaw/openclaw.json > /tmp/openclaw.json ``` +If `SANDBOX_CTR` is empty, the sandbox is not running on this host. +Start the sandbox, confirm that `docker ps` shows the matching `openshell.ai/sandbox-name` label, then rerun the export commands before continuing. + Create `/tmp/openclaw.updated.json` with the OpenClaw sub-agent config. For the Omni example, the demo provides `vlm-demo/vlm-subagent/openclaw-patch.py`. +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. Upload the patched config and refresh the hash. In the default mutable state, this keeps the local hash consistent but does not make it tamper-proof. @@ -78,7 +100,21 @@ docker exec --user root "$SANDBOX_CTR" chmod 444 /sandbox/.openclaw/openclaw.jso docker exec --user root "$SANDBOX_CTR" chmod 444 /sandbox/.openclaw/.config-hash ``` -Check `/tmp/gateway.log` after upload and confirm the gateway hot-reloaded the provider or `agents.list` change. +Check `/tmp/gateway.log` after upload and confirm the gateway hot-reloaded the provider or `agents.list` change: + +```bash +nemoclaw "$SANDBOX" logs --since 5m --tail 200 +nemoclaw "$SANDBOX" agents list --json +``` + +Expected output: + +```text +config change detected; evaluating reload (...) +config hot reload applied (...) +``` + +The `agents list` output should include `vision-operator`. ## Add Sub-Agent Credentials @@ -90,6 +126,14 @@ For the Omni example: ``` Use the same provider ID that appears in `models.providers`, such as `nvidia-omni`. +Create `/tmp/auth-profiles.json` from `vlm-demo/vlm-subagent/auth-profiles.template.json`, replace `YOUR_NVIDIA_API_KEY_HERE` with the provider key, then upload it into the sandbox: + +```bash +docker exec --user root "$SANDBOX_CTR" mkdir -p /sandbox/.openclaw/agents/vision-operator/agent +docker exec --user root -i "$SANDBOX_CTR" sh -c 'cat > /sandbox/.openclaw/agents/vision-operator/agent/auth-profiles.json' < /tmp/auth-profiles.json +docker exec --user root "$SANDBOX_CTR" chmod 600 /sandbox/.openclaw/agents/vision-operator/agent/auth-profiles.json +``` + After uploading the auth profile, make sure the sandbox user owns the sub-agent directory: ```bash