bug(cli): standalone doctor checks unrelated application node_modules instead of active runtime
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 48/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- node.js, typescript
研究方向
Start with packages/squad-cli/src/cli/commands/doctor.ts, especially checkVscodeJsonrpcExports(cwd) and checkCopilotSdkSessionPatch(cwd), then trace how the invoked CLI resolves its runtime dependencies. Add coverage for a standalone installation with healthy dependencies and an unrelated empty application node_modules, plus a genuinely broken runtime. Done means doctor reports the runtime actually in use and retains warnings for real import failures.
由索引模型根據 Issue 內容生成。
描述
Summary
Windows standalone Squad 2.0.0-preview.2 reports missing dependency/patch warnings based on the application's node_modules, even when the standalone installation's actual runtime dependencies import successfully.
An unrelated application's node_modules changes the advice to "run npm install or check dependencies". Following that advice in the application would not repair the runtime Squad is actually using.
This is distinct from the missing/broken package cases in #449 and #1190: both dependencies are healthy in the standalone runtime here. It also reproduces the confusing installed-user warning pattern previously reported in #565.
Synthetic reproduction
- Use the Windows standalone
2.0.0-preview.2distribution. - Create a synthetic application directory with an empty
node_modulesdirectory and a minimal.squad/team.md. Do not install Squad into that application. - Call the installed CLI's exported
runDoctor(syntheticApplicationDirectory); inspect these two result records:
[
{
"name": "vscode-jsonrpc exports field",
"status": "warn",
"message": "not found in node_modules — run npm install or check dependencies"
},
{
"name": "copilot-sdk session.js ESM patch",
"status": "warn",
"message": "not found in node_modules — run npm install or check dependencies"
}
]
- Separately import
vscode-jsonrpc/noderesolved relative to the standalone application'spackage.json, and import that installation's@github/copilot-sdk/dist/session.js.
Observed: both imports succeed. The same warning pair is observable from native standalone squad doctor in an application with unrelated dependencies.
The synthetic probe uses no real team files, credentials, or application data.
Source evidence
packages/squad-cli/src/cli/commands/doctor.ts:
checkVscodeJsonrpcExports(cwd)checks only<cwd>/node_modules/...and<cwd>/packages/squad-cli/node_modules/....checkCopilotSdkSessionPatch(cwd)has the same scope.- An existing
<cwd>/node_modulesis treated as a Squad development context, although it can belong entirely to the host application.
These lookups and warning messages are also present in current upstream dev at the time of this report.
Expected
Check or clearly identify the runtime actually used by the invoked Squad installation. Distinguish:
- application-local Squad dependencies genuinely in use;
- standalone/global runtime dependencies;
- an unrelated application dependency directory;
- an unverified runtime.
Do not recommend installing or patching application dependencies solely because the standalone runtime is outside the current checkout. Retain real failures for malformed exports or actual runtime import errors; an unknown lookup should not silently become success.
Suggested coverage: standalone/global installation with healthy dependencies plus an unrelated application's empty node_modules, and a separate genuinely broken runtime case.
Local handling
The warning scope and successful standalone imports are recorded separately. No application dependency was installed and no vendor source or export map was patched to silence diagnostics.
- 主要語言
- 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
-
bot:ai-assisted component:platform-js status:untriaged
難度 1/5 1 小時以內 新手友好度 74/100
midnightntwrk/platform-js#38 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
ranxianglei/billion-context#7068 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
mybigday/whisper.rn#348 ·
-
enhancement severity:low
難度 2/5 1-3 小時 新手友好度 82/100
Battle-Cattle/BCUK-Bot-4#1075 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 67/100
ilan-pinto/roaring-lions#1552 ·
維護者通常 1 天內回覆