mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
Improve the archived workspace restore flow (#2002)
* fix(app): restore missing workspaces from History Workspace and agent archival are separate lifecycles. Carry restore intent from History so closed agents can reopen archived workspaces without changing ordinary navigation. * fix(app): wait for workspace hydration before restore * fix(app): preserve History agent unarchive * fix(app): reopen archived History agents outside active directory History entries are not merged into the active session maps. Carry the row archive state through explicit restore intent so live workspaces still reopen without broadening ordinary navigation. * fix(app): ignore stale History archive state for active agents A cached History row can outlive a successful reopen. When the workspace exists, live session state now wins so an active agent is not interrupted by another refresh. * fix(app): reopen every selected archived History agent History entries without workspace IDs returned before restoration, and a second archived agent sharing an in-flight workspace restore was dropped. Preserve both agent-only and deferred reopen intent. * fix(app): require explicit workspace recovery * fix: preserve workspace recovery contracts * fix: preserve workspace recovery compatibility * fix: preserve recovered workspace session state * fix: preserve terminal navigation timing * fix(server): preserve successful workspace recovery * fix: preserve workspace recovery intent
This commit is contained in:
@@ -89,6 +89,7 @@ import type {
|
||||
PaseoConfigRaw,
|
||||
PaseoConfigRevision,
|
||||
WorkspaceCreateRequest,
|
||||
WorkspaceRecoveryState,
|
||||
} from "@getpaseo/protocol/messages";
|
||||
import type {
|
||||
AgentPermissionRequest,
|
||||
@@ -2451,6 +2452,36 @@ export class DaemonClient {
|
||||
return { pinnedAt: payload.pinnedAt };
|
||||
}
|
||||
|
||||
async inspectWorkspaceRecovery(
|
||||
workspaceId: string,
|
||||
requestId?: string,
|
||||
): Promise<WorkspaceRecoveryState> {
|
||||
const payload =
|
||||
await this.sendNamespacedCorrelatedSessionRequest<"workspace.recovery.inspect.response">({
|
||||
requestId,
|
||||
message: {
|
||||
type: "workspace.recovery.inspect.request",
|
||||
workspaceId,
|
||||
},
|
||||
});
|
||||
return payload.state;
|
||||
}
|
||||
|
||||
async restoreWorkspace(workspaceId: string, requestId?: string): Promise<void> {
|
||||
const payload =
|
||||
await this.sendNamespacedCorrelatedSessionRequest<"workspace.recovery.restore.response">({
|
||||
requestId,
|
||||
message: {
|
||||
type: "workspace.recovery.restore.request",
|
||||
workspaceId,
|
||||
},
|
||||
timeout: 150_000,
|
||||
});
|
||||
if (!payload.accepted) {
|
||||
throw new Error(payload.error ?? "Workspace recovery was rejected by the host");
|
||||
}
|
||||
}
|
||||
|
||||
async resumeAgent(
|
||||
handle: AgentPersistenceHandle,
|
||||
overrides?: Partial<AgentSessionConfig>,
|
||||
|
||||
Reference in New Issue
Block a user