You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CI test and global npm installs broken by @github/copilot-sdk 1.0.29 (postinstall rewrites the vscode-jsonrpc import) #2414
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './node.js' is not defined by "exports" in .../node_modules/@github/copilot-sdk/node_modules/vscode-jsonrpc/package.json imported from .../node_modules/@github/copilot-sdk/dist/session.js
dev requires test to pass, so nothing can merge.
Users.npm install -g @bradygaster/squad-cli (1.1.0) on npm 10 or 11 (bundled with Node 22 and 24, which run install scripts automatically) produces an install where Squad's Copilot adapter can't load. Project installs break the same way after squad upgrade. The interactive shell and other Copilot features fail; squad --version still works.
Cause
copilot-sdk 1.0.29 moved from vscode-jsonrpc 8.2.1 to 10.0.0, and @bradygaster/squad-sdk accepts it ("@github/copilot-sdk": "^1.0.19").
The CLI's ESM import patch packages/squad-cli/scripts/patch-esm-imports.mjs (the squad-cli fails with ERR_MODULE_NOT_FOUND on Node 22 (vscode-jsonrpc ESM import) #449 workaround for vscode-jsonrpc 8, which had no exports map) rewrites vscode-jsonrpc/node to vscode-jsonrpc/node.js in copilot-sdk's dist/session.js. It runs as the CLI postinstall, which reaches copilot-sdk in global installs, and from squad upgrade, which patches a project's node_modules. In the CI smoke test, the rewrite comes from squad upgrade.
vscode-jsonrpc 10 exports ./node but not ./node.js, so the rewritten import fails. Without the rewrite, the import works.
Squad itself depends on vscode-jsonrpc ^9.0.3, so copilot-sdk gets its own nested 10.0.0 copy, and the script's exports patch never touches it.
Reproduced with the published 1.1.0 in a global install: after the postinstall, importing @bradygaster/squad-sdk/dist/adapter/client.js fails with ERR_PACKAGE_PATH_NOT_EXPORTED. With the rewritten line reverted, it loads.
Fix
Mitigation (closes this issue): cap @github/copilot-sdk below 1.0.29 in packages/squad-sdk/package.json. That restores the last setup that passed CI, copilot-sdk 1.0.28, which uses vscode-jsonrpc 8.2.1. Users get it in the next patch release.
Activity
fix(sdk): cap @github/copilot-sdk below 1.0.29 (github#2416)