From a4ef66ea13763b1c1c21f06a7f48779c24d6c986 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Tue, 3 Nov 2026 11:43:43 +0000 Subject: [PATCH] test(omp): reproduce lost mount notices during rewind A notice staged while rewind finishes is discarded by the manager but remembered by the mount ledger, hiding the next runtime announcement. This regression is intentionally red pending shared rewind event delivery. --- .../agent/providers/omp/mount-notice.test.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/server/src/server/agent/providers/omp/mount-notice.test.ts b/packages/server/src/server/agent/providers/omp/mount-notice.test.ts index ce16cbd0c0..92e8344521 100644 --- a/packages/server/src/server/agent/providers/omp/mount-notice.test.ts +++ b/packages/server/src/server/agent/providers/omp/mount-notice.test.ts @@ -392,6 +392,33 @@ class DaemonTimelineHarness { } describe("OMP mount notices in the daemon timeline", () => { + test("a mount staged near rewind completion is announced on the next runtime", async () => { + const daemon = new DaemonTimelineHarness(AGENT_ID); + const handle = persistenceHandle(await writeSessionFile()); + await daemon.load(handle); + const user = daemon.fetchAll().rows.find((row) => row.item.type === "user_message")?.item; + if (user?.type !== "user_message" || !user.messageId) throw new Error("No rewind target"); + const runtime = daemon.omp.latestSession(); + const before = runtime.getStateRequestCount; + let release = runtime.holdStateRequests(); + const rewind = daemon.manager.rewind(AGENT_ID, user.messageId, "conversation"); + try { + await runtime.waitForStateRequests(before + 1); + release(); + release = runtime.holdStateRequests(); + await runtime.waitForStateRequests(before + 2); + await daemon.announce(BROWSER_AND_LINEAR); + } finally { + release(); + await rewind; + } + expect(daemon.fetchedNotifications()).toEqual([]); + await daemon.manager.closeAgent(AGENT_ID); + await daemon.load(handle); + await daemon.announce(BROWSER_AND_LINEAR); + expect(daemon.fetchedNotifications()).toEqual([BROWSER_AND_LINEAR]); + }); + test("live delivery and fetched history agree after idle collection relaunches OMP", async () => { const daemon = new DaemonTimelineHarness(AGENT_ID); await daemon.load(persistenceHandle(await writeSessionFile()));