perf(status): defer heavy startup loading

This commit is contained in:
Peter Steinberger
2026-03-15 18:20:37 -07:00
parent 9c89a74f84
commit 83ee5c0328
11 changed files with 334 additions and 16 deletions

View File

@@ -190,6 +190,19 @@ describe("registerPreActionHooks", () => {
});
it("applies --json stdout suppression only for explicit JSON output commands", async () => {
await runPreAction({
parseArgv: ["status"],
processArgv: ["node", "openclaw", "status", "--json"],
});
expect(ensureConfigReadyMock).toHaveBeenCalledWith({
runtime: runtimeMock,
commandPath: ["status"],
suppressDoctorStdout: true,
});
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
vi.clearAllMocks();
await runPreAction({
parseArgv: ["update", "status", "--json"],
processArgv: ["node", "openclaw", "update", "status", "--json"],
@@ -200,6 +213,7 @@ describe("registerPreActionHooks", () => {
commandPath: ["update", "status"],
suppressDoctorStdout: true,
});
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
vi.clearAllMocks();
await runPreAction({