Restore archived agents from History (#2316)
* fix(app): restore archived agents from History History navigation lost the explicit archived-agent intent during tab reconciliation, and workspace recovery stopped after restoring the workspace. Preserve the selected tab and recover its provider session as one action while serializing provider resume with timeline hydration. * fix(app): preserve archived agent recovery invariants * fix(server): preserve timeline hydration call shape * fix(app): retain agent tabs through lookup * fix(server): upgrade in-flight timeline broadcast
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveWorkspaceRecoveryModel } from "./model";
|
||||
import { recoverWorkspaceSelection, resolveWorkspaceRecoveryModel } from "./model";
|
||||
|
||||
describe("resolveWorkspaceRecoveryModel", () => {
|
||||
it("keeps newer recovery actions visible but non-actionable", () => {
|
||||
@@ -29,3 +29,24 @@ describe("resolveWorkspaceRecoveryModel", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("recoverWorkspaceSelection", () => {
|
||||
it("restores the workspace and selected archived agent as one recovery action", async () => {
|
||||
const operations: string[] = [];
|
||||
|
||||
await recoverWorkspaceSelection({
|
||||
workspaceId: "workspace-1",
|
||||
agentId: "agent-1",
|
||||
client: {
|
||||
restoreWorkspace: async (workspaceId) => {
|
||||
operations.push(`workspace:${workspaceId}`);
|
||||
},
|
||||
refreshAgent: async (agentId) => {
|
||||
operations.push(`agent:${agentId}`);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(operations).toEqual(["workspace:workspace-1", "agent:agent-1"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user