fix(server): drop stale snapshot mutation ownership assertions
Session.unarchiveAgentState(id) and the direct agentManager.unarchiveSnapshotByHandle delegation were removed when main's86bb5cc8+a11c246brefactors moved unarchive through the shared mcp-shared helper. Remove the now-dead test assertions so the suite reflects the real ownership boundary.
This commit is contained in:
@@ -65,8 +65,6 @@ describe("snapshot mutation ownership boundary", () => {
|
|||||||
updatedAt: archivedAt,
|
updatedAt: archivedAt,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const unarchiveSnapshot = vi.fn(async () => true);
|
|
||||||
const unarchiveSnapshotByHandle = vi.fn(async () => undefined);
|
|
||||||
const updateAgentMetadata = vi.fn(async () => undefined);
|
const updateAgentMetadata = vi.fn(async () => undefined);
|
||||||
const directStorageWrite = vi.fn(async () => {
|
const directStorageWrite = vi.fn(async () => {
|
||||||
throw new Error("Session should not write snapshots directly");
|
throw new Error("Session should not write snapshots directly");
|
||||||
@@ -93,8 +91,6 @@ describe("snapshot mutation ownership boundary", () => {
|
|||||||
listAgents: () => [],
|
listAgents: () => [],
|
||||||
getAgent: () => null,
|
getAgent: () => null,
|
||||||
archiveSnapshot,
|
archiveSnapshot,
|
||||||
unarchiveSnapshot,
|
|
||||||
unarchiveSnapshotByHandle,
|
|
||||||
updateAgentMetadata,
|
updateAgentMetadata,
|
||||||
} as any,
|
} as any,
|
||||||
agentStorage: {
|
agentStorage: {
|
||||||
@@ -133,13 +129,6 @@ describe("snapshot mutation ownership boundary", () => {
|
|||||||
expect(archiveSnapshot).toHaveBeenCalledTimes(1);
|
expect(archiveSnapshot).toHaveBeenCalledTimes(1);
|
||||||
expect(archiveResult.archivedAt).toBeTruthy();
|
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(
|
await session.handleUpdateAgentRequest(
|
||||||
"agent-1",
|
"agent-1",
|
||||||
"Renamed agent",
|
"Renamed agent",
|
||||||
|
|||||||
Reference in New Issue
Block a user