-
Notifications
You must be signed in to change notification settings - Fork 267
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
Changes from all commits
3d13eb9
f93adc1
3a01960
c65b0a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -43,7 +43,7 @@ All PR review tracking artifacts reside in `.copilot-tracking/pr/review/{{normal | |||||
| review/ | ||||||
| {{normalized_branch_name}}/ | ||||||
| in-progress-review.md # Living PR review document | ||||||
| pr-reference.xml # Generated via scripts/dev-tools/pr-ref-gen.sh | ||||||
| pr-reference.xml # Generated via pr-ref-gen.sh (see script location in Phase 1) | ||||||
| handoff.md # Finalized PR comments and decisions | ||||||
| ``` | ||||||
|
|
||||||
|
|
@@ -148,7 +148,7 @@ Repeat phases as needed when new information or user direction warrants deeper a | |||||
|
|
||||||
| ### Phase 1: Initialize Review | ||||||
|
|
||||||
| Key tools: `git`, `scripts/dev-tools/pr-ref-gen.sh`, workspace file operations | ||||||
| Key tools: `git`, `pr-ref-gen.sh` (with fallback resolution), workspace file operations | ||||||
|
|
||||||
| #### Step 1: Normalize Branch Name | ||||||
|
|
||||||
|
|
@@ -160,7 +160,47 @@ Create the PR tracking directory `.copilot-tracking/pr/review/{{normalized_branc | |||||
|
|
||||||
| #### Step 3: Generate PR Reference | ||||||
|
|
||||||
| Generate `pr-reference.xml` using `./scripts/dev-tools/pr-ref-gen.sh --output "{{tracking_directory}}/pr-reference.xml"`. Pass additional flags such as `--base` when the user specifies one. | ||||||
| Locate and execute the PR reference script using environment-specific fallback patterns. | ||||||
|
|
||||||
| **For Unix-like shells (bash/zsh)**: | ||||||
|
|
||||||
| ```bash | ||||||
| # Try local first, then extension | ||||||
| SCRIPT_PATH="./scripts/dev-tools/pr-ref-gen.sh" | ||||||
| if [ ! -f "$SCRIPT_PATH" ]; then | ||||||
| SCRIPT_PATH=$(find ~/.vscode*/extensions -name "pr-ref-gen.sh" 2>/dev/null | head -1) | ||||||
| fi | ||||||
|
|
||||||
| if [ -z "$SCRIPT_PATH" ] || [ ! -f "$SCRIPT_PATH" ]; then | ||||||
| echo "Error: pr-ref-gen.sh not found. Checked ./scripts/dev-tools and VS Code extensions under ~/.vscode*/extensions." >&2 | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| "$SCRIPT_PATH" --output "{{tracking_directory}}/pr-reference.xml" | ||||||
|
||||||
| "$SCRIPT_PATH" --output "{{tracking_directory}}/pr-reference.xml" | |
| "$SCRIPT_PATH" --output ".copilot-tracking/pr/review/{{normalized_branch_name}}/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.
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" |
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 |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -60,6 +60,46 @@ Git operations via `run_in_terminal`: | |||||||||||
|
|
||||||||||||
| Workspace utilities: `list_dir`, `read_file`, `grep_search` | ||||||||||||
|
|
||||||||||||
| **Script path resolution**: Use environment-specific fallback patterns. | ||||||||||||
|
||||||||||||
| **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. |
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" |
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}" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -64,8 +64,46 @@ Add an **External References** section to work item descriptions when authoritat | |||||
|
|
||||||
| **Git context** (when `${input:includeBranchChanges}` is `true` and no documents exist): | ||||||
|
|
||||||
| * `run_in_terminal`: Generate diff XML via `scripts/dev-tools/pr-ref-gen.sh --base-branch "${input:baseBranch}" --output "<planning-folder>/git-branch-diff.xml"` | ||||||
| * Sync remote first: `git fetch <remote> <branch> --prune` | ||||||
| * `run_in_terminal`: Generate diff XML using environment-specific fallback patterns: | ||||||
|
|
||||||
| **For Unix-like shells (bash/zsh)**: | ||||||
|
|
||||||
| ```bash | ||||||
| # Try local first, then extension | ||||||
| SCRIPT_PATH="./scripts/dev-tools/pr-ref-gen.sh" | ||||||
| if [ ! -f "$SCRIPT_PATH" ]; then | ||||||
| SCRIPT_PATH=$(find ~/.vscode*/extensions -name "pr-ref-gen.sh" 2>/dev/null | head -1) | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sadly the user could have installed this as a cloned repo (somewhere) on their computer, or a submodule, etc. I think I have a for this but it might seem a little weird. I'll post a PR with the change here in a moment but it will basically take advantage of how instruction files and their descriptions are added to the system message for all conversations. Since any custom agent or prompt that needs to reference anything out of hve-core, will have this problem.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your PR #402 may help us address the fallback correctly in case of any installation method, including Extension. We do however still need to validate the extension file path resolution works because we risk your newest instruction to also not even load if loaded through Windows/WSL install mode. I will do a new dedicated PR for Extension to be set as |
||||||
| fi | ||||||
|
|
||||||
|
katriendg marked this conversation as resolved.
|
||||||
| if [ -z "$SCRIPT_PATH" ] || [ ! -f "$SCRIPT_PATH" ]; then | ||||||
| echo "Error: pr-ref-gen.sh not found. Checked ./scripts/dev-tools and VS Code extensions under ~/.vscode*/extensions." >&2 | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| "$SCRIPT_PATH" --base-branch "${input:baseBranch}" --output "<planning-folder>/git-branch-diff.xml" | ||||||
| ``` | ||||||
|
|
||||||
| **For Windows PowerShell**: | ||||||
|
|
||||||
| ```powershell | ||||||
| # Try local first, then extension | ||||||
| $ScriptPath = "./scripts/dev-tools/Generate-PrReference.ps1" | ||||||
| if (-not (Test-Path $ScriptPath)) { | ||||||
| $ScriptPath = Get-ChildItem -Path "$HOME/.vscode*/extensions" -Filter "Generate-PrReference.ps1" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName | ||||||
| } | ||||||
|
|
||||||
| if (-not $ScriptPath) { | ||||||
| Write-Error "Error: Generate-PrReference.ps1 not found. Checked ./scripts/dev-tools and VS Code extensions under ~/.vscode*/extensions." | ||||||
| exit 1 | ||||||
| } | ||||||
|
|
||||||
| # Generate reference to default location | ||||||
| pwsh -File $ScriptPath -BaseBranch "${input:baseBranch}" | ||||||
|
||||||
| pwsh -File $ScriptPath -BaseBranch "${input:baseBranch}" | |
| pwsh -File "$ScriptPath" -BaseBranch "${input:baseBranch}" |
Uh oh!
There was an error while loading. Please reload this page.