fix(extension): inline agent content instead of path stubs in packaged plugins#907
Conversation
When plugins are packaged in non-symlink environments (e.g., Windows without Developer Mode), agent files were being written as single-line relative path references instead of actual YAML frontmatter content. This caused Copilot CLI to fail with 'frontmatter is malformed' errors on all agent files. The fix changes New-PluginLink to copy actual file content when symlinks are not supported, ensuring agent files have valid YAML frontmatter in installed plugins. Fixes microsoft#785 Co-Authored-By: Stable Genius <noreply@anthropic.com>
|
@ Maintainers - please hold on this until we can fully confirm the backing issue is as described and we're sure of the approach. I'm on a windows box and can test this, but won't have time for a bit. @peterbryntesson .... if you have access to windows bare metal ... this would be a cool one to run to ground to make sure this fix is correct and we can generate these files correctly (e.g. the fake symlinks) without having to run the regenerate plugins in Admin via powershell. |
|
@stablegenius49 - please sign the LCA |
|
@stablegenius49 - I'm going to take over this branch and complete the work here so that you contribution marker remains. I really appreciate you taking a run at this one and your solution is close, but needs some additions. Should have this completed and tested today, but not sure I'll be able to cut a release until next week due to the other changes we've already merged down into main. |
|
We've updated the PR description to align with the current pull request template. All original content has been preserved and relocated into the appropriate template sections. No action needed on your end — though you're welcome to review the updated description and fill in any remaining sections (testing details, checklist confirmations, etc.) at your convenience. |
|
@microsoft-github-policy-service agree |
|
PR Compliance Update — Added the missing
The PR body and |
Pull Request
Description
When plugins are packaged in non-symlink environments (e.g., Windows without Developer Mode, or when Copilot CLI installs plugins), agent files were being written as single-line relative path references instead of actual YAML frontmatter content. This caused Copilot CLI to fail with 'frontmatter is malformed' errors on all agent files.
Root Cause
The
New-PluginLinkfunction was writing text stubs containing relative paths when symlinks were not supported. The Copilot CLI expects agent.mdfiles to begin with valid YAML frontmatter (---delimited block with at least adescriptionfield), but received single-line path strings instead.Fix
Changed
New-PluginLinkto copy the actual file content when symlinks are not supported, ensuring agent files have valid YAML frontmatter in installed plugins.Before:
After:
Related Issue(s)
Fixes #785
Type of Change
Select all that apply:
Code & Documentation:
Infrastructure & Configuration:
AI Artifacts:
prompt-builderagent and addressed all feedback.github/instructions/*.instructions.md).github/prompts/*.prompt.md).github/agents/*.agent.md).github/skills/*/SKILL.md)Other:
.ps1,.sh,.py)Testing
This fix ensures:
copilot plugin installValidation
Checklist
Required Checks
Required Automated Checks
The following validation commands must pass before merging:
npm run lint:mdnpm run spell-checknpm run lint:frontmatternpm run validate:skillsnpm run lint:md-linksnpm run lint:psnpm run plugin:generateSecurity Considerations
Additional Notes