-
Notifications
You must be signed in to change notification settings - Fork 36
fix(extension): add workspace extension kind and script fallback patterns #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…n behavior and update agent fallbacks - add fallback patterns to locate pr-ref-gen scripts in extensions - update pr-review agent with environment-specific script resolution - add script path fallback logic to ado-create-pull-request instructions - update ado-wit-discovery with cross-platform script location patterns - configure extension to run in workspace and UI contexts
… generation fallback
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #399 +/- ##
==========================================
- Coverage 61.41% 61.38% -0.04%
==========================================
Files 17 17
Lines 3115 3115
==========================================
- Hits 1913 1912 -1
- Misses 1202 1203 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR aims to fix script discoverability when HVE-Core is installed as a VS Code extension (including WSL/remote scenarios) by (1) preferring workspace-side extension execution and (2) adding fallback script path resolution guidance in key AI artifacts.
Changes:
- Configure the extension to run in workspace context when available via
extensionKind: ["workspace", "ui"]. - Add cross-platform fallback patterns (local repo path first, then VS Code extensions folders) for locating PR reference generation scripts.
- Update ADO instruction flows and the
pr-reviewagent to reference the new fallback approach.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| extension/package.json | Adds extensionKind to prefer workspace-side execution for better filesystem alignment in remote/WSL. |
| .github/instructions/ado-wit-discovery.instructions.md | Adds bash/PowerShell fallback patterns for generating git diff XML when local scripts aren’t present. |
| .github/instructions/ado-create-pull-request.instructions.md | Adds a “Script path resolution” section and updates PR-reference generation guidance to use fallbacks. |
| .github/agents/pr-review.agent.md | Adds fallback logic to locate and run PR reference generation scripts across environments. |
…or messages and fallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
|
|
||
| Workspace utilities: `list_dir`, `read_file`, `grep_search` | ||
|
|
||
| **Script path resolution**: Use environment-specific fallback patterns. |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file now introduces script fallback resolution below, but the earlier Tooling bullets still instruct running scripts/dev-tools/pr-ref-gen.sh ... directly. To avoid conflicting guidance, update the Tooling bullet list to reference the new script path resolution (or remove the direct-path bullet).
| **Script path resolution**: Use environment-specific fallback patterns. | |
| **Script path resolution**: Use environment-specific fallback patterns instead of hardcoding `scripts/dev-tools/pr-ref-gen.sh`. If earlier instructions mention running `scripts/dev-tools/pr-ref-gen.sh` directly, treat this section as the authoritative guidance and use the resolved `SCRIPT_PATH` variable instead. |
| exit 1 | ||
| fi | ||
|
|
||
| "$SCRIPT_PATH" --output "{{tracking_directory}}/pr-reference.xml" |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{tracking_directory}} is used as an output path placeholder here, but it is not defined anywhere else in the agent. Use the explicit tracking path (e.g., .copilot-tracking/pr/review/{{normalized_branch_name}}) or define tracking_directory earlier so this command resolves deterministically.
| "$SCRIPT_PATH" --output "{{tracking_directory}}/pr-reference.xml" | |
| "$SCRIPT_PATH" --output ".copilot-tracking/pr/review/{{normalized_branch_name}}/pr-reference.xml" |
| pwsh -File $ScriptPath -BaseBranch "${input:baseBranch}" | ||
|
|
||
| # Move generated file to tracking directory | ||
| Move-Item -Path ".copilot-tracking/pr/pr-reference.xml" -Destination "{{tracking_directory}}/pr-reference.xml" -Force |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{tracking_directory}} is referenced in the Move-Item destination, but the agent never defines that placeholder/value. Use the explicit .copilot-tracking/pr/review/{{normalized_branch_name}} path (or define tracking_directory) so the generated pr-reference.xml is moved to the intended location.
| Move-Item -Path ".copilot-tracking/pr/pr-reference.xml" -Destination "{{tracking_directory}}/pr-reference.xml" -Force | |
| Move-Item -Path ".copilot-tracking/pr/pr-reference.xml" -Destination ".copilot-tracking/pr/review/{{normalized_branch_name}}/pr-reference.xml" -Force |
| } | ||
|
|
||
| # Generate reference to default location | ||
| pwsh -File $ScriptPath -BaseBranch "${input:baseBranch}" |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PowerShell snippet passes -BaseBranch "${input:baseBranch}", but this agent file does not declare any ${input:...} variables. As written, it will likely pass the literal string and fail branch resolution. Only pass -BaseBranch when the user explicitly provided one, otherwise omit it and rely on the script’s default base branch behavior; also quote $ScriptPath when invoking pwsh -File to avoid issues with spaces in paths.
| pwsh -File $ScriptPath -BaseBranch "${input:baseBranch}" | |
| pwsh -File "$ScriptPath" |
| } | ||
|
|
||
| # Generate reference to default location | ||
| pwsh -File $ScriptPath -BaseBranch "${input:baseBranch}" |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pwsh -File $ScriptPath should quote $ScriptPath (or use & $ScriptPath) to handle extension install paths that include spaces (common on Windows). Without quoting, PowerShell can split the argument and fail to launch the script.
| pwsh -File $ScriptPath -BaseBranch "${input:baseBranch}" | |
| pwsh -File "$ScriptPath" -BaseBranch "${input:baseBranch}" |
| } | ||
|
|
||
| # Generate reference to default location | ||
| pwsh -File $ScriptPath -BaseBranch "${input:baseBranch}" |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pwsh -File $ScriptPath should quote $ScriptPath (or use & $ScriptPath) so the fallback path works when the user profile or extension install path contains spaces. This makes the copy-paste snippet reliable on Windows.
| pwsh -File $ScriptPath -BaseBranch "${input:baseBranch}" | |
| pwsh -File "$ScriptPath" -BaseBranch "${input:baseBranch}" |
| exit 1 | ||
| fi | ||
|
|
||
| "$SCRIPT_PATH" --base-branch "${input:baseBranch}" --output pr-reference.xml |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bash fallback snippet writes the output to pr-reference.xml in the current working directory. Later phases expect pr-reference.xml to exist inside the planning directory under .copilot-tracking/pr/new/<normalized-branch-name>/, so this will be missed unless the terminal happens to be in that folder. Update the --output path to target the planning directory path used by the workflow.
| "$SCRIPT_PATH" --base-branch "${input:baseBranch}" --output pr-reference.xml | |
| OUTPUT_DIR=".copilot-tracking/pr/new/${input:normalizedBranchName}" | |
| mkdir -p "$OUTPUT_DIR" | |
| "$SCRIPT_PATH" --base-branch "${input:baseBranch}" --output "$OUTPUT_DIR/pr-reference.xml" |
Description
This PR fixes script accessibility issues when using the HVE-Core extension by configuring the extension to run in workspace context and adding cross-platform script fallback patterns. Previously, AI artifacts could not locate scripts packaged with the extension because they only checked local repository paths. The fix ensures scripts are discoverable whether HVE-Core is installed as a repository clone or VS Code extension across Mac, Windows, and WSL environments.
Key Changes:
Extension Configuration: Added
extensionKind: ["workspace", "ui"]to extension/package.json to ensure the extension runs on the same filesystem as terminal execution (WSL/remote/local)~/.vscode-server/extensions/(WSL) or~/.vscode-remote/extensions/(Codespaces) instead of Windows-side paths, eliminating path translation issuesScript Fallback Patterns: Updated three AI artifacts with environment-specific fallback logic:
Cross-Platform Support: Fallback patterns use
~/.vscode*/extensionsglob to automatically detect:~/.vscode/extensions(local installation)~/.vscode-server/extensions(WSL)~/.vscode-remote/extensions(Codespaces)Related Issue(s)
Fixes #397
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)Other:
.ps1,.sh,.py)Sample Prompts (for AI Artifact Contributions)
User Request:
pr-reviewfrom the agent pickerExecution Flow:
pr-reviewagent normalizes branch name.copilot-tracking/pr/review/{normalized_branch}./scripts/dev-tools/pr-ref-gen.shfirstfind ~/.vscode*/extensions -name "pr-ref-gen.sh"if local not found, or Powershell if running on Windowspr-reference.xmlwith git diff and commit historyOutput Artifacts:
.copilot-tracking/ pr/ review/ fix-397-ai-scripts-access-extension/ pr-reference.xml in-progress-review.md handoff.mdSuccess Indicators:
pr-reference.xmlis created with proper diff contentFor detailed contribution requirements, see:
Testing
Manual Testing Required:
Test Scenarios with extension installed:
WSL Environment (Ubuntu on Windows):
pr-reviewfrom the agent picker to trigger script fallback~/.vscode-server/extensions/ise-hve-essentials.hve-core-*/scripts/dev-tools/pr-ref-gen.shpr-reference.xmlis generated successfullyLocal Windows (PowerShell):
pr-reviewfrom the agent pickerGenerate-PrReference.ps1is located and executedLocal Mac/Linux (bash):
pr-reviewfrom the agent pickerpr-ref-gen.shis located and executedGitHub Codespaces:
pr-reviewfrom the agent picker~/.vscode-remote/extensions/Repository Clone Method (existing behavior):
./scripts/dev-tools/pr-ref-gen.shis used firstValidation Commands:
Before each test, verify extension installation location:
Checklist
Required Checks
AI Artifact Contributions
/prompt-analyzeto review contributionprompt-builderreviewRequired Automated Checks
The following validation commands must pass before merging:
npm run lint:mdnpm run spell-checknpm run lint:frontmatternpm run lint:md-linksnpm run lint:psSecurity Considerations
Additional Notes
Why extensionKind: ["workspace", "ui"]?
The
extensionKindconfiguration determines where the extension host process runs:["ui"]["workspace"]["workspace", "ui"]Decision rationale:
.github/instructions/*.instructions.mdfiles without cross-filesystem barriersPre-Release Testing Plan
Why Pre-Release First:
Release Sequence:
mainRollback Plan:
If critical issues emerge, revert to v2.0.1 stable and investigate. The repository clone installation method remains unaffected as a fallback.