fix(ci): combined CI workarounds (#697 + #698)#699
Conversation
Combines two CI fixes that both modify squad-ci.yml: - #697: Skip ./client export smoke test + streaming-chat sample (workaround for @github/copilot-sdk ESM bug — vscode-jsonrpc/node) - #698: Run existing patch-esm-imports.mjs after npm ci --ignore-scripts (proper fix — patches missing ESM extension at the source) Resolution: #698's approach (running the patch script) fixes the root cause, making #697's skip-based workaround unnecessary. The existing patch-esm-imports.mjs (added for issue #449) was already solving this problem but was skipped in CI because npm ci --ignore-scripts bypasses the postinstall hook that runs it. Both changes target the same workflow file and should ship together. Refs: #697, #698 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Consolidates prior CI mitigations into the workflow by explicitly running the existing ESM patch script after npm ci --ignore-scripts, addressing Node 22+ ESM resolution failures caused by @github/copilot-sdk importing vscode-jsonrpc/node without a .js extension.
Changes:
- Run
packages/squad-cli/scripts/patch-esm-imports.mjsinsamples-buildafter dependency install. - Run the same patch step in
export-smoke-testafter dependency install.
✅ CI Review: APPROVEDVerdict: Correct consolidation. The ESM patch is properly placed and applied uniformly. Workflow Correctness✅ ESM patch placement is correct. The patch runs immediately after Job Coverage✅ Both affected jobs patched consistently:
No gaps. Both jobs have identical CI sequence: Idempotency✅ Patch is idempotent. The \patch-esm-imports.mjs\ script (packages/squad-cli/scripts/patch-esm-imports.mjs) modifies vscode-jsonrpc's package.json to inject missing \�xports\ field. Running multiple times writes the same value—safe. File Scope✅ Only squad-ci.yml modified. Diff shows 2 lines added (both patch steps), 0 .squad files touched. Clean scope. Note: This consolidation eliminates the skip-based workaround (#697 approach), allowing all tests to run. The upstream issue (#707 in copilot-sdk) will determine when to remove the patch step. 🛡️ |
FIDO's Quality Review ✓Verdict: APPROVED — Sound consolidation with correct root-cause fix. Correctness ✅The ESM patch approach is solid. PR #698's strategy (run existing \patch-esm-imports.mjs\ after
Scope ✅Minimal and correct. Only .github/workflows/squad-ci.yml\ modified:
Regression Risk ✅ (Low)
Supersession ✓Both PRs properly closed:
Edge Cases Considered ✓
Sign-off: Ready to merge. No test coverage concerns — existing tests now run unblocked. |
Summary
Consolidates PRs #697 and #698, which both modify
.github/workflows/squad-ci.ymlto fix the same root cause:@github/copilot-sdk's ESM import ofvscode-jsonrpc/node(missing.jsextension) breaking CI on Linux runners.What each PR did
SKIP_SAMPLES(streaming-chat) andSKIP_EXPORTS(./client) lists to bypass the failing testspatch-esm-imports.mjsscript afternpm ci --ignore-scriptsResolution
#698's approach wins. The repo already has
packages/squad-cli/scripts/patch-esm-imports.mjs(added for issue #449) that patches the missing ESM extension. It runs as apostinstallhook, but CI usesnpm ci --ignore-scriptswhich skips lifecycle hooks. Adding an explicitnode packages/squad-cli/scripts/patch-esm-imports.mjsstep afternpm ciin both affected jobs fixes the actual problem — making #697's skip-based workaround unnecessary.What changed
.github/workflows/squad-ci.yml— 2 lines added:node packages/squad-cli/scripts/patch-esm-imports.mjsafternpm ci --ignore-scriptsnpm ci --ignore-scriptsRoot cause
@github/copilot-sdk@0.1.32'sdist/session.jsimportsvscode-jsonrpc/nodewithout a.jsextension. Sincevscode-jsonrpc@8.2.1has noexportsfield, Node.js 22+ strict ESM resolution fails. The existing patch script injects the missingexportsfield intovscode-jsonrpc/package.json.Re-enable conditions
Remove the patch steps when
@github/copilot-sdkships ESM-compliant imports (i.e.,vscode-jsonrpc/node.jsinstead ofvscode-jsonrpc/node). Upstream: github/copilot-sdk#707Why consolidate
Both PRs touch the same file with overlapping intent. Shipping them separately would create a confusing git history and the skip workaround from #697 would immediately become dead code once #698's fix lands.
Refs: #697, #698