Repository navigation
Conversation
…files Co-authored-by: pelikhan <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Resolver scoping, missing-package fallback, and older-Node CommonJS regressions must be fixed, and affected workflows regenerated.
2 open issues
What changed in this PR
Moves compiler-generated Copilot SDK npm installs into .gh-aw/copilot-sdk, using embedded manifests and lockfiles to make dependency installation reproducible.
Changes:
- Generate
npm ci --ignore-scripts --no-audit --no-fundinstalls for Node.js and TypeScript profiles. - Add runtime module-resolution hooks and regenerate workflow setup.
- Update
undicito6.29.1and overridezodto4.6.6. - Expand regression tests and document the installation layout.
Review blockers: Critical findings concern session-wide hook and executable-path inheritance affecting repository tooling, and resolver failures when packages are absent from the SDK profile. Moderate findings concern unrelated dependency redirection in the reviewed generated workflows and CommonJS loading workspace dependencies instead of frozen copies on runtimes without synchronous hooks.
| File | Description |
|---|---|
pkg/workflow/data/copilot-sdk/typescript/package.json |
Pins SDK dependencies, TypeScript tooling, and dependency overrides. |
pkg/workflow/data/copilot-sdk/node/package.json |
Pins Node.js SDK dependencies and the Zod override. |
pkg/workflow/copilot_sdk_npm.go |
Embeds dependency profiles and generates installation and resolution scripts. |
pkg/workflow/copilot_sdk_npm_test.go |
Tests version pins, lockfile integrity, workspace preservation, and resolution. |
pkg/workflow/copilot_inline_driver_test.go |
Updates inline-driver installation expectations. |
pkg/workflow/copilot_engine_installation.go |
Routes Node.js and TypeScript SDK setup through locked installs. |
pkg/workflow/copilot_engine_execution.go |
Configures SDK module paths, executable paths, and resolver preloading. |
pkg/workflow/copilot_engine_basic_test.go |
Updates compiler installation assertions. |
docs/src/content/docs/reference/engines/copilot.md |
Documents SDK installation and module resolution. |
.github/workflows/workflow-skill-extractor.lock.yml |
Regenerates locked SDK installation and runtime setup. |
.github/workflows/weekly-editors-health-check.lock.yml |
Regenerates locked SDK installation and runtime setup. |
.github/workflows/visual-regression-checker.lock.yml |
Regenerates locked SDK installation and runtime setup. |
.github/workflows/smoke-copilot-sdk.lock.yml |
Updates the SDK smoke workflow’s installation and runtime setup. |
.github/workflows/slide-deck-maintainer.lock.yml |
Regenerates locked SDK installation and runtime setup. |
.github/workflows/pr-nitpick-reviewer.lock.yml |
Regenerates locked SDK installation and runtime setup. |
.github/workflows/linter-miner.lock.yml |
Regenerates locked SDK installation and runtime setup. |
.github/workflows/jsweep.lock.yml |
Regenerates locked SDK installation and runtime setup. |
.github/workflows/firewall.lock.yml |
Regenerates locked SDK installation and runtime setup. |
.github/workflows/dead-code-remover.lock.yml |
Regenerates locked SDK installation and runtime setup. |
.github/workflows/daily-report-dispatcher.lock.yml |
Regenerates locked SDK installation and runtime setup. |
.github/workflows/daily-pr-review-cursor.lock.yml |
Regenerates locked SDK installation and runtime setup. |
Review effort: Max
| @@ -121,7 +121,7 @@ func buildCopilotMCPConfigExport(workflowData *WorkflowData) string { | |||
|
|
|||
| const nodePathSetupCommand = `GH_AW_NPM_GLOBAL_ROOT="$(npm root -g 2>/dev/null || true)"; if [ -n "$GH_AW_NPM_GLOBAL_ROOT" ]; then export NODE_PATH="${GH_AW_NPM_GLOBAL_ROOT}${NODE_PATH:+:${NODE_PATH}}"; fi` | |||
| const nodeRuntimeResolutionCommand = `GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || true)"; fi; if [ -z "$GH_AW_NODE_EXEC" ]; then echo "node runtime missing on this runner — check runtimes.node in workflow YAML" >&2; exit 127; fi; ` + nodePathSetupCommand + `; "$GH_AW_NODE_EXEC"` | |||
| const nodePathSetupCommandForCopilotSDK = `GH_AW_WORKSPACE_NODE_MODULES="${GITHUB_WORKSPACE:-$PWD}/node_modules"; if [ -d "$GH_AW_WORKSPACE_NODE_MODULES" ]; then export NODE_PATH="${GH_AW_WORKSPACE_NODE_MODULES}${NODE_PATH:+:${NODE_PATH}}"; fi; ` + nodePathSetupCommand | |||
| const nodePathSetupCommandForCopilotSDK = nodePathSetupCommand + `; GH_AW_WORKSPACE_NODE_MODULES="${GITHUB_WORKSPACE:-$PWD}/node_modules"; if [ -d "$GH_AW_WORKSPACE_NODE_MODULES" ]; then export NODE_PATH="${GH_AW_WORKSPACE_NODE_MODULES}${NODE_PATH:+:${NODE_PATH}}"; fi; GH_AW_SDK_NODE_MODULES="${GITHUB_WORKSPACE:-$PWD}/.gh-aw/copilot-sdk/node_modules"; export NODE_PATH="${GH_AW_SDK_NODE_MODULES}${NODE_PATH:+:${NODE_PATH}}"; export PATH="${GH_AW_SDK_NODE_MODULES}/.bin:$PATH"; if [ -f "${GH_AW_SDK_NODE_MODULES}/../resolve.cjs" ]; then export NODE_OPTIONS="${NODE_OPTIONS:+$NODE_OPTIONS }--import=\"${GH_AW_SDK_NODE_MODULES}/../resolve.cjs\""; fi` | |||
There was a problem hiding this comment.
Fixed in 606a398. SDK hooks, NODE_PATH, and executable paths are now added only to SDK driver subprocesses; sidecars and CLI-only runs retain their normal environment, including with a retained SDK installation. Added helper and real driver/sidecar regression tests; all 571 affected JavaScript tests pass. Regenerated workflow locks.
| `const packages = ["@github/copilot-sdk", "undici", "ts-node", "typescript"];` + | ||
| `if (context.parentURL !== sdkParentURL && packages.some(pkg => specifier === pkg || specifier.startsWith(pkg + "/"))) {` + | ||
| `return { url: pathToFileURL(createRequire(sdkParentURL).resolve(specifier)).href, shortCircuit: true }; }` + |
There was a problem hiding this comment.
Fixed in 606a398. Resolver targets now come from the selected profile manifest, missing SDK lookups fall back to normal resolution, and older Node runtimes get a CommonJS fallback. Tests cover nested packages, missing subpaths, both profiles, and synchronous/asynchronous hooks on Node 22 and 24. Regenerated workflow locks.
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 58338c0
|
…make-generated-npm-and-pip-installs-d Co-authored-by: gh-aw-bot <[email protected]>
…ages Co-authored-by: gh-aw-bot <[email protected]>
Merged main with make merge-main (f2eb12d) and pushed both fixes in 606a398. Replied to both review threads; all 348 workflow locks are in sync, focused Go tests and 571 affected JS tests pass. Final local gate is blocked by the pre-existing unchecked fmt.Fprintf return at pkg/workflow/copilot_engine_execution.go:330; CodeQL timed out. I could not mark threads resolved: available PR tools support read/reply, not thread resolution, and gh has no authentication. No CI was triggered. Remaining handoff: resolve the two answered threads, human review, and CI/security verification. |
|
@copilot maintain package.json and lock in actions/setup/js/copilot-sdk and copy it instead of printf |
Co-authored-by: pelikhan <[email protected]>
Moved both profile manifests and lockfiles into |
| const nodeModules = path.join(sdkDir, "node_modules"); | ||
| return { | ||
| ...baseEnv, | ||
| NODE_OPTIONS: `${baseEnv.NODE_OPTIONS ? `${baseEnv.NODE_OPTIONS} ` : ""}--import=${JSON.stringify(resolver)}`, |
There was a problem hiding this comment.
Fixed in f8af7d3: the harness now skips the workspace resolver preload by default and only adds the resolver and SDK paths when GH_AW_TRUSTED_SDK_RESOLVER=1. Added regression coverage for default-deny and explicit opt-in.
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: db538bd
|
…make-generated-npm-and-pip-installs-d Co-authored-by: gh-aw-bot <[email protected]>
Co-authored-by: gh-aw-bot <[email protected]>
| cd "${GITHUB_WORKSPACE}/.gh-aw/copilot-sdk" | ||
| cp -- "${RUNNER_TEMP}/gh-aw/actions/copilot-sdk/node/package.json" package.json | ||
| cp -- "${RUNNER_TEMP}/gh-aw/actions/copilot-sdk/node/package-lock.json" package-lock.json | ||
| printf '%s\n' 'const { register, registerHooks, createRequire } = require("node:module");const { pathToFileURL } = require("node:url");const sdkParentURL = pathToFileURL(__filename).href;const packages = Object.keys(require("./package.json").dependencies);function resolve(specifier, context, nextResolve) {if (context.parentURL !== sdkParentURL && packages.some(pkg => specifier === pkg || specifier.startsWith(pkg + "/"))) {try { return { url: pathToFileURL(createRequire(sdkParentURL).resolve(specifier)).href, shortCircuit: true }; }catch (error) { if (error.code !== "MODULE_NOT_FOUND" && error.code !== "ERR_MODULE_NOT_FOUND") throw error; } }return nextResolve(specifier, context); }if (registerHooks) { registerHooks({ resolve }); } else {const Module = require("node:module"); const originalResolve = Module._resolveFilename;Module._resolveFilename = function(specifier, parent, ...args) {if (parent?.filename !== __filename && packages.some(pkg => specifier === pkg || specifier.startsWith(pkg + "/"))) {try { return createRequire(sdkParentURL).resolve(specifier); }catch (error) { if (error.code !== "MODULE_NOT_FOUND") throw error; } }return originalResolve.call(this, specifier, parent, ...args); };register("data:text/javascript," + encodeURIComponent('\''import { createRequire } from "node:module"; import { pathToFileURL } from "node:url";'\'' +"const packages = " + JSON.stringify(packages) + ";" +"const sdkParentURL = " + JSON.stringify(sdkParentURL) + "; export " + resolve.toString())); }' > resolve.cjs |
There was a problem hiding this comment.
@copilot refactor helper in actions/setup/js file
There was a problem hiding this comment.
Extracted the SDK driver environment builder into actions/setup/js/copilot_sdk_driver_env.cjs with colocated regression tests. Committed as 6bde786.
Co-authored-by: pelikhan <[email protected]>
|
@copilot recompile to use the env helper instead of inline js in the .lock.yml |
|
| cd "${GITHUB_WORKSPACE}/.gh-aw/copilot-sdk" | ||
| cp -- "${RUNNER_TEMP}/gh-aw/actions/copilot-sdk/node/package.json" package.json | ||
| cp -- "${RUNNER_TEMP}/gh-aw/actions/copilot-sdk/node/package-lock.json" package-lock.json | ||
| printf '%s\n' 'const { register, registerHooks, createRequire } = require("node:module");const { pathToFileURL } = require("node:url");const sdkParentURL = pathToFileURL(__filename).href;const packages = Object.keys(require("./package.json").dependencies);function resolve(specifier, context, nextResolve) {if (context.parentURL !== sdkParentURL && packages.some(pkg => specifier === pkg || specifier.startsWith(pkg + "/"))) {try { return { url: pathToFileURL(createRequire(sdkParentURL).resolve(specifier)).href, shortCircuit: true }; }catch (error) { if (error.code !== "MODULE_NOT_FOUND" && error.code !== "ERR_MODULE_NOT_FOUND") throw error; } }return nextResolve(specifier, context); }if (registerHooks) { registerHooks({ resolve }); } else {const Module = require("node:module"); const originalResolve = Module._resolveFilename;Module._resolveFilename = function(specifier, parent, ...args) {if (parent?.filename !== __filename && packages.some(pkg => specifier === pkg || specifier.startsWith(pkg + "/"))) {try { return createRequire(sdkParentURL).resolve(specifier); }catch (error) { if (error.code !== "MODULE_NOT_FOUND") throw error; } }return originalResolve.call(this, specifier, parent, ...args); };register("data:text/javascript," + encodeURIComponent('\''import { createRequire } from "node:module"; import { pathToFileURL } from "node:url";'\'' +"const packages = " + JSON.stringify(packages) + ";" +"const sdkParentURL = " + JSON.stringify(sdkParentURL) + "; export " + resolve.toString())); }' > resolve.cjs |
There was a problem hiding this comment.
@copilot store helper in file in actions/setup/js. Avoid inlining js
There was a problem hiding this comment.
Moved the resolver into actions/setup/js/copilot_sdk_resolver.cjs, copied it into the SDK directory from generated install steps, and regenerated 102 workflow locks. Commit: 05a3a78.
Co-authored-by: pelikhan <[email protected]>
|
/smoke-copilot-sdk |
|
🔬 Smoke Copilot SDK has started processing this issue comment |

Shared compiler templates multiply non-deterministic dependency installs across generated workflows. This change freezes the Node SDK dependency tree while preserving existing exact-version npm and pip defaults.
Locked SDK installs
Runtime compatibility
node_modules.Regression contracts
Human review
.gh-aw/copilot-sdk.undicifrom6.28.0to6.29.1and override vulnerable transitivezodwith4.6.6.Scope and remaining verification