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:
- 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.
- 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.
- 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
- On Windows, ensure Developer Mode is off and Git
core.symlinks is false (the default).
- Run
npm run plugin:generate.
- 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.
Summary
npm run plugin:generatefails on Windows when the user does not have Developer Mode enabled orcore.symlinks=trueconfigured in Git. The failure is a three-layer problem:core.symlinks=false(the Windows default), Git writes ~49-byte text stubs instead of actual symbolic links for any symlinked files in the repository.New-Item -ItemType SymbolicLinkthrowsWin32Exception 1314("A required privilege is not held by the client") on non-elevated Windows without Developer Mode.New-RelativeSymlinkfunction inPluginHelpers.psm1has no capability detection or fallback, causing the entire plugin generation pipeline to fail.Reproduction
core.symlinksisfalse(the default).npm run plugin:generate.Win32Exception 1314or broken text stubs inplugins/.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 upstreamgithub/awesome-copilotrepository usesfs.copyFileSyncexclusively, so copies are functionally equivalent.Proposed Fix
Replace hard-coded symlink creation with a capability-detected link-or-copy strategy (probe-once architecture):
Test-SymlinkCapabilityfunction that probes symlink creation via a temp file.New-RelativeSymlinkwithNew-PluginLinksupporting both symlink and copy paths.Invoke-PluginGenerationdown toWrite-PluginDirectory.Write-Verbose.