Make the postinstall vscode-jsonrpc rewrite conditional, then lift the copilot-sdk cap
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- github, node.js, typescript
Rechercherichtung
Start with packages/squad-cli/scripts/patch-esm-imports.mjs and trace which vscode-jsonrpc copy packages/squad-cli resolves from Copilot SDK's session.js; compare the 8.x and nested 10.x layouts. Read the doctor check in packages/squad-cli/src/cli/commands/doctor.ts and the runtime resolver hook in packages/squad-cli/src/cli-entry.ts. Add regression tests for both layouts, then lift the SDK cap and run test/cli-packaging-smoke.test.ts with copilot-sdk 1.0.29 or later.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Follow-up to #2414, which caps @github/copilot-sdk below 1.0.29 as a mitigation.
Problem
packages/squad-cli/scripts/patch-esm-imports.mjs runs as the CLI postinstall and from squad upgrade (packages/squad-cli/src/cli/core/upgrade.ts:1113-1114). It patches unconditionally:
- Layer 1 replaces the
exportsmap of everyvscode-jsonrpccopy in its search roots whose map lacks./node.js. That includes valid 9.x and 10.x maps. It never sees the copy nested under@github/copilot-sdk/node_modules. - Layer 2 rewrites
vscode-jsonrpc/nodetovscode-jsonrpc/node.jsin copilot-sdk'sdist/session.js.
copilot-sdk 1.0.29 and later depend on vscode-jsonrpc 10, which exports ./node but not ./node.js, so the rewrite breaks the import with ERR_PACKAGE_PATH_NOT_EXPORTED.
Proposed fix
- Rewrite only when the
vscode-jsonrpcthatsession.jsactually resolves to has noexportsmap (8.x). Otherwise leave the import alone. Consider undoing an earlier rewrite when the resolved copy doesn't export./node.js. - Add an
exportsmap only to copies that have none. Don't overwrite valid maps. - Apply the same condition to the
squad doctorcheck (packages/squad-cli/src/cli/commands/doctor.ts:521-539), which currently tells users to run the postinstall whenever the import has no extension. - Review the runtime resolver hook in
packages/squad-cli/src/cli-entry.ts:42-52. - Add regression tests for an 8.x layout and a nested 10.x layout. Then lift the cap in
packages/squad-sdk/package.jsonand confirmtest/cli-packaging-smoke.test.tspasses with copilot-sdk 1.0.29 or later.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 3.4k
- Forks
- 516
- Ø Merge
- 1 T. 15 Std.
- Gemergte PRs (30 T.)
- 116
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/squad
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
bot:ai-assisted component:platform-js status:untriaged
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 74/100
midnightntwrk/platform-js#38 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
ranxianglei/billion-context#7068 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
mybigday/whisper.rn#348 ·
-
enhancement severity:low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Battle-Cattle/BCUK-Bot-4#1075 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
ilan-pinto/roaring-lions#1552 ·
Maintainer antworten meist innerhalb von 1 Tag