mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
Reimport archived sessions into the current workspace (#2123)
* fix(sessions): reimport archived sessions in their workspace Archived agent records were treated as active imports, hiding their provider sessions permanently. Workspace-originated imports also discarded their workspace identity and created a duplicate workspace. * fix(sessions): validate archived session restores Restore archived imports under their existing Paseo agent identity, reject stale workspace ownership, and gate workspace targeting when the host cannot honor it. * fix(sessions): roll back failed archived imports If provider resume or history hydration fails, close any partial runtime, re-archive the provider session, and restore the original stored agent record. * fix(sessions): validate restored import ownership * fix(sessions): serialize concurrent restores * fix(sessions): harden archived import recovery * fix(sessions): validate archived import placement * refactor(sessions): centralize provider session imports Keep workspace placement rollback and stored-agent activation behind their existing owners so Session remains the wire boundary.
This commit is contained in:
@@ -293,6 +293,21 @@ describe("agent detach RPC", () => {
|
||||
}
|
||||
expect(parsed.features?.agentDetach).toBe(true);
|
||||
});
|
||||
|
||||
test("parses the workspace-targeted session import feature gate", () => {
|
||||
const parsed = parseServerInfoStatusPayload({
|
||||
status: "server_info",
|
||||
serverId: "srv-test",
|
||||
features: {
|
||||
importSessionWorkspaceTarget: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!parsed) {
|
||||
throw new Error("Expected server info payload to parse");
|
||||
}
|
||||
expect(parsed.features?.importSessionWorkspaceTarget).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("agent setting action responses", () => {
|
||||
|
||||
@@ -1267,6 +1267,7 @@ export const ImportAgentRequestMessageSchema = z.object({
|
||||
sessionId: z.string().optional(),
|
||||
providerHandleId: z.string().optional(),
|
||||
cwd: z.string().optional(),
|
||||
workspaceId: z.string().optional(),
|
||||
labels: z.record(z.string(), z.string()).optional(),
|
||||
requestId: z.string(),
|
||||
});
|
||||
@@ -2560,6 +2561,8 @@ export const ServerInfoStatusPayloadSchema = z
|
||||
commitsList: z.boolean().optional(),
|
||||
// COMPAT(providerRemoval): added in v0.1.105, drop the gate when floor >= v0.1.105.
|
||||
providerRemoval: z.boolean().optional(),
|
||||
// COMPAT(importSessionWorkspaceTarget): added in v0.1.110, remove gate after 2027-01-16.
|
||||
importSessionWorkspaceTarget: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user