Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
58cf8d8
bg todo: scope policy to current-turn activity and guard final review…
vritant24 May 12, 2026
f2d89d6
bg todo: add cross-turn awareness to background todo prompts
vritant24 May 12, 2026
422f532
bg todo: add tests for cross-turn policy scoping and turn-aware history
vritant24 May 12, 2026
04480a9
Merge branch 'main' into vritant/bg-todo-cross-turn-fix
vritant24 May 12, 2026
d33e8c2
bg todo: address PR review comments
vritant24 May 12, 2026
c34016f
fix type
vritant24 May 12, 2026
158bc91
FIx: show error message when running npm install without open workspace
ot7Deity May 20, 2026
2c95d4f
Potential fix for pull request finding
ot7Deity May 21, 2026
3b3dd1b
Hide anonymous access setting from settings ui
cwebster-99 May 21, 2026
84f19d4
Merge branch 'main' into vritant/bg-todo-cross-turn-fix
vritant24 May 21, 2026
d958242
address comments
vritant24 May 21, 2026
7271ade
Merge branch 'main' into vritant/bg-todo-cross-turn-fix
vritant24 May 21, 2026
05e9cfa
fix(chat): enhance language model reset logic for CopilotCLI session …
DonJayamanne May 21, 2026
5b8308a
build/darwin: skip @microsoft/mxc-sdk bin/ in Mach-O arch check (#317…
bryanchen-d May 21, 2026
31759ff
build(deps): bump @nevware21/ts-utils from 0.11.6 to 0.14.0 in /exten…
dependabot[bot] May 21, 2026
c57c832
Merge pull request #317854 from microsoft/hilarious-aardwolf
cwebster-99 May 21, 2026
e94cdc1
build(deps): bump @nevware21/ts-utils from 0.12.5 to 0.14.0 in /exten…
dependabot[bot] May 21, 2026
3827a8b
Smoke test for Copilot CLI via chat extension in editor window (#317140)
anthonykim1 May 21, 2026
21478da
fix(chat): add JSON schema type and validation for chatLanguageModels…
vritant24 May 21, 2026
ffe91b2
Merge branch 'main' into dev/vritant24/chatLanguageModels-intellisense
vritant24 May 21, 2026
8041ec2
fix(chat): open language models config file in modal editor part when…
vritant24 May 21, 2026
3400e0f
agentHost: adopt OTEL log channel, support logs from remote agent hos…
connor4312 May 21, 2026
2acbbb8
cli: do not block control server startup on agent host supervisor (#3…
connor4312 May 21, 2026
389d667
Potential fix for pull request finding
vritant24 May 21, 2026
31eac20
Merge pull request #316052 from microsoft/vritant/bg-todo-cross-turn-fix
vritant24 May 21, 2026
de1cfec
sessions: clean up ISessionsProvider chat API (#317875)
sandy081 May 21, 2026
a74acf0
Open agent browser pages in the background in some conditions (#317873)
kycutler May 21, 2026
3a54038
Merge pull request #317881 from microsoft/dev/vritant24/chatLanguageM…
vritant24 May 21, 2026
79ff5c4
Bump Agent host Copilot CLI to 1.0.49 (#317241)
anthonykim1 May 21, 2026
cc5fe93
refactor: move SessionPluginBundler to shared directory and update im…
DonJayamanne May 21, 2026
336d4b2
Phase 10.5: unify ClaudeAgentSession lifecycle, retire ClaudeMaterial…
TylerLeonhardt May 21, 2026
59e50e4
Fix overflowing actions in right-aligned hover widget (#317880)
kycutler May 21, 2026
55445c5
build(deps): bump @nevware21/ts-utils from 0.11.6 to 0.14.0 in /exten…
dependabot[bot] May 21, 2026
727ebe0
build(deps): bump @nevware21/ts-utils from 0.11.6 to 0.14.0 in /exten…
dependabot[bot] May 21, 2026
d2fc69a
debug: prevent run and debug action item from overflowing (#317887)
connor4312 May 22, 2026
3645d2e
Cloud agents: preserve archive state across v1↔v2 backend flip (#317860)
osortega May 22, 2026
2832948
Defer Copilot Steering Consumption Signals (#317888)
connor4312 May 22, 2026
59c987f
Expose agent sandbox advanced runtime setting (#317886)
dileepyavan May 22, 2026
9cf192a
Prevent crash when applying emulation in a new browser (#317893)
kycutler May 22, 2026
47e0dc5
feat: enhance AgentHostSessionAdapter to manage branch changes and im…
DonJayamanne May 22, 2026
0489ff1
Merge pull request #317882 from microsoft/dev/vrbhitant24/openLangMod…
vritant24 May 22, 2026
05794df
build/darwin: skip @microsoft/mxc-sdk bin/ in universal merger (#317899)
bryanchen-d May 22, 2026
4ffd589
Add code-oss-dev skill (#317811)
roblourens May 22, 2026
4658a6a
agent-host: stringify URIs in AHP JSONL logs (#317889)
roblourens May 22, 2026
0f4869f
BYOK custom endpoint: Respect user-supplied api-key / Authorization …
vijayupadya May 22, 2026
12a7c52
Fix Copilot CLI sessions hanging on patch apply after stream close (#…
Chulong-Li May 22, 2026
b6d7953
Merge pull request #317657 from ot7Deity/main
mjbvz May 22, 2026
5c25254
Sync AHP for reducer fix (#317908)
roblourens May 22, 2026
4285d2a
Register Agent Host debug log export action only in workbench (#317909)
roblourens May 22, 2026
90708bf
SSH agent host: fix reconnect failure after sleep/network-change (#31…
roblourens May 22, 2026
859cf8d
Refactor agent host session handling: use changesetFilesToChanges for…
DonJayamanne May 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
462 changes: 167 additions & 295 deletions .agents/skills/launch/SKILL.md

Large diffs are not rendered by default.

171 changes: 171 additions & 0 deletions .agents/skills/launch/scripts/launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
#!/usr/bin/env bash
# Launch Code OSS (VS Code from sources) with:
# - a fresh, slimmed copy of the authenticated user-data-dir (so Copilot/GitHub auth works)
# - an isolated --shared-data-dir (otherwise two instances share ~/.vscode-oss-shared and crash each other)
# - unique debug ports for renderer (CDP), extension host, main process, and agent host
#
# Auth on macOS comes from the OS keychain (per-app, shared automatically) plus
# the encrypted blob in User/globalStorage/state.vscdb (per-UDD). The slim copy
# keeps the auth-relevant state and drops caches / workspaceStorage / logs.
#
# Prints a single JSON line to stdout with the chosen ports + paths so the
# caller can pick them up programmatically. Logs go to stderr.
#
# Usage:
# launch.sh [--agents] [--source-user-data-dir <path>] [--repo <vscode-repo-root>]
# [--clone-extensions] [--full] [-- <extra code.sh args>]
#
# Flags:
# --clone-extensions Copy the source extensions/ into the new profile (~10s).
# Default: start with an EMPTY extensions/ dir - fastest
# and conflict-free, but no third-party extensions.
# --full Copy the entire profile (incl. extensions). Use if the
# slim copy is missing something you need.
#
# Defaults:
# --source-user-data-dir $CODE_OSS_DEV_AUTHED_USER_DATA_DIR (else ~/.vscode-oss-dev)
# --repo $PWD if it looks like a vscode checkout; otherwise pass it explicitly

set -euo pipefail
umask 077

AGENTS=0
SOURCE_UDD="${CODE_OSS_DEV_AUTHED_USER_DATA_DIR:-$HOME/.vscode-oss-dev}"
REPO=""
EXTRA_ARGS=()
CLONE_EXTENSIONS=0
FULL=0

while [[ $# -gt 0 ]]; do
case "$1" in
--agents) AGENTS=1; shift ;;
--source-user-data-dir) SOURCE_UDD="$2"; shift 2 ;;
--repo) REPO="$2"; shift 2 ;;
--clone-extensions|--copy-extensions) CLONE_EXTENSIONS=1; shift ;;
--full) FULL=1; shift ;;
--) shift; EXTRA_ARGS=("$@"); break ;;
*) echo "Unknown arg: $1" >&2; exit 2 ;;
esac
done

if [[ -z "$REPO" ]]; then
if [[ -x "$PWD/scripts/code.sh" ]]; then
REPO="$PWD"
else
echo "Could not find a vscode checkout in $PWD. Pass --repo <path>." >&2
exit 2
fi
fi

if [[ ! -d "$SOURCE_UDD" ]]; then
echo "Source user-data-dir does not exist: $SOURCE_UDD" >&2
echo "Pass --source-user-data-dir <path> or set CODE_OSS_DEV_AUTHED_USER_DATA_DIR." >&2
exit 2
fi

pick_port() {
node -e '
const net = require("net");
const s = net.createServer();
s.listen(0, "127.0.0.1", () => { const p = s.address().port; s.close(() => console.log(p)); });
'
}

CDP_PORT=$(pick_port)
EXTHOST_PORT=$(pick_port)
MAIN_PORT=$(pick_port)
AGENTHOST_PORT=$(pick_port)

STAMP=$(date +%Y%m%d-%H%M%S)-$$
RUN_DIR="${TMPDIR:-/tmp}/code-oss-dev/$STAMP"
DEST_UDD="$RUN_DIR/user-data"
SHARED_DATA_DIR="$RUN_DIR/shared-data"
mkdir -p "$DEST_UDD" "$SHARED_DATA_DIR"

# Excludes (deny-list, so future VS Code additions copy through by default).
# Anchored excludes (starting with /) match only at the top level so we don't
# accidentally strip files inside subdirs that share a name.
EXCLUDES=(
'/extensions' # handled separately below
'/workspaceStorage' 'User/workspaceStorage' # per-workspace state, incl. chat sessions
'User/History' # local file edit history
'/CachedExtensionVSIXs' # backup VSIXs
'/logs'
'/Cache' '/Code Cache' '/CachedData' '/component_crx_cache'
'/GPUCache' '/ShaderCache' '/Dawn*Cache'
'/Backups' '/blob_storage' '/BrowserMetrics' '/Crashpad'
'/Session Storage'
'/Singleton*'
'*.lock' '*.sock'
)

if [[ "$FULL" == "1" ]]; then
echo "[launch.sh] full copy: $SOURCE_UDD -> $DEST_UDD" >&2
rsync -a "$SOURCE_UDD/" "$DEST_UDD/"
else
echo "[launch.sh] slim copy: $SOURCE_UDD -> $DEST_UDD" >&2
RSYNC_ARGS=(-a)
for e in "${EXCLUDES[@]}"; do RSYNC_ARGS+=(--exclude="$e"); done
rsync "${RSYNC_ARGS[@]}" "$SOURCE_UDD/" "$DEST_UDD/"
fi

# Extensions:
# --full -> already copied above
# --clone-extensions -> copy into the new profile (~10s)
# default -> fresh empty dir
EXT_DIR="$DEST_UDD/extensions"
mkdir -p "$EXT_DIR"
if [[ "$FULL" != "1" && "$CLONE_EXTENSIONS" == "1" ]]; then
echo "[launch.sh] copying extensions: $SOURCE_UDD/extensions -> $EXT_DIR" >&2
rsync -a "$SOURCE_UDD/extensions/" "$EXT_DIR/"
fi

# Strip ELECTRON_RUN_AS_NODE, commonly inherited from VS Code's integrated
# terminal / agent runtimes; it breaks ./scripts/code.sh.
unset ELECTRON_RUN_AS_NODE

CODE_SH="$REPO/scripts/code.sh"
if [[ ! -x "$CODE_SH" ]]; then
echo "Could not find an executable Code OSS launcher at $CODE_SH. Pass --repo <vscode-repo-root>." >&2
exit 2
fi

ARGS=(
"--user-data-dir=$DEST_UDD"
"--extensions-dir=$EXT_DIR"
"--shared-data-dir=$SHARED_DATA_DIR"
"--remote-debugging-port=$CDP_PORT"
"--inspect-extensions=$EXTHOST_PORT"
"--inspect=$MAIN_PORT"
"--inspect-agenthost=$AGENTHOST_PORT"
)
if [[ "$AGENTS" == "1" ]]; then
ARGS=("--agents" "${ARGS[@]}")
fi
if (( ${#EXTRA_ARGS[@]} )); then
ARGS+=("${EXTRA_ARGS[@]}")
fi

LOG_FILE="$RUN_DIR/code.log"
echo "[launch.sh] launching: $CODE_SH ${ARGS[*]}" >&2
echo "[launch.sh] logs: $LOG_FILE" >&2

nohup "$CODE_SH" "${ARGS[@]}" >"$LOG_FILE" 2>&1 &
PID=$!

node -e '
console.log(JSON.stringify({
pid: '"$PID"',
cdpPort: '"$CDP_PORT"',
extHostPort: '"$EXTHOST_PORT"',
mainPort: '"$MAIN_PORT"',
agentHostPort: '"$AGENTHOST_PORT"',
userDataDir: process.argv[1],
extensionsDir: process.argv[2],
sharedDataDir: process.argv[3],
runDir: process.argv[4],
logFile: process.argv[5],
repo: process.argv[6],
agents: '"$AGENTS"' === 1,
}));
' "$DEST_UDD" "$EXT_DIR" "$SHARED_DATA_DIR" "$RUN_DIR" "$LOG_FILE" "$REPO"
1 change: 1 addition & 0 deletions .vscode/extensions/vscode-extras/src/npmUpToDateFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export class NpmUpToDateFeature extends vscode.Disposable {
}
const workspaceRoot = vscode.workspace.workspaceFolders?.[0]?.uri;
if (!workspaceRoot) {
void vscode.window.showErrorMessage('npm install requires an open workspace folder');
return;
}
this._terminal = vscode.window.createTerminal({ name: 'npm install', cwd: workspaceRoot });
Expand Down
4 changes: 4 additions & 0 deletions build/.moduleignore
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ zone.js/dist/**
@github/copilot/prebuilds/**
@github/copilot/clipboard/**
@github/copilot/ripgrep/**
@github/copilot/pvrecorder/**
@github/copilot/foundry-local-sdk/**
@github/copilot/mxc-bin/**
@github/copilot/sharp/**
@github/copilot/**/keytar.node

# @github/copilot platform binaries - not needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ steps:
- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
- script: |
set -e
export COPILOT_CLI_UI_SMOKE=1
APP_ROOT=$(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
APP_NAME="`ls $APP_ROOT | head -n 1`"
npm run smoketest-no-compile -- --tracing --build "$APP_ROOT/$APP_NAME"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ steps:
condition: succeededOrFailed()

- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
- script: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
- script: |
set -e
export COPILOT_CLI_UI_SMOKE=1
npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)/VSCode-linux-$(VSCODE_ARCH)"
timeoutInMinutes: 20
displayName: 🧪 Run smoke tests (Electron)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ steps:
condition: succeededOrFailed()

- ${{ if eq(parameters.VSCODE_RUN_ELECTRON_TESTS, true) }}:
- powershell: npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
- powershell: |
$env:COPILOT_CLI_UI_SMOKE = '1'
npm run smoketest-no-compile -- --tracing --build "$(agent.builddirectory)\test\VSCode-win32-$(VSCODE_ARCH)"
displayName: 🧪 Run smoke tests (Electron)
timeoutInMinutes: 20

Expand Down
6 changes: 5 additions & 1 deletion build/darwin/create-universal-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ async function main(buildDir?: string) {
'**/node_modules/@vscode/ripgrep-universal/bin/darwin-arm64/**',
'**/node_modules.asar.unpacked/@vscode/ripgrep-universal/bin/darwin-x64/**',
'**/node_modules.asar.unpacked/@vscode/ripgrep-universal/bin/darwin-arm64/**',
// @microsoft/mxc-sdk ships per-arch native binaries under bin/<arch>;
// the package includes both arm64 and x64 trees regardless of host arch.
'**/node_modules/@microsoft/mxc-sdk/bin/**',
'**/node_modules.asar.unpacked/@microsoft/mxc-sdk/bin/**',
];

await makeUniversalApp({
Expand All @@ -101,7 +105,7 @@ async function main(buildDir?: string) {
outAppPath,
force: true,
mergeASARs: true,
x64ArchFiles: '{*/kerberos.node,**/extensions/microsoft-authentication/dist/libmsalruntime.dylib,**/extensions/microsoft-authentication/dist/msal-node-runtime.node,**/node_modules/@github/copilot-darwin-*/copilot,**/node_modules/@github/copilot/prebuilds/darwin-*/*,**/node_modules.asar.unpacked/@github/copilot-darwin-*/copilot,**/node_modules.asar.unpacked/@github/copilot/prebuilds/darwin-*/*,**/extensions/copilot/node_modules/@github/copilot/sdk/prebuilds/darwin-*/*,**/extensions/copilot/node_modules/@github/copilot/sdk/ripgrep/bin/darwin-*/*,**/node_modules/@vscode/ripgrep-universal/bin/darwin-*/*,**/node_modules.asar.unpacked/@vscode/ripgrep-universal/bin/darwin-*/*}',
x64ArchFiles: '{*/kerberos.node,**/extensions/microsoft-authentication/dist/libmsalruntime.dylib,**/extensions/microsoft-authentication/dist/msal-node-runtime.node,**/node_modules/@github/copilot-darwin-*/copilot,**/node_modules/@github/copilot/prebuilds/darwin-*/*,**/node_modules.asar.unpacked/@github/copilot-darwin-*/copilot,**/node_modules.asar.unpacked/@github/copilot/prebuilds/darwin-*/*,**/extensions/copilot/node_modules/@github/copilot/sdk/prebuilds/darwin-*/*,**/extensions/copilot/node_modules/@github/copilot/sdk/ripgrep/bin/darwin-*/*,**/node_modules/@vscode/ripgrep-universal/bin/darwin-*/*,**/node_modules.asar.unpacked/@vscode/ripgrep-universal/bin/darwin-*/*,**/node_modules/@microsoft/mxc-sdk/bin/**,**/node_modules.asar.unpacked/@microsoft/mxc-sdk/bin/**}',
filesToSkipComparison: (file: string) => {
for (const expected of filesToSkip) {
if (minimatch(file, expected)) {
Expand Down
4 changes: 4 additions & 0 deletions build/darwin/verify-macho.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const FILES_TO_SKIP = [
// ripgrep-universal: single-arch binaries in per-platform directories
'**/node_modules/@vscode/ripgrep-universal/bin/darwin-*/**',
'**/node_modules.asar.unpacked/@vscode/ripgrep-universal/bin/darwin-*/**',
// MXC SDK ships per-arch native binaries under bin/<arch>; the package
// includes both arm64 and x64 trees regardless of host arch.
'**/node_modules/@microsoft/mxc-sdk/bin/**',
'**/node_modules.asar.unpacked/@microsoft/mxc-sdk/bin/**',
];

function isFileSkipped(file: string): boolean {
Expand Down
8 changes: 5 additions & 3 deletions build/gulpfile.reh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import * as cp from 'child_process';
import log from 'fancy-log';
import buildfile from './buildfile.ts';
import { fetchUrls, fetchGithub } from './lib/fetch.ts';
import { getCopilotExcludeFilter, getRipgrepExcludeFilter, prepareBuiltInCopilotRipgrepShim } from './lib/copilot.ts';
import { getCopilotExcludeFilter, getCopilotRuntimePrebuildFiles, getRipgrepExcludeFilter, prepareBuiltInCopilotRipgrepShim } from './lib/copilot.ts';


const rcedit = promisify(rceditCallback);
Expand Down Expand Up @@ -333,11 +333,13 @@ function packageTask(type: string, platform: string, arch: string, sourceFolderN

const productionDependencies = getProductionDependencies(REMOTE_FOLDER);
const dependenciesSrc = productionDependencies.map(d => path.relative(REPO_ROOT, d)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`, `!${d}/.bin/**`]).flat();
const deps = gulp.src(dependenciesSrc, { base: 'remote', dot: true })
const cleanedDeps = gulp.src(dependenciesSrc, { base: 'remote', dot: true })
// filter out unnecessary files, no source maps in server build
.pipe(filter(['**', '!**/package-lock.json', '!**/*.{js,css}.map']))
.pipe(util.cleanNodeModules(path.join(import.meta.dirname, '.moduleignore')))
.pipe(util.cleanNodeModules(path.join(import.meta.dirname, `.moduleignore.${process.platform}`)))
.pipe(util.cleanNodeModules(path.join(import.meta.dirname, `.moduleignore.${process.platform}`)));
const copilotRuntimePrebuilds = gulp.src(getCopilotRuntimePrebuildFiles(platform, arch, 'remote/node_modules'), { base: 'remote', dot: true, allowEmpty: true });
const deps = es.merge(cleanedDeps, copilotRuntimePrebuilds)
.pipe(filter(getCopilotExcludeFilter(platform, arch)))
.pipe(filter(getRipgrepExcludeFilter(platform, arch)))
.pipe(jsFilter)
Expand Down
8 changes: 5 additions & 3 deletions build/gulpfile.vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import minimist from 'minimist';
import { compileBuildWithoutManglingTask, compileBuildWithManglingTask } from './gulpfile.compile.ts';
import { compileNonNativeExtensionsBuildTask, compileNativeExtensionsBuildTask, compileAllExtensionsBuildTask, compileExtensionMediaBuildTask, cleanExtensionsBuildTask, compileCopilotExtensionBuildTask } from './gulpfile.extensions.ts';
import { copyCodiconsTask } from './lib/compilation.ts';
import { getCopilotExcludeFilter, getRipgrepExcludeFilter, prepareBuiltInCopilotRipgrepShim } from './lib/copilot.ts';
import { getCopilotExcludeFilter, getCopilotRuntimePrebuildFiles, getRipgrepExcludeFilter, prepareBuiltInCopilotRipgrepShim } from './lib/copilot.ts';
import { useEsbuildTranspile } from './buildConfig.ts';
import { promisify } from 'util';
import globCallback from 'glob';
Expand Down Expand Up @@ -328,10 +328,12 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
depFilterPattern.push('!**/*.{js,css}.map');
}

const deps = gulp.src(dependenciesSrc, { base: '.', dot: true })
const cleanedDeps = gulp.src(dependenciesSrc, { base: '.', dot: true })
.pipe(filter(depFilterPattern))
.pipe(util.cleanNodeModules(path.join(import.meta.dirname, '.moduleignore')))
.pipe(util.cleanNodeModules(path.join(import.meta.dirname, `.moduleignore.${process.platform}`)))
.pipe(util.cleanNodeModules(path.join(import.meta.dirname, `.moduleignore.${process.platform}`)));
const copilotRuntimePrebuilds = gulp.src(getCopilotRuntimePrebuildFiles(platform, arch), { base: '.', dot: true, allowEmpty: true });
const deps = es.merge(cleanedDeps, copilotRuntimePrebuilds)
.pipe(filter(getCopilotExcludeFilter(platform, arch)))
.pipe(filter(getRipgrepExcludeFilter(platform, arch)))
.pipe(jsFilter)
Expand Down
21 changes: 19 additions & 2 deletions build/lib/copilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,30 @@ export function getCopilotExcludeFilter(platform: string, arch: string): string[
const nonTargetPlatforms = copilotPlatforms.filter(p => p !== targetPlatformArch);

// Strip wrong-architecture @github/copilot-{platform} packages.
// All copilot prebuilds are stripped by .moduleignore; the copilot CLI SDK
// resolves `node-pty` from VS Code's own node_modules via `hostRequire`.
const excludes = nonTargetPlatforms.map(p => `!**/node_modules/@github/copilot-${p}/**`);

return ['**', ...excludes];
}

/**
* Returns the public @github/copilot-sdk runtime native addon files that must
* survive app/remote packaging for the target platform.
*
* .moduleignore strips @github/copilot/prebuilds/** globally because the
* internal extension SDK uses a copied sdk/prebuilds layout. Agent Host uses
* the public SDK, whose runtime addon loader expects runtime.node in the root
* prebuilds layout.
*/
export function getCopilotRuntimePrebuildFiles(platform: string, arch: string, nodeModulesRoot = 'node_modules'): string[] {
const { nodePlatform, nodeArch } = toNodePlatformArch(platform, arch);
const targetPlatformArch = `${nodePlatform}-${nodeArch}`;
const prebuildDir = path.posix.join(nodeModulesRoot, '@github', 'copilot', 'prebuilds', targetPlatformArch);

return [
path.posix.join(prebuildDir, 'runtime.node'),
];
}

/**
* Materializes the copilot CLI ripgrep shim directly inside the built-in copilot extension.
*
Expand Down
Loading
Loading