From 8fdb39aeb0f46acdb10126d9e40201a9f272113b Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Thu, 1 Oct 2026 03:50:31 -0500 Subject: [PATCH 1/2] perf(api): read notifications without full workspace snapshot --- apps/server/src/engine/routes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/src/engine/routes.ts b/apps/server/src/engine/routes.ts index 139bf61c5..9096c08c9 100644 --- a/apps/server/src/engine/routes.ts +++ b/apps/server/src/engine/routes.ts @@ -130,7 +130,7 @@ export function agentRoutes(service: AgentService): Hono<{ Variables: { owner: s return c.json(identity); }); app.get("/notifications", async (c) => - c.json((await service.snapshot(c.get("owner"))).notifications), + c.json(await service.db.list(c.get("owner"), "notifications")), ); app.post("/notifications/:id/read", async (c) => { const notification = await service.db.compareAndSwap( From bca9e05f711ba6f5a16a7eec5885462cb3eb9088 Mon Sep 17 00:00:00 2001 From: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Date: Thu, 1 Oct 2026 03:50:36 -0500 Subject: [PATCH 2/2] test(api): keep notification reads scoped --- tests/agent-api.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/agent-api.test.ts b/tests/agent-api.test.ts index c3b58a34a..4de0cdfe8 100644 --- a/tests/agent-api.test.ts +++ b/tests/agent-api.test.ts @@ -254,6 +254,15 @@ test("idea dismissal survives refresh and concurrent acceptance creates one goal await read(`/tasks/${results[0].taskId}/control`, { action: "cancel" }); }); +test("notification reads do not load the full agent workspace", async (t) => { + t.mock.method(server.agent, "snapshot", async () => { + throw new Error("notifications route must not call snapshot"); + }); + const response = await request("/notifications"); + assert.equal(response.status, 200, await response.clone().text()); + assert.ok(Array.isArray(await response.json())); +}); + test("sample monitor saves its baseline and deduplicates notifications for repeated changes", async () => { await read("/sample-page", { text: "No tables available" }); const monitor = await read(