惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
B
Blog
P
Proofpoint News Feed
美团技术团队
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
有赞技术团队
有赞技术团队
小众软件
小众软件
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
H
Help Net Security
罗磊的独立博客
L
LangChain Blog
GbyAI
GbyAI
腾讯CDC
T
The Blog of Author Tim Ferriss
Microsoft Security Blog
Microsoft Security Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(cli): keep built-in nodes commands off the plugin loa...
ZengWen-DT · 2026-06-27 · via Recent Commits to openclaw:main
11

// Nodes CLI plugin registration tests cover node command plugin registration.

2+

// Built-in node command registration runs for real so the guard is exercised against the actual

3+

// registered subcommand names; only the plugin-loader boundary is stubbed.

24

import { Command } from "commander";

35

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

46

import { loggingState } from "../logging/state.js";

5768

const registerPluginCliCommandsFromValidatedConfig = vi.fn(async () => ({}));

7-

const registerNodesCameraCommands = vi.fn();

8-

const registerNodesInvokeCommands = vi.fn();

9-

const registerNodesLocationCommands = vi.fn();

10-

const registerNodesNotifyCommand = vi.fn();

11-

const registerNodesPairingCommands = vi.fn();

12-

const registerNodesPushCommand = vi.fn();

13-

const registerNodesScreenCommands = vi.fn();

14-

const registerNodesStatusCommands = vi.fn();

1591610

vi.mock("../plugins/cli.js", () => ({

1711

registerPluginCliCommandsFromValidatedConfig,

1812

}));

191320-

vi.mock("./nodes-cli/register.camera.js", () => ({ registerNodesCameraCommands }));

21-

vi.mock("./nodes-cli/register.invoke.js", () => ({ registerNodesInvokeCommands }));

22-

vi.mock("./nodes-cli/register.location.js", () => ({ registerNodesLocationCommands }));

23-

vi.mock("./nodes-cli/register.notify.js", () => ({ registerNodesNotifyCommand }));

24-

vi.mock("./nodes-cli/register.pairing.js", () => ({ registerNodesPairingCommands }));

25-

vi.mock("./nodes-cli/register.push.js", () => ({ registerNodesPushCommand }));

26-

vi.mock("./nodes-cli/register.screen.js", () => ({ registerNodesScreenCommands }));

27-

vi.mock("./nodes-cli/register.status.js", () => ({ registerNodesStatusCommands }));

28-2914

const { registerNodesCli } = await import("./nodes-cli/register.js");

30153116

describe("registerNodesCli plugin registration", () => {

@@ -50,14 +35,29 @@ describe("registerNodesCli plugin registration", () => {

5035

return program;

5136

}

523753-

it("routes plugin registration logs to stderr for nodes --json commands", async () => {

38+

it("skips plugin CLI/runtime registration for built-in nodes subcommands", async () => {

39+

for (const subcommand of ["status", "list", "describe", "invoke", "pending", "camera"]) {

40+

registerPluginCliCommandsFromValidatedConfig.mockClear();

41+

await registerWithArgv(["node", "openclaw", "nodes", subcommand, "--json"]);

42+

expect(registerPluginCliCommandsFromValidatedConfig).not.toHaveBeenCalled();

43+

}

44+

});

45+46+

it("registers plugin-provided node subcommands lazily and routes their logs to stderr", async () => {

5447

let forceStderrDuringRegistration = false;

5548

registerPluginCliCommandsFromValidatedConfig.mockImplementationOnce(async () => {

5649

forceStderrDuringRegistration = loggingState.forceConsoleToStderr;

5750

return {};

5851

});

595260-

const program = await registerWithArgv(["node", "openclaw", "nodes", "list", "--json"]);

53+

const program = await registerWithArgv([

54+

"node",

55+

"openclaw",

56+

"nodes",

57+

"canvas",

58+

"snapshot",

59+

"--json",

60+

]);

61616262

expect(registerPluginCliCommandsFromValidatedConfig).toHaveBeenCalledWith(

6363

program,

@@ -69,14 +69,24 @@ describe("registerNodesCli plugin registration", () => {

6969

expect(loggingState.forceConsoleToStderr).toBe(false);

7070

});

717172+

it("surfaces plugin subcommands for bare `nodes` listing", async () => {

73+

const program = await registerWithArgv(["node", "openclaw", "nodes"]);

74+

expect(registerPluginCliCommandsFromValidatedConfig).toHaveBeenCalledWith(

75+

program,

76+

undefined,

77+

undefined,

78+

{ mode: "lazy", primary: "nodes" },

79+

);

80+

});

81+7282

it("does not route pass-through --json after the terminator", async () => {

7383

let forceStderrDuringRegistration = true;

7484

registerPluginCliCommandsFromValidatedConfig.mockImplementationOnce(async () => {

7585

forceStderrDuringRegistration = loggingState.forceConsoleToStderr;

7686

return {};

7787

});

788879-

await registerWithArgv(["node", "openclaw", "nodes", "invoke", "--", "--json"]);

89+

await registerWithArgv(["node", "openclaw", "nodes", "canvas", "--", "--json"]);

80908191

expect(forceStderrDuringRegistration).toBe(false);

8292

expect(loggingState.forceConsoleToStderr).toBe(false);