Skip to content

Add coverage for Copilot CLI node-pty shimming #314128

@anthonykim1

Description

@anthonykim1

Follow-up to #313609 / #313550.

The regression was fixed by bringing back runtime node-pty shimming for the Copilot CLI SDK path. We should add a few targeted tests so this does not regress again during SDK/layout changes.

  • Regression was for path where trying to instal lwith .vsix path failed, hence making it very difficult for chat recovery release (and had to go through entire vscode point release) otherwise shell tools from copilot cli failed to work.

Today we already have one useful guard:

  • copilotCLISDKUpgrade.spec.ts checks the Copilot SDK native-binary layout against a known allowlist. This is the existing guard for added/removed SDK native files.

The gap is around the runtime shim behavior itself:

What this issue should cover:

  • Add direct unit coverage for copyNodePtyFiles: create a temp node-pty source containing pty.node / spawn-helper, call copyNodePtyFiles, and assert the files land under node_modules/@github/copilot/sdk/prebuilds/<platform>-<arch>.
  • Add unit coverage for CopilotCLISDK.ensureShims: no shims.txt should invoke both ripgrep and node-pty shims before SDK import; existing shims.txt should skip the work.
  • Keep copilotCLISDKUpgrade.spec.ts current as the SDK native-binary layout guard.
  • Clean up the stale node-pty is no longer shimmed note in AGENTS.md.

These should run in the existing Copilot npm run test:unit PR checks. The goal is to catch the practical ways this support can regress without adding something too heavy/flaky for the first pass.

Metadata

Metadata

Assignees

Labels

copilot-cli-agentBackground Agent related features/bugsdebtCode quality issuesinsiders-releasedPatch has been released in VS Code Insidersterminal-processProblems launching processes, managing ptys, exiting, process leaks, etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions