Skip to content

feature: Add GitHub Copilot support (CLI and CHAT) ‼️‼️‼️#129

Open
npkriami18 wants to merge 4 commits intotirth8205:mainfrom
npkriami18:feature/github-copilot-support
Open

feature: Add GitHub Copilot support (CLI and CHAT) ‼️‼️‼️#129
npkriami18 wants to merge 4 commits intotirth8205:mainfrom
npkriami18:feature/github-copilot-support

Conversation

@npkriami18
Copy link
Copy Markdown

Adds MCP server integration for:

  • GitHub Copilot (VS Code Extension)
  • GitHub Copilot Chat (VS Code)
  • GitHub Copilot CLI

Uses --platform copilot for VS Code variant
Uses --platform copilot-cli for CLI variant

Platforms now: 10 (was 8)

npkriami18 and others added 2 commits April 7, 2026 09:21
Adds MCP server integration for:
- GitHub Copilot (VS Code Extension)
- GitHub Copilot Chat (VS Code)
- GitHub Copilot CLI

Uses `--platform copilot` for VS Code variant
Uses `--platform copilot-cli` for CLI variant

Platforms now: 10 (was 8)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@npkriami18 npkriami18 changed the title Add GitHub Copilot support feature : Add GitHub Copilot support ‼️‼️‼️ Apr 8, 2026
@npkriami18 npkriami18 changed the title feature : Add GitHub Copilot support ‼️‼️‼️ feature : Add GitHub Copilot support (CLI and CHAT) ‼️‼️‼️ Apr 8, 2026
@npkriami18 npkriami18 changed the title feature : Add GitHub Copilot support (CLI and CHAT) ‼️‼️‼️ feature: Add GitHub Copilot support (CLI and CHAT) ‼️‼️‼️ Apr 8, 2026
Copy link
Copy Markdown
Owner

@tirth8205 tirth8205 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding Copilot support! The structure is solid. A few issues to fix:

  1. CHANGELOG version regression. The PR adds a [2.1.1] entry, but we're already at [2.2.1]. Please remove the CHANGELOG entry — we'll add it when we cut the next release.

  2. Detection is too broad. _copilot_vscode_detected returns True if any VS Code directory exists — but that proves VS Code is installed, not Copilot. Every VS Code user would get Copilot MCP config injected. Other platforms check for platform-specific directories. Consider checking for the Copilot extension directory instead (e.g., ~/.vscode/extensions/github.copilot-*).

  3. Writes to VS Code's global settings.json. This is more invasive than other platforms which use dedicated config files. A misconfigured write could corrupt VS Code settings. Please add extra caution here (e.g., validate the JSON structure before writing).

  4. Tests are shallow. The existing TestPlatformInstall tests verify actual file writes and JSON structure. Please add similar tests for Copilot (not just that detect() returns a bool).

@npkriami18
Copy link
Copy Markdown
Author

npkriami18 commented Apr 9, 2026

Thanks for adding Copilot support! The structure is solid. A few issues to fix:

  1. CHANGELOG version regression. The PR adds a [2.1.1] entry, but we're already at [2.2.1]. Please remove the CHANGELOG entry — we'll add it when we cut the next release.
  2. Detection is too broad. _copilot_vscode_detected returns True if any VS Code directory exists — but that proves VS Code is installed, not Copilot. Every VS Code user would get Copilot MCP config injected. Other platforms check for platform-specific directories. Consider checking for the Copilot extension directory instead (e.g., ~/.vscode/extensions/github.copilot-*).
  3. Writes to VS Code's global settings.json. This is more invasive than other platforms which use dedicated config files. A misconfigured write could corrupt VS Code settings. Please add extra caution here (e.g., validate the JSON structure before writing).
  4. Tests are shallow. The existing TestPlatformInstall tests verify actual file writes and JSON structure. Please add similar tests for Copilot (not just that detect() returns a bool).

Thank you for the feedback! I've addressed all the points:

  • Removed the [2.1.1] entry from the CHANGELOG to avoid the version regression.
  • Updated _copilot_vscode_detected to specifically check for the Copilot extension directory (e.g., ~/.vscode/extensions/github.copilot-*), making detection more accurate.
  • Added extra validation before writing to VS Code's global settings.json to ensure the JSON structure is correct and prevent potential corruption.
  • Expanded the Copilot-related tests to verify file writes and JSON structure, similar to the TestPlatformInstall tests.
  • Please let me know if any further changes are needed!

npkriami18 and others added 2 commits April 9, 2026 14:40
1. Remove CHANGELOG [2.1.1] version regression entry (we're at 2.2.1;
   the entry will be added when the next release is cut).

2. Fix _copilot_vscode_detected to check for the Copilot extension
   directory (~/.vscode/extensions/github.copilot-*) rather than any
   VS Code directory. Previously any VS Code user would be detected as
   a Copilot user, causing unwanted config injection.

3. Add _validate_copilot_vscode_settings and hook it into
   install_platform_configs via a new optional 'validate' key on platform
   configs. Copilot install now skips when settings.json is missing (avoids
   creating a partial file) or is not a JSON object (avoids corruption).

4. Replace shallow bool-only tests with TestInstallCopilotConfigs — a
   full integration test class mirroring TestInstallPlatformConfigs:
   - Verifies actual file writes and JSON structure
   - Asserts existing VS Code settings are preserved after install
   - Tests idempotency (no duplicate entries on second install)
   - Tests that install is skipped when settings.json is absent
   - Tests that install is skipped when settings.json has wrong type
   - Tests dry-run does not modify the file
   - Tests Copilot CLI config writes to the correct path
   - Tests detection logic with mocked home directory

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@npkriami18 npkriami18 force-pushed the feature/github-copilot-support branch from aede802 to 95c4421 Compare April 9, 2026 09:11
@npkriami18 npkriami18 requested a review from tirth8205 April 10, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants