feat(wsl-mover): pause a moving project's terminals through Sleep and prove they exited (D1b-5d) (#28820)

* feat(wsl-mover): pause a moving project's terminals through Sleep and prove they exited (D1b-5d)

* fix(wsl-mover): gate again under the fence, swap journal phases atomically, keep sessions frozen through commit (D1b-5d)

* test(wsl-mover): the fence e2e walks the journal one phase at a time, as a move writes it (D1b-5d)
This commit is contained in:
Neil
2026-10-14 13:07:50 -07:00
committed by GitHub
parent 5976c4628d
commit 8f83f6b076
37 changed files with 1306 additions and 100 deletions
@@ -266,6 +266,14 @@ function entryWorkspaceResolver(
export function withoutWorkspaces(
base: WorkspaceSessionState,
workspaceIds: ReadonlySet<string>
): WorkspaceSessionState {
return filterWorkspaceRows(base, (workspaceId) => !workspaceIds.has(workspaceId))
}
/** The scoped rows of the workspaces kept, by the same routing; global fields stay as they are. */
export function filterWorkspaceRows(
base: WorkspaceSessionState,
keepsWorkspace: (workspaceId: string) => boolean
): WorkspaceSessionState {
const worktreeIdByTabId = buildWorktreeIdByTabId(base)
const worktreeIdByFileId = buildWorktreeIdByFileId(base)
@@ -273,7 +281,7 @@ export function withoutWorkspaces(
for (const field of SESSION_FIELDS) {
const workspaceOf = entryWorkspaceResolver(field, worktreeIdByTabId, worktreeIdByFileId)
const keeps = (key: string, entry: unknown): boolean =>
!workspaceIds.has(normalizeWorkspaceSessionKeyToWorkspaceId(workspaceOf?.(key, entry) ?? ''))
keepsWorkspace(normalizeWorkspaceSessionKeyToWorkspaceId(workspaceOf?.(key, entry) ?? ''))
const value: unknown = base[field]
if (!workspaceOf || !value) {
continue
+12
View File
@@ -0,0 +1,12 @@
/** Main asks the renderer to Sleep workspaces and waits until their slept state is durable. */
export type WorktreeSleepRequest = {
requestId: string
worktreeIds: string[]
}
export type WorktreeSleepResponse = {
requestId: string
/** Workspaces whose Sleep failed; they stay awake and retryable. */
failedWorktreeIds?: string[]
error?: string
}