





















@@ -363,6 +363,7 @@ describe("runCli exit behavior", () => {
363363["models list", ["node", "openclaw", "models", "list"]],
364364["models status without live probe", ["node", "openclaw", "models", "status"]],
365365["tasks list", ["node", "openclaw", "tasks", "list"]],
366+["legacy singular tool namespace", ["node", "openclaw", "tool", "image_generate"]],
366367["gateway tools namespace typo", ["node", "openclaw", "tools", "effective"]],
367368["migrate", ["node", "openclaw", "migrate"]],
368369])("skips managed proxy routing for %s", (_name, argv) => {
@@ -385,24 +386,22 @@ describe("runCli exit behavior", () => {
385386expect(startProxyMock).toHaveBeenCalledWith(undefined);
386387});
387388388-it("keeps gateway tool RPC names out of plugin command discovery", async () => {
389+it.each([
390+["tool", ["node", "openclaw", "tool", "image_generate"]],
391+["tools", ["node", "openclaw", "tools", "effective"]],
392+])("keeps reserved %s command roots out of plugin command discovery", async (_name, argv) => {
389393const parseAsync = vi.fn().mockResolvedValueOnce(undefined);
390394buildProgramMock.mockReturnValueOnce({
391395commands: [],
392396 parseAsync,
393397});
394398395-await runCli(["node", "openclaw", "tools", "effective"]);
399+await runCli(argv);
396400397401expect(startProxyMock).not.toHaveBeenCalled();
398-expect(registerSubCliByNameMock).toHaveBeenCalledWith(expect.anything(), "tools", [
399-"node",
400-"openclaw",
401-"tools",
402-"effective",
403-]);
402+expect(registerSubCliByNameMock).toHaveBeenCalledWith(expect.anything(), argv[2], argv);
404403expect(registerPluginCliCommandsFromValidatedConfigMock).not.toHaveBeenCalled();
405-expect(parseAsync).toHaveBeenCalledWith(["node", "openclaw", "tools", "effective"]);
404+expect(parseAsync).toHaveBeenCalledWith(argv);
406405});
407406408407it("fails protected commands when managed proxy activation fails", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。