mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-04 13:01:36 +00:00
fix(cli): keep config file queries fast and read-only (#114660)
This commit is contained in:
committed by
GitHub
parent
600fac1cf7
commit
2b11203eb3
@@ -248,6 +248,7 @@ describe("registerPreActionHooks", () => {
|
||||
.argument("<value>")
|
||||
.option("--json")
|
||||
.action(() => {});
|
||||
config.command("file").action(() => {});
|
||||
config
|
||||
.command("validate")
|
||||
.option("--json")
|
||||
@@ -830,6 +831,19 @@ describe("registerPreActionHooks", () => {
|
||||
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it.each([
|
||||
["default profile", ["node", "openclaw", "config", "file"]],
|
||||
["named profile", ["node", "openclaw", "--profile", "work", "config", "file"]],
|
||||
])("bypasses config guard for a %s config path query", async (_name, processArgv) => {
|
||||
await runPreAction({
|
||||
parseArgv: ["config", "file"],
|
||||
processArgv,
|
||||
});
|
||||
|
||||
expect(ensureConfigReadyMock).not.toHaveBeenCalled();
|
||||
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("bypasses config guard for config validate", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["config", "validate"],
|
||||
|
||||
Reference in New Issue
Block a user