Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bin/nemoclaw.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ if (invokedAs === "nemo-deepagents") {
process.env.NEMOCLAW_INVOKED_AS = "nemo-deepagents";
}

// `node:sqlite` is still experimental on Node 22, which prints an ExperimentalWarning on
// stderr for every command that opens the state store and breaks `VER=$(nemoclaw
// --version)`-style scripts (#12741). Drop only that warning; all others still print.
const emitWarning = process.emitWarning;
process.emitWarning = function (warning, ...args) {
const type = typeof args[0] === "string" ? args[0] : args[0]?.type;
const message = warning instanceof Error ? warning.message : String(warning);
if (type === "ExperimentalWarning" && message.startsWith("SQLite is an experimental feature")) {
return;
}
return emitWarning.call(this, warning, ...args);
};

let topLevelLog = null;

const PORT_ENV_NAME =
Expand Down
33 changes: 33 additions & 0 deletions test/package-contract/cli/launcher-warnings.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { spawnSync } from "node:child_process";
import path from "node:path";

import { describe, expect, it } from "vitest";

const LAUNCHER = path.join(import.meta.dirname, "..", "..", "..", "bin", "nemoclaw.js");

describe("CLI launcher warnings (#12741)", () => {
it("drops only the node:sqlite ExperimentalWarning", () => {
// Emit the warnings after the launcher installs its filter, so the result does not
// depend on whether this Node version still marks node:sqlite as experimental.
const script = `
process.argv = [process.execPath, ${JSON.stringify(LAUNCHER)}, "--version"];
require(${JSON.stringify(LAUNCHER)});
process.emitWarning("SQLite is an experimental feature and might change at any time", "ExperimentalWarning");
process.emitWarning("another experimental feature", "ExperimentalWarning");
process.emitWarning("a deprecated feature", "DeprecationWarning");
`;
const result = spawnSync(process.execPath, ["-e", script], {
encoding: "utf8",
env: { ...process.env, NEMOCLAW_GATEWAY_PORT: "8080" },
});

expect(result.status, result.stderr).toBe(0);
expect(result.stdout).toMatch(/^nemoclaw v/);
expect(result.stderr).not.toContain("SQLite is an experimental feature");
expect(result.stderr).toContain("ExperimentalWarning: another experimental feature");
expect(result.stderr).toContain("DeprecationWarning: a deprecated feature");
}, 15_000);
});
Loading