From e5fa52dd50de10e2e20fc10bc61dea2355da1639 Mon Sep 17 00:00:00 2001 From: Miyoung Choi Date: Wed, 8 Jul 2026 17:01:20 -0700 Subject: [PATCH 1/3] docs: clarify quickstart non-interactive setup --- docs/get-started/quickstart.mdx | 2 +- test/quickstart-docs-5631.test.ts | 68 +++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 test/quickstart-docs-5631.test.ts diff --git a/docs/get-started/quickstart.mdx b/docs/get-started/quickstart.mdx index 73b623b556d..21c0d832d1b 100644 --- a/docs/get-started/quickstart.mdx +++ b/docs/get-started/quickstart.mdx @@ -70,7 +70,7 @@ curl -fsSL https://www.nvidia.com/nemoclaw.sh | \ bash ``` -The example above uses the NVIDIA Endpoints path. Set `NEMOCLAW_PROVIDER` and the matching API key variable for your chosen path (see the provider table above), and set `NEMOCLAW_SANDBOX_NAME` so the run does not depend on a default left behind by a previous, possibly interrupted, onboard session. +The example above uses the NVIDIA Endpoints path. Set `NEMOCLAW_PROVIDER` and the matching API key variable for your chosen path (see the provider table below), and set `NEMOCLAW_SANDBOX_NAME` so the run does not depend on a default left behind by a previous, possibly interrupted, onboard session. If a scripted installer rerun finds a failed onboarding session, choose whether to discard the saved state with `--fresh` or retry it with `nemoclaw onboard --resume`. For the recovery commands, refer to [Previous onboarding session failed](../reference/troubleshooting#previous-onboarding-session-failed). diff --git a/test/quickstart-docs-5631.test.ts b/test/quickstart-docs-5631.test.ts new file mode 100644 index 00000000000..d168b990737 --- /dev/null +++ b/test/quickstart-docs-5631.test.ts @@ -0,0 +1,68 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { readFileSync } from "node:fs"; + +import { describe, expect, it } from "vitest"; + +const quickstart = readFileSync( + new URL("../docs/get-started/quickstart.mdx", import.meta.url), + "utf8", +); + +function collectFencedBlocks(markdown: string, language: string): string[] { + const blocks: string[] = []; + const lines = markdown.split(/\r?\n/); + let current: string[] | null = null; + let currentLanguage = ""; + + for (const line of lines) { + const fenceStart = line.match(/^```([A-Za-z0-9_-]*)\s*$/); + if (!current && fenceStart) { + current = []; + currentLanguage = fenceStart[1] ?? ""; + continue; + } + + if (current && line === "```") { + if (currentLanguage === language) { + blocks.push(current.join("\n")); + } + current = null; + currentLanguage = ""; + continue; + } + + current?.push(line); + } + + return blocks; +} + +function uniqueMatches(source: string, pattern: RegExp): string[] { + return [...new Set([...source.matchAll(pattern)].map((match) => match[1]))]; +} + +describe("OpenClaw quickstart docs", () => { + it("keeps the non-interactive install block complete and sandbox examples aligned (#5631)", () => { + const nonInteractiveInstall = collectFencedBlocks(quickstart, "bash").find( + (block) => + block.includes("https://www.nvidia.com/nemoclaw.sh") && + block.includes("NEMOCLAW_NON_INTERACTIVE=1"), + ); + + expect(nonInteractiveInstall).toBeDefined(); + const installBlock = nonInteractiveInstall ?? ""; + expect(installBlock).toContain("NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE=1"); + expect(installBlock).toContain("NEMOCLAW_PROVIDER=build"); + expect(installBlock).toContain("NVIDIA_INFERENCE_API_KEY="); + expect(installBlock).toContain("NEMOCLAW_SANDBOX_NAME=my-gpt-claw"); + + expect(quickstart).toContain("provider table below"); + expect(quickstart).not.toContain("provider table above"); + expect(uniqueMatches(quickstart, /\bnemoclaw\s+(my-[a-z0-9-]+)\b/g)).toEqual(["my-gpt-claw"]); + expect(uniqueMatches(quickstart, /\bSandbox(?: name)?:\s+(my-[a-z0-9-]+)\b/g)).toEqual([ + "my-gpt-claw", + ]); + }); +}); From b6697ee5c364705dca86e5282ad77f0d49ac9565 Mon Sep 17 00:00:00 2001 From: Miyoung Choi Date: Wed, 8 Jul 2026 17:18:26 -0700 Subject: [PATCH 2/3] docs: point quickstart to provider section --- docs/get-started/quickstart.mdx | 2 +- test/quickstart-docs-5631.test.ts | 35 +++++++------------------------ 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/docs/get-started/quickstart.mdx b/docs/get-started/quickstart.mdx index 21c0d832d1b..99203ec601d 100644 --- a/docs/get-started/quickstart.mdx +++ b/docs/get-started/quickstart.mdx @@ -70,7 +70,7 @@ curl -fsSL https://www.nvidia.com/nemoclaw.sh | \ bash ``` -The example above uses the NVIDIA Endpoints path. Set `NEMOCLAW_PROVIDER` and the matching API key variable for your chosen path (see the provider table below), and set `NEMOCLAW_SANDBOX_NAME` so the run does not depend on a default left behind by a previous, possibly interrupted, onboard session. +The example above uses the NVIDIA Endpoints path. Set `NEMOCLAW_PROVIDER` and the matching API key variable for your chosen path (see [Choose an Inference Provider](#choose-an-inference-provider)), and set `NEMOCLAW_SANDBOX_NAME` so the run does not depend on a default left behind by a previous, possibly interrupted, onboard session. If a scripted installer rerun finds a failed onboarding session, choose whether to discard the saved state with `--fresh` or retry it with `nemoclaw onboard --resume`. For the recovery commands, refer to [Previous onboarding session failed](../reference/troubleshooting#previous-onboarding-session-failed). diff --git a/test/quickstart-docs-5631.test.ts b/test/quickstart-docs-5631.test.ts index d168b990737..f6a1841aefc 100644 --- a/test/quickstart-docs-5631.test.ts +++ b/test/quickstart-docs-5631.test.ts @@ -11,32 +11,12 @@ const quickstart = readFileSync( ); function collectFencedBlocks(markdown: string, language: string): string[] { - const blocks: string[] = []; - const lines = markdown.split(/\r?\n/); - let current: string[] | null = null; - let currentLanguage = ""; - - for (const line of lines) { - const fenceStart = line.match(/^```([A-Za-z0-9_-]*)\s*$/); - if (!current && fenceStart) { - current = []; - currentLanguage = fenceStart[1] ?? ""; - continue; - } - - if (current && line === "```") { - if (currentLanguage === language) { - blocks.push(current.join("\n")); - } - current = null; - currentLanguage = ""; - continue; - } - - current?.push(line); - } - - return blocks; + const escapedLanguage = language.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + return [ + ...markdown.matchAll( + new RegExp(`^\\\`\\\`\\\`${escapedLanguage}\\n([\\s\\S]*?)\\n\\\`\\\`\\\`$`, "gm"), + ), + ].map((match) => match[1]); } function uniqueMatches(source: string, pattern: RegExp): string[] { @@ -58,8 +38,9 @@ describe("OpenClaw quickstart docs", () => { expect(installBlock).toContain("NVIDIA_INFERENCE_API_KEY="); expect(installBlock).toContain("NEMOCLAW_SANDBOX_NAME=my-gpt-claw"); - expect(quickstart).toContain("provider table below"); + expect(quickstart).toContain("[Choose an Inference Provider](#choose-an-inference-provider)"); expect(quickstart).not.toContain("provider table above"); + expect(quickstart).not.toContain("provider table below"); expect(uniqueMatches(quickstart, /\bnemoclaw\s+(my-[a-z0-9-]+)\b/g)).toEqual(["my-gpt-claw"]); expect(uniqueMatches(quickstart, /\bSandbox(?: name)?:\s+(my-[a-z0-9-]+)\b/g)).toEqual([ "my-gpt-claw", From 4c6b44381347ac64c613b2c29ee4f05232e4196a Mon Sep 17 00:00:00 2001 From: Miyoung Choi Date: Wed, 8 Jul 2026 17:36:04 -0700 Subject: [PATCH 3/3] test: remove quickstart docs regression test --- test/quickstart-docs-5631.test.ts | 49 ------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 test/quickstart-docs-5631.test.ts diff --git a/test/quickstart-docs-5631.test.ts b/test/quickstart-docs-5631.test.ts deleted file mode 100644 index f6a1841aefc..00000000000 --- a/test/quickstart-docs-5631.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 - -import { readFileSync } from "node:fs"; - -import { describe, expect, it } from "vitest"; - -const quickstart = readFileSync( - new URL("../docs/get-started/quickstart.mdx", import.meta.url), - "utf8", -); - -function collectFencedBlocks(markdown: string, language: string): string[] { - const escapedLanguage = language.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - return [ - ...markdown.matchAll( - new RegExp(`^\\\`\\\`\\\`${escapedLanguage}\\n([\\s\\S]*?)\\n\\\`\\\`\\\`$`, "gm"), - ), - ].map((match) => match[1]); -} - -function uniqueMatches(source: string, pattern: RegExp): string[] { - return [...new Set([...source.matchAll(pattern)].map((match) => match[1]))]; -} - -describe("OpenClaw quickstart docs", () => { - it("keeps the non-interactive install block complete and sandbox examples aligned (#5631)", () => { - const nonInteractiveInstall = collectFencedBlocks(quickstart, "bash").find( - (block) => - block.includes("https://www.nvidia.com/nemoclaw.sh") && - block.includes("NEMOCLAW_NON_INTERACTIVE=1"), - ); - - expect(nonInteractiveInstall).toBeDefined(); - const installBlock = nonInteractiveInstall ?? ""; - expect(installBlock).toContain("NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE=1"); - expect(installBlock).toContain("NEMOCLAW_PROVIDER=build"); - expect(installBlock).toContain("NVIDIA_INFERENCE_API_KEY="); - expect(installBlock).toContain("NEMOCLAW_SANDBOX_NAME=my-gpt-claw"); - - expect(quickstart).toContain("[Choose an Inference Provider](#choose-an-inference-provider)"); - expect(quickstart).not.toContain("provider table above"); - expect(quickstart).not.toContain("provider table below"); - expect(uniqueMatches(quickstart, /\bnemoclaw\s+(my-[a-z0-9-]+)\b/g)).toEqual(["my-gpt-claw"]); - expect(uniqueMatches(quickstart, /\bSandbox(?: name)?:\s+(my-[a-z0-9-]+)\b/g)).toEqual([ - "my-gpt-claw", - ]); - }); -});