feat: remove Copilot CLI shim and clean up worker file copying#309681
Merged
DonJayamanne merged 3 commits intomainfrom Apr 14, 2026
Merged
feat: remove Copilot CLI shim and clean up worker file copying#309681DonJayamanne merged 3 commits intomainfrom
DonJayamanne merged 3 commits intomainfrom
Conversation
Contributor
Contributor
There was a problem hiding this comment.
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 intomain(). - 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 callsremoveCopilotCLIShim()and thencopyCopilotCliSharpFiles(), but both (currently) copy the samesharp → sdk/sharpfolder. This results in redundant I/O and suggests the shim-removal step isn't wired correctly. After fixingremoveCopilotCLIShimto 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
copyCopilotCliWorkerFilesno longer copies@github/copilot/worker/*.jsinto the SDK folder, but the function comment (and its name) still claim it does. As written it only deletesshims.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
joshspicer
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.