fix(cli): skip configure preaction bootstrap

This commit is contained in:
Ayaan Zaidi
2026-04-22 10:16:04 +05:30
parent 262899f495
commit c1b21a2a3a
3 changed files with 18 additions and 1 deletions

View File

@@ -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: {

View File

@@ -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",

View File

@@ -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"],