fix(clawsweeper): address review for automerge-openclaw-openclaw-84878 (validation-1)

This commit is contained in:
clawsweeper
2026-05-23 23:46:56 +00:00
parent 510aee8721
commit 1dd8a88d21
2 changed files with 7 additions and 3 deletions

View File

@@ -429,15 +429,19 @@ describe("meeting-notes plugin", () => {
],
});
const logger = { debug: vi.fn(), error: vi.fn(), info: vi.fn(), warn: vi.fn() };
const service = services[0];
if (!service?.stop) {
throw new Error("Expected meeting notes service with stop hook");
}
await services[0]?.start({ config: {}, logger, stateDir });
await service.start({ config: {}, logger, stateDir });
await vi.waitFor(() => {
expect(start).toHaveBeenCalledOnce();
});
const request = start.mock.calls[0]?.[0];
expect(request.abortSignal?.aborted).toBe(false);
await services[0]?.stop({ config: {}, logger, stateDir });
await service.stop({ config: {}, logger, stateDir });
expect(request.abortSignal?.aborted).toBe(true);
expect(stop).not.toHaveBeenCalled();

View File

@@ -106,7 +106,7 @@ async function waitForPendingAutoStartsToSettle(
let timeout: ReturnType<typeof setTimeout> | undefined;
try {
return await Promise.race([
Promise.allSettled([...pendingStarts]).then(() => true),
Promise.allSettled(pendingStarts).then(() => true),
new Promise<boolean>((resolve) => {
timeout = setTimeout(() => resolve(false), AUTO_START_STOP_TIMEOUT_MS);
timeout.unref?.();