From 1bc443aaa14c5c0b320a05ba3e25d3e0e7b9d582 Mon Sep 17 00:00:00 2001 From: Marc J Saint-jour <82672745+Junebugg1214@users.noreply.github.com> Date: Thu, 12 Mar 2026 18:41:16 -0400 Subject: [PATCH] feat: integrate Cortex local memory into OpenClaw --- src/commands/configure.wizard.test.ts | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/commands/configure.wizard.test.ts b/src/commands/configure.wizard.test.ts index 034a3fdf505..cfcb9236e4b 100644 --- a/src/commands/configure.wizard.test.ts +++ b/src/commands/configure.wizard.test.ts @@ -111,6 +111,7 @@ describe("runConfigureWizard", () => { mocks.resolveControlUiLinks.mockReturnValue({ wsUrl: "ws://127.0.0.1:18789" }); mocks.summarizeExistingConfig.mockReturnValue(""); mocks.createClackPrompter.mockReturnValue({}); + mocks.ensureControlUiAssetsBuilt.mockResolvedValue({ ok: true }); const selectQueue = ["local", "__continue"]; mocks.clackSelect.mockImplementation(async () => selectQueue.shift()); @@ -135,6 +136,51 @@ describe("runConfigureWizard", () => { ); }); + it("configures Cortex memory through the wizard sections flow", async () => { + mocks.readConfigFileSnapshot.mockResolvedValue({ + exists: false, + valid: true, + config: {}, + issues: [], + }); + mocks.resolveGatewayPort.mockReturnValue(18789); + mocks.probeGatewayReachable.mockResolvedValue({ ok: false }); + mocks.resolveControlUiLinks.mockReturnValue({ wsUrl: "ws://127.0.0.1:18789" }); + mocks.summarizeExistingConfig.mockReturnValue(""); + mocks.createClackPrompter.mockReturnValue({}); + + const selectQueue = ["local", "technical"]; + mocks.clackSelect.mockImplementation(async () => selectQueue.shift()); + const confirmQueue = [true, true]; + mocks.clackConfirm.mockImplementation(async () => confirmQueue.shift()); + mocks.clackIntro.mockResolvedValue(undefined); + mocks.clackOutro.mockResolvedValue(undefined); + mocks.clackText.mockResolvedValue("2048"); + + await runConfigureWizard( + { command: "configure", sections: ["memory"] }, + { + log: vi.fn(), + error: vi.fn(), + exit: vi.fn(), + }, + ); + + expect(mocks.writeConfigFile).toHaveBeenCalledWith( + expect.objectContaining({ + agents: expect.objectContaining({ + defaults: expect.objectContaining({ + cortex: expect.objectContaining({ + enabled: true, + mode: "technical", + maxChars: 2048, + }), + }), + }), + }), + ); + }); + it("exits with code 1 when configure wizard is cancelled", async () => { const runtime = { log: vi.fn(), @@ -152,6 +198,7 @@ describe("runConfigureWizard", () => { mocks.resolveControlUiLinks.mockReturnValue({ wsUrl: "ws://127.0.0.1:18789" }); mocks.summarizeExistingConfig.mockReturnValue(""); mocks.createClackPrompter.mockReturnValue({}); + mocks.ensureControlUiAssetsBuilt.mockResolvedValue({ ok: true }); mocks.clackSelect.mockRejectedValueOnce(new WizardCancelledError()); await runConfigureWizard({ command: "configure" }, runtime);