Make the postinstall vscode-jsonrpc rewrite conditional, then lift the copilot-sdk cap
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- github, node.js, typescript
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- TypeScript
- 星號
- 3.4k
- 分支
- 516
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 116
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/squad 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 77/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
vercel-labs/ui#809 ·
維護者通常 1 天內回覆
-
bot:ai-assisted component:platform-js status:untriaged
難度 1/5 1 小時以內 新手友好度 74/100
midnightntwrk/platform-js#38 ·
-
[bug] Second false positive on high-cost plugin alert: detection only compares patch entry id, community plugin dsh-auto | [bug] 高成本插件告警第二次误报:检测只比对 patch 条目 id,社区插件 dsh-auto-review 被认成 @deepseek-ai/dsh-experimental-auto-review可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
ranxianglei/billion-context#7068 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
mybigday/whisper.rn#348 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
six-group/six-webcomponents#600 ·