github / github/app

Bug: Copilot CLI extensions fail to load @github/copilot-sdk in worktree-backed sessions

Đang mở
#13 0 bình luận 0 reaction 1 người được giao Được @jmoseley nhận Xem trên GitHub
Bugs feature-request
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
2.1k
Fork
153
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Summary

Extensions in `.github/extensions/` that import `@github/copilot-sdk/extension` fail with `ERR_MODULE_NOT_FOUND` when the session runs in a worktree rather than the main checkout. The Copilot CLI runtime does not appear to inject the SDK into the Node module resolution path for worktree-backed sessions.

## Repro steps

1. Create a project extension at `.github/extensions/people-sync/extension.mjs` that imports `@github/copilot-sdk/extension`
2. Open the project in the Copilot desktop app
3. Create a new worktree-backed session (any branch)
4. The extension shows as **failed** in `extensions_manage list`

## Error

```
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@github/copilot-sdk' imported from
/Users/.../copilot-worktrees/obsidian/ryanwaite-symmetrical-couscous/.github/extensions/people-sync/[eval]
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:301:9)
at packageResolve (node:internal/modules/esm/resolve:764:81)
...
```

## Expected behavior

The SDK should be available to extensions regardless of whether the session is running from the main checkout or a worktree. The runtime should inject `@github/copilot-sdk` into the module resolution path for the worktree's filesystem location, not just the main repo root.

## Environment

- macOS (Darwin)
- Node.js v25.9.0
- Copilot CLI v1.0.48-1
- Workspace type: worktree

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.