diff --git a/src/lib/cli/terminal-style.test.ts b/src/lib/cli/terminal-style.test.ts index 12d84a89c5b..8a4eee868b0 100644 --- a/src/lib/cli/terminal-style.test.ts +++ b/src/lib/cli/terminal-style.test.ts @@ -3,7 +3,7 @@ import { afterEach, describe, expect, it, vi } from "vitest"; -import { B, D, failLine, G, R, RD, warnLine, YW } from "./terminal-style"; +import { B, D, failLine, G, labeledWarnLine, R, RD, warnLine, YW } from "./terminal-style"; describe("terminal-style", () => { it("exports terminal style strings", () => { @@ -70,6 +70,7 @@ describe("preflight severity lines (#6004)", () => { stubStream(process.stderr, true, 24); stubStream(process.stdout, false, 1); expect(warnLine("disk low")).toBe(` ${YELLOW("⚠ disk low")}`); + expect(labeledWarnLine("disk low")).toBe(` ${YELLOW("[WARN] disk low")}`); expect(failLine("docker down")).toBe(` ${RED("✗ docker down")}`); }); }); @@ -82,6 +83,7 @@ describe("preflight severity lines (#6004)", () => { stubStream(process.stdout, true, 24); stubStream(process.stderr, false, 1); expect(warnLine("disk low")).toBe(" ⚠ disk low"); + expect(labeledWarnLine("disk low")).toBe(" [WARN] disk low"); expect(failLine("docker down")).toBe(" ✗ docker down"); }); }); @@ -93,6 +95,7 @@ describe("preflight severity lines (#6004)", () => { stubStream(process.stdout, true, 24); stubStream(process.stderr, true, 24); expect(warnLine("a")).toBe(" ⚠ a"); + expect(labeledWarnLine("a")).toBe(" [WARN] a"); expect(failLine("b")).toBe(" ✗ b"); }); }); diff --git a/src/lib/cli/terminal-style.ts b/src/lib/cli/terminal-style.ts index d93b11cea59..1da524c15bb 100644 --- a/src/lib/cli/terminal-style.ts +++ b/src/lib/cli/terminal-style.ts @@ -26,7 +26,7 @@ export const YW = useColor ? "\x1b[1;33m" : ""; // FORCE_COLOR (#6004). The old output keyed color off stdout, which dropped // color on `onboard >log` and leaked ANSI into `onboard 2>log`. function stderrSeverityLine( - marker: "⚠ " | "✗ ", + marker: "⚠ " | "✗ " | "[WARN] ", format: "yellow" | "red", message: string, ): string { @@ -35,4 +35,6 @@ function stderrSeverityLine( } export const warnLine = (message: string): string => stderrSeverityLine("⚠ ", "yellow", message); +export const labeledWarnLine = (message: string): string => + stderrSeverityLine("[WARN] ", "yellow", message); export const failLine = (message: string): string => stderrSeverityLine("✗ ", "red", message); diff --git a/src/lib/inference/vllm.test.ts b/src/lib/inference/vllm.test.ts index e93a208d82b..e2cc956fb71 100644 --- a/src/lib/inference/vllm.test.ts +++ b/src/lib/inference/vllm.test.ts @@ -574,6 +574,7 @@ describe("installVllm model resolution", () => { delete process.env.NEMOCLAW_VLLM_EXTRA_ARGS_JSON; delete process.env.HF_TOKEN; delete process.env.HUGGING_FACE_HUB_TOKEN; + process.env.NO_COLOR = "1"; // Fail dockerPrereqsOk so the function returns before any docker work, // letting tests assert on the resolved model + summary line without // mocking the full install chain. @@ -877,11 +878,11 @@ describe("installVllm model resolution", () => { expect(mocks.dockerPullWithProgressWatchdog).toHaveBeenCalledTimes(1); expect(mocks.dockerSpawn).toHaveBeenCalledTimes(1); const errors = errSpy.mock.calls.map((call: unknown[]) => String(call[0])).join("\n"); - expect(errors).toContain("Insufficient storage for the managed vLLM model cache"); + expect(errors).toContain("[WARN] Insufficient storage for the managed vLLM model cache"); expect(errors).toContain("nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B-NVFP4"); expect(errors).toContain("Hugging Face cache"); expect(errors).toContain( - "Continuing because managed vLLM storage estimates are advisory in non-interactive setup", + "[INFO] Continuing because managed vLLM storage estimates are advisory in non-interactive setup", ); }); @@ -1017,11 +1018,11 @@ describe("installVllm model resolution", () => { expect(mocks.dockerPullWithProgressWatchdog).toHaveBeenCalledTimes(1); expect(mocks.dockerSpawn).toHaveBeenCalledTimes(1); expect(errSpy).toHaveBeenCalledWith( - expect.stringContaining("Insufficient storage for the managed vLLM model cache"), + expect.stringContaining("[WARN] Insufficient storage for the managed vLLM model cache"), ); expect(errSpy).toHaveBeenCalledWith( expect.stringContaining( - "Continuing because managed vLLM storage estimates are advisory in non-interactive setup", + "[INFO] Continuing because managed vLLM storage estimates are advisory in non-interactive setup", ), ); }); @@ -1154,9 +1155,10 @@ describe("installVllm model resolution", () => { expect(mocks.dockerPullWithProgressWatchdog).toHaveBeenCalledTimes(1); expect(mocks.dockerSpawn).toHaveBeenCalledTimes(1); expect(errSpy).toHaveBeenCalledWith( - expect.stringContaining( - "Continuing because managed vLLM storage estimates are advisory in non-interactive setup", - ), + " [WARN] Insufficient Docker storage for the managed vLLM image.", + ); + expect(errSpy).toHaveBeenCalledWith( + " [INFO] Continuing because managed vLLM storage estimates are advisory in non-interactive setup.", ); }); diff --git a/src/lib/inference/vllm.ts b/src/lib/inference/vllm.ts index 36a1dde93db..de723d47cc9 100644 --- a/src/lib/inference/vllm.ts +++ b/src/lib/inference/vllm.ts @@ -18,6 +18,7 @@ import { dockerStop, } from "../adapters/docker"; import { buildValidatedCurlCommandArgs } from "../adapters/http/curl-args"; +import { labeledWarnLine } from "../cli/terminal-style"; import { VLLM_PORT } from "../core/ports"; import { shellQuote } from "../core/shell-quote"; import { isAffirmativeAnswer } from "../onboard/prompt-helpers"; @@ -779,7 +780,9 @@ function printImageStorageWarning( const insufficient = probe.ok && probe.capacity.availableBytes < requiredBytes; console.error(""); console.error( - ` ${insufficient ? "Insufficient" : "Unable to verify"} Docker storage for the managed vLLM image.`, + labeledWarnLine( + `${insufficient ? "Insufficient" : "Unable to verify"} Docker storage for the managed vLLM image.`, + ), ); console.error(""); console.error(` Image: ${profile.image}`); @@ -813,7 +816,9 @@ function printModelStorageWarning( const insufficient = probe.ok && probe.capacity.availableBytes < requiredBytes; console.error(""); console.error( - ` ${insufficient ? "Insufficient" : "Unable to verify"} storage for the managed vLLM model cache.`, + labeledWarnLine( + `${insufficient ? "Insufficient" : "Unable to verify"} storage for the managed vLLM model cache.`, + ), ); console.error(""); console.error(` Model: ${model.id}`); @@ -860,7 +865,7 @@ async function imageStorageAccepted( } if (opts.nonInteractive) { console.error( - " Continuing because managed vLLM storage estimates are advisory in non-interactive setup.", + " [INFO] Continuing because managed vLLM storage estimates are advisory in non-interactive setup.", ); return true; } @@ -887,7 +892,7 @@ async function modelStorageAccepted( printModelStorageWarning(model, probe, requiredBytes, cachedBytes, snapshotBytes); if (probe.ok && opts.nonInteractive) { console.error( - " Continuing because managed vLLM storage estimates are advisory in non-interactive setup.", + " [INFO] Continuing because managed vLLM storage estimates are advisory in non-interactive setup.", ); return true; }