Discover configured Copilot instruction locations#171
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7eef072c62
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const files: ContextFileRef[] = []; | ||
| for (const location of configuredLocations) { | ||
| const absoluteLocation = path.join(rootDir, location); | ||
| const instructionFiles = await listFiles(absoluteLocation, (filePath) => /\.instructions\.md$/i.test(filePath)); |
There was a problem hiding this comment.
Support glob patterns in configured Copilot locations
When chat.instructionsFilesLocations uses a repo-relative glob such as "docs/**/*.instructions.md": true, VS Code treats that as a valid configured instruction location (the VS Code settings reference says this setting “Supports glob patterns for file paths”), but this code joins the glob text as a literal directory and calls listFiles under it, so the health/security scans silently miss Copilot instructions that are actually loaded by VS Code.
Useful? React with 👍 / 👎.
Summary
chat.instructionsFilesLocations*.instructions.mdfiles in context health/security scanscopilot-missing-applytoto configured instruction files and document v0.73.0Source
*.instructions.md,applyTo, default.github/instructions, and configurablechat.instructionsFilesLocationsfolders.Verification
pnpm vitest run tests/contextFiles.test.ts tests/contextHealth.test.tspnpm vitest run tests/contextFiles.test.ts tests/contextHealth.test.ts tests/cli.test.ts tests/init.test.ts tests/agentSurfaceMap.test.tspnpm typecheckpnpm testpnpm buildnode dist/cli.js surface-map --output contextforge-agent-surface-map.mdnode dist/cli.js agents-md-auditnode dist/cli.js doctor --summary contextforge-doctor.mdnode dist/cli.js audit --min-context-score 70 --min-cache-score 70 --min-security-score 70 --output contextforge-audit.json --report contextforge-report.htmlnode dist/cli.js publish-readiness --summary contextforge-publish-readiness.mdnode dist/cli.js scorecard --output contextforge-scorecard.mdnode dist/cli.js security-benchmarknpm pack --dry-run --jsongit diff --checkCloses #170