Conversation
There was a problem hiding this comment.
Pull request overview
Refactors and extends build packaging logic to support agent host/Copilot dependencies in remote server (“reh”) builds and to share the same Copilot packaging utilities between desktop and remote build pipelines.
Changes:
- Introduces
build/lib/copilot.tswith shared helpers to (a) filter Copilot platform packages during packaging and (b) copy VS Code’snode-ptybinaries into Copilot’s expectedprebuilds/locations. - Updates the desktop packaging gulpfile to use the shared Copilot helpers (removing inline implementations).
- Updates the remote server packaging gulpfile to apply the Copilot exclude filter and to run a post-package step that copies Copilot native deps.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| build/lib/copilot.ts | New shared Copilot packaging helpers (exclude filter + native dep copy). |
| build/gulpfile.vscode.ts | Switches to shared Copilot helpers; removes duplicated inline logic. |
| build/gulpfile.reh.ts | Applies Copilot exclude filtering in server packaging and adds a post-package native dep copy task. |
There was a problem hiding this comment.
Pull request overview
This PR adjusts VS Code’s build packaging logic to better support Copilot/agent-host dependencies in remote server (REH) and desktop artifacts by centralizing Copilot-specific packaging helpers and applying them to server builds.
Changes:
- Introduces
build/lib/copilot.tsto share Copilot packaging utilities across build targets. - Applies a Copilot exclude filter to REH packaging and reuses the same filter in desktop packaging.
- Adds a REH post-packaging step to copy VS Code’s
node-ptybinaries into Copilot’s expectedprebuilds/layout.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| build/lib/copilot.ts | New shared helpers for excluding non-target Copilot platform packages and copying node-pty into Copilot prebuilds/. |
| build/gulpfile.vscode.ts | Switches to shared Copilot helpers; updates exclude filter usage and refactors native-deps copy task to call shared helper. |
| build/gulpfile.reh.ts | Adds Copilot exclude filter to server packaging and adds a post-packaging task to copy Copilot native deps. |
build/lib/copilot.ts
Outdated
| export function copyCopilotNativeDeps(platform: string, arch: string, nodeModulesDir: string): void { | ||
| const copilotBase = path.join(nodeModulesDir, '@github', 'copilot'); | ||
| const platformArch = `${platform === 'win32' ? 'win32' : platform}-${arch}`; | ||
|
|
||
| const nodePtySource = path.join(nodeModulesDir, 'node-pty', 'build', 'Release'); | ||
|
|
||
| if (!fs.existsSync(nodePtySource)) { | ||
| throw new Error(`[copyCopilotNativeDeps] node-pty source not found at ${nodePtySource}`); | ||
| } | ||
|
|
||
| // Copy node-pty (pty.node + spawn-helper) into copilot prebuilds | ||
| const copilotPrebuildsDir = path.join(copilotBase, 'prebuilds', platformArch); | ||
| fs.mkdirSync(copilotPrebuildsDir, { recursive: true }); | ||
| fs.cpSync(nodePtySource, copilotPrebuildsDir, { recursive: true }); |
04057b5 to
d07950b
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates VS Code’s build/packaging pipeline to better support running the Copilot SDK/CLI in the agent host and remote server (REH) distributions by centralizing Copilot-related packaging logic and ensuring native node-pty binaries are placed where the Copilot runtime expects them.
Changes:
- Add
build/lib/copilot.tshelpers for platform/arch normalization, Copilot platform-package filtering, and post-packaging native dependency copying. - Update desktop packaging (
build/gulpfile.vscode.ts) to use the shared helpers and normalized runtime platform/arch naming. - Update remote server packaging (
build/gulpfile.reh.ts) to apply the Copilot exclude filter and run the native dependency copy step after packaging.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| build/lib/copilot.ts | New shared build helpers for Copilot packaging filters and copying node-pty into @github/copilot/prebuilds/<platform>-<arch>. |
| build/gulpfile.vscode.ts | Refactors Copilot packaging logic to use the shared helpers and new copy routine. |
| build/gulpfile.reh.ts | Adds Copilot filtering + native dependency copying to the REH packaging flow. |
| * For platforms the copilot SDK doesn't natively support (e.g. alpine, armhf), | ||
| * ALL platform packages are stripped - that's fine because the SDK doesn't ship | ||
| * binaries for those platforms anyway, and we replace them with VS Code's own. |
| const copilotBase = path.join(nodeModulesDir, '@github', 'copilot'); | ||
| if (!fs.existsSync(copilotBase)) { | ||
| console.warn(`[copyCopilotNativeDeps] @github/copilot not found at ${copilotBase}, skipping`); | ||
| return; | ||
| } | ||
|
|
||
| const nodePtySource = path.join(nodeModulesDir, 'node-pty', 'build', 'Release'); | ||
| if (!fs.existsSync(nodePtySource)) { | ||
| console.warn(`[copyCopilotNativeDeps] node-pty source not found at ${nodePtySource}, skipping`); | ||
| return; | ||
| } |
No description provided.