Skip to content

terminal: offer optional Copilot CLI installation on macOS - #341982

Merged
Don Jayamanne (DonJayamanne) merged 2 commits into
mainfrom
don/agents/install-code-insiders-with-copilot-04a3283c
Oct 16, 2026
Merged

Don Jayamanne (DonJayamanne) merged 2 commits into
mainfrom
don/agents/install-code-insiders-with-copilot-04a3283c

Conversation

@DonJayamanne

@DonJayamanne Don Jayamanne (DonJayamanne) commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #341667.

  • Extend the macOS Shell Command PATH action with an optional, localized Copilot CLI installation prompt. Keep the product-specific code/code-insiders name and existing command ID.
  • Default to Yes; explicitly choosing No preserves the existing native installation flow, and Escape cancels without installing either command.
  • On Yes, run the packaged Rust shim in a visible local terminal, then continue installing the code command without waiting for Copilot installation to finish.
  • Add macOS support for --vscode-shim install --interactive, reusing existing discovery and Homebrew/official-script installation without repeating the shim consent prompt or launching Copilot afterward.
  • Preserve AI-hidden and Copilot CLI policy controls, legacy translations, Keyboard Shortcuts metadata, uninstall behavior, and Windows/Linux behavior. Copilot's installer continues to own its PATH/profile changes.
  • Add workbench, Rust binary, and PTY regression coverage and update the existing shim documentation.
  • Use platform-native executable-path expectations in the workbench tests so Windows Electron unit tests do not compare backslashes with hard-coded POSIX separators.

Validation

Passed on macOS arm64:

Command Result
cargo test --locked --manifest-path copilot_shim/Cargo.toml Passed: 75 tests, including macOS binary and PTY cases
cargo fmt --manifest-path copilot_shim/Cargo.toml --check Passed
npm run build-fast -- --client-only Passed
./scripts/test.sh --reporter dot --run src/vs/workbench/contrib/terminal/test/electron-browser/terminalInstallActions.test.ts Passed: 15 tests after the follow-up changes
npm run typecheck-client Passed on the initial implementation; not rerun for the selection/test-only follow-up
npm run precommit -- copilot_shim/REQUIREMENTS.md src/vs/workbench/contrib/terminal/electron-browser/terminalInstallActions.ts src/vs/workbench/contrib/terminal/test/electron-browser/terminalInstallActions.test.ts Passed scoped hygiene, including ESLint
npm run valid-layers-check Passed on the initial implementation; the follow-up changes no imports
git diff --check Passed

Six isolated Code OSS Dev UI checks also passed: combined command title before extension activation, Yes/No with Yes initially active, keyboard focus/accessibility attributes, Escape cancellation, and command-title gating with Copilot CLI or AI disabled. Settings checks used a controlled reload.

Both executable-path fixtures were also checked using the actual VS Code URI/path helpers in isolated darwin and win32 contexts: the original literals mismatch on Windows, while the corrected expectations match on both platforms. This is a platform simulation, not a native Windows test run.

Validation limits

Installer tests use temporary HOME/PREFIX/PATH and fake installer tools. No real Copilot download/install, shell-profile changes, or native administrator prompt was exercised. Local validation did not include native Windows/Linux or Intel macOS runs, live remote/Agents-window flows, or VoiceOver output.

Extend the macOS PATH action with a localized Copilot opt-in and run the shipped shim in a local terminal without waiting for installation to finish.

Reuse shim discovery and installation while preserving normal launch, other-platform behavior, policy gates, and existing shell-command metadata. Add regression coverage and documentation.

Follow-up to #341667.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 08:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Two platform-dependent path expectations fail on Windows; live installation validation also remains outstanding.

1 open finding
What changed in this PR

Extends the macOS Shell Command action with optional Copilot CLI installation using the existing native shim.

Changes:

  • Adds a localized, default-No prompt with policy gating and cancellation.
  • Adds macOS install-only shim behavior without launching Copilot afterward.
  • Adds regression coverage and documents installation behavior.
File Description
src/​vs/​workbench/​electron-browser/​desktop.contribution.ts Removes legacy install-action registration.
src/​vs/​workbench/​contrib/​terminal/​test/​electron-browser/​terminalInstallActions.test.ts Tests prompts, gating, terminals, and failures.
src/​vs/​workbench/​contrib/​terminal/​electron-browser/​terminalInstallActions.ts Implements optional installation and palette labels.
src/​vs/​workbench/​contrib/​terminal/​electron-browser/​terminal.contribution.ts Registers the macOS action.
copilot_shim/​tests/​pty.rs Tests interactive installation and cancellation.
copilot_shim/​tests/​app.rs Tests existing-CLI detection without launch.
copilot_shim/​src/​runtime.rs Updates policy-enforcement comments.
copilot_shim/​src/​app.rs Implements and tests macOS install-only dispatch.
copilot_shim/​SHIM_POST_INSTALL.md Documents install-only and PATH behavior.
copilot_shim/​REQUIREMENTS.md Defines action behavior and command contracts.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Select Yes by default in the optional macOS installation picker and update its documented behavior.

Normalize both expected executable paths with URI.file(...).fsPath so the tests match the native Windows path format.

Addresses the path assertion review on #341982.

Co-authored-by: Copilot <[email protected]>
@DonJayamanne
Don Jayamanne (DonJayamanne) marked this pull request as ready for review October 16, 2026 10:14
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Anthony Kim (@anthonykim1)

Matched files:

  • src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts
  • src/vs/workbench/contrib/terminal/electron-browser/terminalInstallActions.ts
  • src/vs/workbench/contrib/terminal/test/electron-browser/terminalInstallActions.test.ts

@DonJayamanne
Don Jayamanne (DonJayamanne) merged commit 6e7a598 into main Oct 16, 2026
36 checks passed
@DonJayamanne
Don Jayamanne (DonJayamanne) deleted the don/agents/install-code-insiders-with-copilot-04a3283c branch October 16, 2026 10:18
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 16, 2026
Don Jayamanne (DonJayamanne) added a commit that referenced this pull request Oct 17, 2026
Distinguish newly installed and existing Copilot CLI installations, retain the discovered executable location, and show the terminal's localized close-on-keypress hint after completion. Preserve the existing install picker and setting checks.

Follow-up to #341982.

Co-authored-by: Copilot <[email protected]>
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.

3 participants