Skip to content

feat: remove Copilot CLI shim and clean up worker file copying#309681

Merged
DonJayamanne merged 3 commits intomainfrom
don/elderly-anaconda
Apr 14, 2026
Merged

feat: remove Copilot CLI shim and clean up worker file copying#309681
DonJayamanne merged 3 commits intomainfrom
don/elderly-anaconda

Conversation

@DonJayamanne
Copy link
Copy Markdown
Contributor

Eliminate the Copilot CLI shim and streamline the process of copying worker files. This change simplifies the codebase and improves maintainability. Testing can be done by verifying the functionality of the worker files after the cleanup.

Copilot AI review requested due to automatic review settings April 14, 2026 00:14
@DonJayamanne DonJayamanne self-assigned this Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 14, 2026

Screenshot Changes

Base: dff36cce Current: 4bdb69de

Changed (2)

agentSessionsViewer/CompletedUnread/Light
Before After
before after
agentSessionsViewer/CompletedUnread/Dark
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 remove the Copilot CLI shim and simplify postinstall-time copying of Copilot SDK dependencies within the extensions/copilot package.

Changes:

  • Added a postinstall step intended to remove a Copilot CLI shim marker file (shims.txt).
  • Introduced a new removeCopilotCLIShim() step and wired it into main().
  • Adjusted the postinstall flow around copying Copilot SDK assets (sharp/definitions/etc.).
Show a summary per file
File Description
extensions/copilot/script/postinstall.ts Modifies postinstall steps for Copilot CLI shim handling and SDK-related file operations

Copilot's findings

Comments suppressed due to low confidence (2)

extensions/copilot/script/postinstall.ts:184

  • main() now calls removeCopilotCLIShim() and then copyCopilotCliSharpFiles(), but both (currently) copy the same sharp → sdk/sharp folder. This results in redundant I/O and suggests the shim-removal step isn't wired correctly. After fixing removeCopilotCLIShim to do what its name implies, also ensure the call order and duplication here are resolved.
	await removeCopilotCLIShim();
	await copyCopilotCliWorkerFiles();
	await copyCopilotCliSharpFiles();
	await copyCopilotCliDefinitionFiles();

extensions/copilot/script/postinstall.ts:71

  • copyCopilotCliWorkerFiles no longer copies @github/copilot/worker/*.js into the SDK folder, but the function comment (and its name) still claim it does. As written it only deletes shims.txt, so the required worker files may be missing at runtime. Either restore the worker directory copy here (e.g., worker → sdk/worker) or rename/split this into a dedicated shim-removal step and keep worker copying separate.
/**
 * @github/copilot/sdk/index.js depends on @github/copilot/worker/*.js files.
 * We need to copy these files into the sdk directory to ensure they are available at runtime.
 */
async function copyCopilotCliWorkerFiles() {
	const shimsPath = path.join(REPO_ROOT, 'node_modules', '@github', 'copilot', 'shims.txt');
	await fs.promises.rm(shimsPath, { force: true }).catch(() => { /* ignore */ });
}
  • Files reviewed: 1/1 changed files
  • Comments generated: 3

Comment thread extensions/copilot/script/postinstall.ts Outdated
Comment thread extensions/copilot/script/postinstall.ts Outdated
Comment thread extensions/copilot/script/postinstall.ts Outdated
@DonJayamanne DonJayamanne merged commit 2369967 into main Apr 14, 2026
26 checks passed
@DonJayamanne DonJayamanne deleted the don/elderly-anaconda branch April 14, 2026 02:41
@vs-code-engineering vs-code-engineering Bot added this to the 1.117.0 milestone Apr 14, 2026
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