fix(config): return persisted config write responses (#81445)

Merged via squash.

Prepared head SHA: 8f549e0621
Co-authored-by: giodl73-repo <235387111+giodl73-repo@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
This commit is contained in:
Gio Della-Libera
2026-05-14 14:35:15 -07:00
committed by GitHub
parent 079bf99671
commit abf59205fc
17 changed files with 221 additions and 43 deletions

View File

@@ -32,7 +32,15 @@ describe("commitConfigWithPendingPluginInstalls", () => {
beforeEach(() => {
vi.clearAllMocks();
mocks.loadInstalledPluginIndexInstallRecords.mockResolvedValue({});
mocks.replaceConfigFile.mockResolvedValue(undefined);
mocks.replaceConfigFile.mockImplementation(async (params: { nextConfig: OpenClawConfig }) => ({
path: "/tmp/openclaw.json",
previousHash: null,
snapshot: {} as never,
nextConfig: params.nextConfig,
persistedHash: "test-config-hash",
afterWrite: { mode: "auto" },
followUp: { mode: "auto", requiresRestart: false },
}));
mocks.writePersistedInstalledPluginIndexInstallRecords.mockResolvedValue(undefined);
});
@@ -95,6 +103,7 @@ describe("commitConfigWithPendingPluginInstalls", () => {
...pendingRecords,
},
movedInstallRecords: true,
persistedHash: "test-config-hash",
});
});
@@ -184,6 +193,7 @@ describe("commitConfigWithPendingPluginInstalls", () => {
config: nextConfig,
installRecords: {},
movedInstallRecords: false,
persistedHash: "test-config-hash",
});
});
@@ -205,6 +215,7 @@ describe("commitConfigWithPendingPluginInstalls", () => {
config: nextConfig,
installRecords: {},
movedInstallRecords: false,
persistedHash: null,
});
});
});