github / github/app

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

Offen
#13 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @jmoseley Auf GitHub ansehen
Bugs feature-request
Vorherrschende Sprache
Keine Sprachdaten
Sterne
2.1k
Forks
153
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.