Skip to content

Commit 7f83ba8

Browse files
committed
fix: reserve auth CLI root from plugin allowlist gating
1 parent 2a7d6f6 commit 7f83ba8

5 files changed

Lines changed: 18 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Docs: https://docs.openclaw.ai
1212

1313
### Fixes
1414

15+
- CLI/plugins: stop treating the non-plugin `auth` command root as a bundled plugin id, so restrictive `plugins.allow` configs no longer tell users to add stale `auth` plugin entries.
1516
- Plugins/externalization: repair missing configured plugin installs from npm by default, reserve ClawHub downloads for explicit `clawhubSpec` metadata, and cover agent-runtime/env-selected plugin repair. Thanks @vincentkoc.
1617
- Upgrade/config: validate configured web-search providers and statically suppressed model/provider pairs against the active plugin set at config load, so stale plugin state fails loud before runtime fallback.
1718
- Status/update: resolve beta update-channel checks from the installed version when config still says `stable`, and let `status --deep` reuse live gateway channel credential state instead of warning on command-path-only token misses.

src/cli/command-registration-policy.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ describe("command-registration-policy", () => {
5050
hasBuiltinPrimary: false,
5151
}),
5252
).toBe(false);
53+
expect(
54+
shouldSkipPluginCommandRegistration({
55+
argv: ["node", "openclaw", "auth", "login"],
56+
primary: "auth",
57+
hasBuiltinPrimary: false,
58+
}),
59+
).toBe(true);
5360
expect(
5461
shouldSkipPluginCommandRegistration({
5562
argv: ["node", "openclaw", "tool", "image_generate"],

src/cli/command-registration-policy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { isTruthyEnvValue } from "../infra/env.js";
22
import { resolveCliArgvInvocation } from "./argv-invocation.js";
33

4-
const RESERVED_NON_PLUGIN_COMMAND_ROOTS = new Set(["tool", "tools"]);
4+
const RESERVED_NON_PLUGIN_COMMAND_ROOTS = new Set(["auth", "tool", "tools"]);
55

66
export function isReservedNonPluginCommandRoot(primary: string | null | undefined): boolean {
77
return typeof primary === "string" && RESERVED_NON_PLUGIN_COMMAND_ROOTS.has(primary);

src/cli/run-main.exit.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ describe("runCli exit behavior", () => {
400400
});
401401

402402
it.each([
403+
["auth", ["node", "openclaw", "auth", "--help"]],
403404
["tool", ["node", "openclaw", "tool", "image_generate"]],
404405
["tools", ["node", "openclaw", "tools", "effective"]],
405406
])("keeps reserved %s command roots out of plugin command discovery", async (_name, argv) => {

src/cli/run-main.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,14 @@ describe("resolveMissingPluginCommandMessage", () => {
214214
});
215215

216216
it("does not classify reserved non-plugin command roots as plugin allowlist misses", () => {
217-
const message = resolveMissingPluginCommandMessage("tool", {
218-
plugins: {
219-
allow: ["browser"],
220-
},
221-
});
222-
expect(message).toBeNull();
217+
for (const root of ["auth", "tool"]) {
218+
const message = resolveMissingPluginCommandMessage(root, {
219+
plugins: {
220+
allow: ["browser"],
221+
},
222+
});
223+
expect(message).toBeNull();
224+
}
223225
});
224226

225227
it("explains that dreaming is a runtime slash command, not a CLI command", () => {

0 commit comments

Comments
 (0)