Skip to content

agent host remote server build fixes#302603

Draft
roblourens wants to merge 6 commits intomainfrom
roblou/agent-host-server-buildfixes
Draft

agent host remote server build fixes#302603
roblourens wants to merge 6 commits intomainfrom
roblou/agent-host-server-buildfixes

Conversation

@roblourens
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 17, 2026 23:21
Copy link
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

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.ts with shared helpers to (a) filter Copilot platform packages during packaging and (b) copy VS Code’s node-pty binaries into Copilot’s expected prebuilds/ 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.

Copy link
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 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.ts to 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-pty binaries into Copilot’s expected prebuilds/ 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.

Comment on lines +60 to +73
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 });
@roblourens roblourens force-pushed the roblou/agent-host-server-buildfixes branch from 04057b5 to d07950b Compare March 18, 2026 03:55
@roblourens roblourens requested a review from Copilot March 18, 2026 04:12
Copy link
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 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.ts helpers 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.

Comment on lines +48 to +50
* 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.
Comment on lines +88 to +98
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;
}
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