Prevent unrelated PR merges from archiving workspaces (#3425)

* fix(server): bind auto-archive to workspace PR state

Managed worktrees previously derived PR status from whichever branch was currently checked out, so checkout drift could attach an unrelated merged PR to the sidebar and archive flow. Pin PR lookup identity at worktree creation, fail closed on drift, and fan the same fresh PR snapshot shown in the sidebar to every workspace sharing that cwd.

* fix(server): serialize shared workspace auto-archive

* refactor(server): archive from one fresh git observation
This commit is contained in:
Mohamed Boudra
2026-08-16 10:52:43 +02:00
committed by GitHub
parent 38f176595e
commit 8625f0543a
14 changed files with 810 additions and 239 deletions
+12
View File
@@ -1322,6 +1322,10 @@ async function resolveWorktreeSourcePlan({
branchName: newBranchName,
metadataBaseRefName: normalizedBaseBranch,
metadataBaseRef: resolvedBaseBranch,
changeRequestLookupTarget: createPaseoWorktreeChangeRequestHint({
headRef: newBranchName,
localBranchName: newBranchName,
}),
addArguments: ["-b", newBranchName, "--no-track", base],
};
}
@@ -1342,6 +1346,10 @@ async function resolveWorktreeSourcePlan({
return {
branchName,
metadataBaseRefName: source.branchName,
changeRequestLookupTarget: createPaseoWorktreeChangeRequestHint({
headRef: branchName,
localBranchName: branchName,
}),
addArguments: ["-b", branchName, "--no-track", source.branchName],
};
}
@@ -1349,6 +1357,10 @@ async function resolveWorktreeSourcePlan({
return {
branchName: source.branchName,
metadataBaseRefName: source.branchName,
changeRequestLookupTarget: createPaseoWorktreeChangeRequestHint({
headRef: source.branchName,
localBranchName: source.branchName,
}),
addArguments: [source.branchName],
};
}