mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:10:43 +00:00
fix(cli): skip configure preaction bootstrap
This commit is contained in:
@@ -37,7 +37,7 @@ export const cliCommandCatalog: readonly CliCommandCatalogEntry[] = [
|
||||
{ commandPath: ["channels"], policy: { loadPlugins: "always" } },
|
||||
{ commandPath: ["directory"], policy: { loadPlugins: "always" } },
|
||||
{ commandPath: ["agents"], policy: { loadPlugins: "always" } },
|
||||
{ commandPath: ["configure"], policy: { loadPlugins: "always" } },
|
||||
{ commandPath: ["configure"], policy: { bypassConfigGuard: true, loadPlugins: "never" } },
|
||||
{
|
||||
commandPath: ["status"],
|
||||
policy: {
|
||||
|
||||
@@ -44,6 +44,13 @@ describe("command-path-policy", () => {
|
||||
});
|
||||
|
||||
it("resolves mixed startup-only rules", () => {
|
||||
expect(resolveCliCommandPathPolicy(["configure"])).toEqual({
|
||||
bypassConfigGuard: true,
|
||||
routeConfigGuard: "never",
|
||||
loadPlugins: "never",
|
||||
hideBanner: false,
|
||||
ensureCliPath: true,
|
||||
});
|
||||
expect(resolveCliCommandPathPolicy(["config", "validate"])).toEqual({
|
||||
bypassConfigGuard: true,
|
||||
routeConfigGuard: "never",
|
||||
|
||||
@@ -266,6 +266,16 @@ describe("registerPreActionHooks", () => {
|
||||
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("lets configure own config validation and plugin loading", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["configure"],
|
||||
processArgv: ["node", "openclaw", "configure"],
|
||||
});
|
||||
|
||||
expect(ensureConfigReadyMock).not.toHaveBeenCalled();
|
||||
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("only allows invalid config for explicit Matrix reinstall requests", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["plugins", "install", "@openclaw/matrix"],
|
||||
|
||||
Reference in New Issue
Block a user