Skip to content

Fix orphan stack worktree cleanup through macOS path aliases - #9100

Merged
Alex Ross (alexr00) merged 3 commits into
microsoft:mainfrom
kinqsradio:fix/macos-stack-worktree-cleanup
Oct 28, 2026
Merged

Alex Ross (alexr00) merged 3 commits into
microsoft:mainfrom
kinqsradio:fix/macos-stack-worktree-cleanup

Conversation

@kinqsradio

Copy link
Copy Markdown
Contributor

Orphaned stack-update worktrees are skipped on macOS when Node reports the temporary directory under /var/folders/... and Git reports the same directory under /private/var/folders/.... The lexical parent-path comparison fails, leaving the temporary worktree behind after an interrupted update.

Canonicalize paths before comparing temporary-directory and active-worktree identities. When a worktree has not been created yet, canonicalize its parent; retain lexical matching when filesystem resolution is unavailable. Capture the active key once so registration and removal use the same identity. Existing filename, process-ownership, primary-worktree and immediate-parent restrictions remain in place.

Found while investigating #9092. This does not complete that test plan's native UI sign-off.

Validation on macOS 26.2 arm64 with VS Code Insiders 1.144.0:

  • New directory-alias regression fails before the fix; 58 focused tests pass afterward across the conflict-guide, stack-branch-update and PR-stack suites. Controls cover active/live-process, primary and nested worktrees.
  • Real bundled VS Code Git API probe: a disposable dead-process worktree is skipped before the fix and removed afterward.
  • Test TypeScript compilation, changed-file ESLint/hygiene, and Node/webworker extension builds pass. Build checks use checkout-local type roots to avoid unrelated ancestor React declarations.

Linux and Windows execution, and the installed extension's native conflict-resolution UI flow, were not verified.

Copilot AI balanced review requested due to automatic review settings October 26, 2026 11:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review comments remain, and the supplied assessments indicate it is ready for approval.

No open issues 🎉

Review effort: Lite

@alexr00 Alex Ross (alexr00) added this to the 1.145.0 milestone Oct 28, 2026
Copilot AI lite review requested due to automatic review settings October 28, 2026 11:59
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) October 28, 2026 11:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Defer approval because the cross-platform path and symlink changes were validated only on macOS, leaving Linux and Windows behavior and native conflict resolution unverified.

No open issues 🎉

Review effort: Lite

@alexr00 Alex Ross (alexr00) self-assigned this Oct 28, 2026
@alexr00

Copy link
Copy Markdown
Member

/AzurePipelines run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

@alexr00
Alex Ross (alexr00) merged commit 923ef8d into microsoft:main Oct 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants