fix(cli): update Copilot SDK to fix module loading error - #190
Merged
Conversation
@github/copilot-sdk 0.1.31 and 0.1.32 ship dist/session.js with an
extensionless import:
import { ConnectionError, ResponseError } from "vscode-jsonrpc/node";
vscode-jsonrpc@8.2.1 has no "exports" map, and Node's ESM resolver does
not probe file extensions, so the import fails to resolve and every moaw
command crashes on startup with ERR_MODULE_NOT_FOUND (cli.ts statically
imports translate.ts, which imports the SDK).
This affects all Node versions, not just Node 22+. Version 0.1.30 works,
0.1.31 and 0.1.32 are broken, and 1.0.x is fixed upstream. The previous
"^0.1.16" range resolves to <0.2.0, so it always picked the broken
0.1.32 and could never reach the fix.
Bump the range to ^1.0.11 and replace session.destroy() with
session.disconnect(), the only breaking change in 1.0.x. destroy() was
already deprecated in 0.1.x in favour of disconnect() with identical
semantics.
Refs: github/copilot-sdk#707
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Yohan Lasorsa (sinedied)
requested a review
from Christopher MANEU (cmaneu)
as a code owner
August 25, 2026 12:50
Christopher MANEU (cmaneu)
approved these changes
Aug 25, 2026
Yohan Lasorsa (sinedied)
pushed a commit
that referenced
this pull request
Aug 26, 2026
# [cli-1.6.1](cli-1.6.0...cli-1.6.1) (2026-08-26) ### Bug Fixes * **cli:** update Copilot SDK to fix module loading error ([#190](#190)) ([9deeac0](9deeac0))
Collaborator
Author
|
🎉 This PR is included in version 1.6.1 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
Yohan Lasorsa (sinedied)
added a commit
that referenced
this pull request
Sep 2, 2026
) Refresh package-lock.json within the existing semver ranges. The update had to be run with --ignore-scripts to work around an upstream packaging bug in @rimac-technology/semantic-release-monorepo (all versions, 1.1.6 through 1.2.10): the package uses pinst to strip its husky postinstall hook at pack time, but npm records the packument metadata before prepack runs. The registry therefore advertises "postinstall": "husky" while the tarball ships "_postinstall", so a fresh install runs husky (not a dependency of the package) and fails with ENOENT. Lockfile-based installs read the on-disk "_postinstall" and correctly no-op, which is why npm ci is unaffected. Also bump pull-request.yml from Node 18 to Node 22, matching deploy.yml. PR validation was two LTS majors behind the deploy and release workflows, and @github/copilot-sdk (a CLI dependency since #190) declares engines.node >= 20, so PR builds were validating against an engine the package no longer supports. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every
moawcommand crashes on startup withERR_MODULE_NOT_FOUND:src/cli.tsstatically importstranslate.ts, which statically imports@github/copilot-sdk, so the SDK is loaded for every command — not justmoaw translate.Root cause
@github/copilot-sdk0.1.31 and 0.1.32 shipdist/session.jswith an extensionless import:vscode-jsonrpc@8.2.1has noexportsmap, and Node's ESM resolver does not probe file extensions for subpath imports, so resolution fails even thoughnode.jsexists. Notablydist/client.jsin the same build uses the correctvscode-jsonrpc/node.jsform.This is not Node-version specific — reproduced identically on Node 22.23.2 and 24.19.0.
Version bisect (
node -e "import('@github/copilot-sdk')"per release):The previous range
^0.1.16caps at<0.2.0, so it always resolved to the broken 0.1.32 and could never pick up the upstream fix.Already reported and fixed upstream: github/copilot-sdk#707 (fixed by github/copilot-sdk#734), github/copilot-sdk#891, github/copilot-sdk#1651.
Changes
@github/copilot-sdkfrom^0.1.16to^1.0.11session.destroy()withsession.disconnect()— the only breaking change in 1.0.x.destroy()was already deprecated in 0.1.x in favour ofdisconnect()with identical semantics ("Disconnects this session and releases all in-memory resources. Session data on disk is preserved.")All other SDK APIs used by
translate.ts(CopilotClient,start,stop,createSession,getAuthStatus,session.on,sendAndWaitwithattachments) are unchanged in 1.0.x.Verification
tsc --noEmit -p packages/cli/tsconfig.json— cleannpm run lint --workspace=@moaw/cli— clean (2 pre-existing TODO warnings)moaw sstarts successfully on both Node 22.23.2 and Node 24.19.0Note:
moaw translateitself was not exercised end-to-end here (it requires an authenticated Copilot CLI and makes real model calls), so a manual smoke test of the translate command before release would be worthwhile.