From e6bf64aed8956cfadbd50274628b38db2c7a14db Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Thu, 16 Apr 2026 19:46:20 +0700 Subject: [PATCH] fix(server): drop stale snapshot mutation ownership assertions Session.unarchiveAgentState(id) and the direct agentManager.unarchiveSnapshotByHandle delegation were removed when main's 86bb5cc8 + a11c246b refactors moved unarchive through the shared mcp-shared helper. Remove the now-dead test assertions so the suite reflects the real ownership boundary. --- .../src/server/snapshot-mutation-ownership.test.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/server/src/server/snapshot-mutation-ownership.test.ts b/packages/server/src/server/snapshot-mutation-ownership.test.ts index 3a3a82098..1b2889934 100644 --- a/packages/server/src/server/snapshot-mutation-ownership.test.ts +++ b/packages/server/src/server/snapshot-mutation-ownership.test.ts @@ -65,8 +65,6 @@ describe("snapshot mutation ownership boundary", () => { updatedAt: archivedAt, }; }); - const unarchiveSnapshot = vi.fn(async () => true); - const unarchiveSnapshotByHandle = vi.fn(async () => undefined); const updateAgentMetadata = vi.fn(async () => undefined); const directStorageWrite = vi.fn(async () => { throw new Error("Session should not write snapshots directly"); @@ -93,8 +91,6 @@ describe("snapshot mutation ownership boundary", () => { listAgents: () => [], getAgent: () => null, archiveSnapshot, - unarchiveSnapshot, - unarchiveSnapshotByHandle, updateAgentMetadata, } as any, agentStorage: { @@ -133,13 +129,6 @@ describe("snapshot mutation ownership boundary", () => { expect(archiveSnapshot).toHaveBeenCalledTimes(1); expect(archiveResult.archivedAt).toBeTruthy(); - await session.unarchiveAgentState("agent-1"); - expect(unarchiveSnapshot).toHaveBeenCalledWith("agent-1"); - - const handle = { provider: "codex", sessionId: "session-1" }; - await session.unarchiveAgentByHandle(handle); - expect(unarchiveSnapshotByHandle).toHaveBeenCalledWith(handle); - await session.handleUpdateAgentRequest( "agent-1", "Renamed agent",