Skip to content

fix: plugin generation fails on Windows without symlink capability #691

@WilliamBerryiii

Description

@WilliamBerryiii

Summary

npm run plugin:generate fails on Windows when the user does not have Developer Mode enabled or core.symlinks=true configured in Git. The failure is a three-layer problem:

  1. Git checkout layer: When core.symlinks=false (the Windows default), Git writes ~49-byte text stubs instead of actual symbolic links for any symlinked files in the repository.
  2. PowerShell layer: New-Item -ItemType SymbolicLink throws Win32Exception 1314 ("A required privilege is not held by the client") on non-elevated Windows without Developer Mode.
  3. No fallback layer: The New-RelativeSymlink function in PluginHelpers.psm1 has no capability detection or fallback, causing the entire plugin generation pipeline to fail.

Reproduction

  1. On Windows, ensure Developer Mode is off and Git core.symlinks is false (the default).
  2. Run npm run plugin:generate.
  3. Observe failure with Win32Exception 1314 or broken text stubs in plugins/.

Expected Behavior

Plugin generation should detect symlink capability at runtime and fall back to file copies when symlinks are unavailable. VS Code does not consume the plugins/ directory, and the upstream github/awesome-copilot repository uses fs.copyFileSync exclusively, so copies are functionally equivalent.

Proposed Fix

Replace hard-coded symlink creation with a capability-detected link-or-copy strategy (probe-once architecture):

  • Add Test-SymlinkCapability function that probes symlink creation via a temp file.
  • Replace New-RelativeSymlink with New-PluginLink supporting both symlink and copy paths.
  • Pass the capability flag from Invoke-PluginGeneration down to Write-PluginDirectory.
  • Report the selected strategy via Write-Verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions