Skip to content

Honor Node runtime pins in agent engine-install steps - #76803

Merged
pelikhan merged 7 commits into
mainfrom
copilot/fix-setup-node-js-override
Nov 11, 2026
Merged

pelikhan merged 7 commits into
mainfrom
copilot/fix-setup-node-js-override

Conversation

Copilot AI commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Agent engine-install steps hardcoded Node 24, overriding an earlier runtimes.node.version setup on PATH. This left the engine and agent running on an unpinned version.

  • Runtime resolution: Apply configured versions to shared Node setup and npm engine-install steps, including imported runtime settings. Preserve defaults and YAML-safe serialization.
  • Regression coverage: Cover explicit and merged pins, typed frontmatter, defaults, and safe quoting.
  • Generated workflows: Update five affected locks to retain their configured Node 22 version.

With runtimes.node.version: "24.22.1", the engine-install step now emits:

- name: Setup Node.js
  uses: actions/setup-node@… # existing action pin unchanged
  with:
    node-version: '24.22.1'
    package-manager-cache: false

Copilot AI changed the title [WIP] Fix Setup Node.js step to honor runtimes.node.version Honor Node runtime pins in agent engine-install steps Nov 11, 2026
Copilot AI requested a review from pelikhan November 11, 2026 09:03
@pelikhan
pelikhan marked this pull request as ready for review November 11, 2026 09:07
Copilot AI adaptive review requested due to automatic review settings November 11, 2026 09:07
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Generated by PR Specification Reviewer for #76803

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 181 · ◷

Generated by Ponytail Reviewer for #76803

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.5K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Matt Pocock Skills Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Matt Pocock Skills Reviewer · routed: haiku55 xhigh · ~10 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from PR Code Quality Reviewer · gpt56 · ~4 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

🔎 Code quality review by PR Code Quality Reviewer

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed PR head d61116c80a6f6f224ee247a9e254258af4da9c7e against the runtime contract in docs/src/content/docs/reference/frontmatter.md (Runtimes) and imported-runtime merge semantics in docs/src/content/docs/reference/imports.md.

Blocking finding: all five regenerated locks change the source-configured Node 22 pin to Node 24, so the generated workflows do not implement their own runtimes.node.version: "22" contract. An inline comment is anchored at .github/workflows/daily-fact.lock.yml:868; the same issue occurs in the other four affected locks. Regenerate the locks from the workflow sources and retain Node 22.

No specification synchronization is proposed: the intended runtime-pin behavior is already documented, and this is a generated-artifact conformance regression. Static review only; tests were not run per review instructions.

Generated by PR Specification Reviewer for #76803 · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review-specs to run again

uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '24'
node-version: '22'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated lock now selects Node 24, but this workflow source declares runtimes.node.version: "22". The runtime contract in docs/src/content/docs/reference/frontmatter.md (Runtimes) requires the configured version to be installed, and the same 22→24 mismatch appears in all five regenerated locks. Please regenerate these locks from their sources so the engine-install setup step emits Node 22, or otherwise preserve each source pin.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in d9f0a98: the daily-fact lock now uses Node 22, matching the workflow source.

@github-actions

Copy link
Copy Markdown
Contributor

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-11T09:15:00Z
review_event: REQUEST_CHANGES
top_themes: [runtime action override consistency]
files_reviewed: [pkg/workflow/nodejs.go, pkg/workflow/runtime_setup_test.go, pkg/workflow/threat_detection_engine_env_test.go]
comment_count: 1

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again

Comment thread pkg/workflow/nodejs.go Outdated

if len(npmSteps) > 0 {
steps = append(steps, npmSteps[0]) // Node.js setup step
nodeSetupStep := rewriteNodeSetupStep(npmSteps[0], "", resolveNodeSetupVersion(workflowData))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The engine-install path now rewrites only the version (actionRef is explicitly empty), so runtimes.node.action-repo / action-version overrides remain ignored here while the workflow-specific setup path uses resolveNodeSetupActionRef. This can make the engine setup use a different action than the configured runtime. Please pass the resolved action ref here as well (and add coverage for an engine-install action override).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 621a6411: engine Node setup now uses the resolved action ref, with coverage for runtime action overrides.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

Found one actionable issue: the npm engine-install setup rewrites the Node version but leaves configured Node action overrides unapplied, creating inconsistent setup behavior across paths. See the inline comment.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change to honor configured Node versions during engine installation.

No open issues 🎉

What changed in this PR

Fixes #76559 by making gh-aw’s agent engine-install steps honor runtimes.node.version, preventing a later Node setup step from overriding the configured runtime.

Changes:

  • Apply resolved Node versions to shared setup and npm engine-install steps while preserving defaults and YAML-safe serialization.
  • Extend regression coverage for runtime pins and safe quoting.
  • Update five generated workflows to retain their configured Node 22 version.
File Description
pkg/​workflow/​threat_detection_engine_env_test.go Tests runtime versions in agent setup and Claude installation, plus safe serialization.
pkg/​workflow/​runtime_setup_test.go Expects npm engine installation to honor Node 22.
pkg/​workflow/​nodejs.go Applies resolved runtime versions to Node setup steps.
.github/​workflows/​unbloat-docs.lock.yml Retains Node 22 during engine installation.
.github/​workflows/​hippo-embed.lock.yml Retains Node 22 during engine installation.
.github/​workflows/​daily-news.lock.yml Retains Node 22 during engine installation.
.github/​workflows/​daily-hippo-learn.lock.yml Retains Node 22 during engine installation.
.github/​workflows/​daily-fact.lock.yml Retains Node 22 during Codex installation.

Review effort: Balanced (auto)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /codebase-design, /diagnosing-bugs, and /tdd. The fix is correct for the cases tested, and the five regenerated locks match compiler output. Posting observations only, with no blocking issues.

📋 Key Themes & Highlights

Key Themes

  • Implicit step-identity assumption: buildNpmEngineInstallStepsWithAWF rewrites npmSteps[0] unconditionally. On the Copilot path that element is a run step, so this is safe only by accident.
  • Scope gap: runtimes.node.action-repo and action-version are not honored on the engine-install path. This is pre-existing, and I confirmed it with a probe compile.
  • Test coverage: the new engine-install assertion covers Claude only. Pi and Copilot also reach this path.

Positive Highlights

  • ✅ generateNodeJsSetupStep now routes through the shared rewriteNodeSetupStep, so version quoting is consistent across call sites.
  • ✅ Regression tests assert the actual node-version value, not just that the step exists.
  • ✅ Lock files for daily-fact, daily-hippo-learn, daily-news, hippo-embed, and unbloat-docs now emit '22', matching the source runtimes.node.version.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~10 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

Comment thread pkg/workflow/nodejs.go Outdated

if len(npmSteps) > 0 {
steps = append(steps, npmSteps[0]) // Node.js setup step
nodeSetupStep := rewriteNodeSetupStep(npmSteps[0], "", resolveNodeSetupVersion(workflowData))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] buildNpmEngineInstallStepsWithAWF rewrites npmSteps[0] as the Node.js step, but on the Copilot path that element is the Install GitHub Copilot CLI run step (copilot_installer.go). The rewrite is a no-op only because that step has no node-version: line today.

💡 Suggested guard

Match by step name, as applyNodeSetupOverrides does, so an unrelated step is never rewritten:

step := npmSteps[0]
if extractStepName(strings.Join(step, "\n")) == "Setup Node.js" {
    step = rewriteNodeSetupStep(step, "", resolveNodeSetupVersion(workflowData))
}
steps = append(steps, step)

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 621a6411: the shared installer rewrites only the step named Setup Node.js; Copilot’s installer step remains unchanged.

Comment thread pkg/workflow/nodejs.go
return GitHubActionStep{
step := GitHubActionStep{
" - name: Setup Node.js",
" uses: " + getActionPinForData("actions/setup-node", data),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/diagnosing-bugs] The version is honored, but runtimes.node.action-version and action-repo are not applied on the engine-install path, because getActionPinForData ignores overrides. I compiled a Claude workflow with action-version: v6.0.0, and both Setup Node steps still pinned v7.1.0. The runtime setup step behaves the same way, so this looks pre-existing rather than a regression from this PR. Consider a follow-up issue or a note in the PR description so the scope is explicit.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 621a6411: explicit action-version is honored by both runtime setup and engine installation instead of silently selecting the latest pin.

if data == nil {
data = &WorkflowData{}
}
installSteps := NewClaudeEngine().GetInstallationSteps(data)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] This engine-install check only covers Claude. Pi (pi_engine.go:232) also reaches the nil-data GenerateNodeJsSetupStep() through IncludeNodeSetup, and Copilot takes a separate path via copilot_engine_installation.go:154. Table-drive the check across every engine that installs Node, each with a non-default runtimes.node.version, so a regression in any one caller fails a test.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 621a6411: regression coverage now spans Claude, Codex, Gemini, Pi, and Copilot, checking the configured Node version where setup is used and preserving Copilot’s separate installer step.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (.github/workflows/daily-fact.lock.yml:868): address unresolved feedback - Review comment
  3. Review (pkg/workflow/nodejs.go:271): address unresolved feedback - Review comment
  4. Review (pkg/workflow/nodejs.go:271): address unresolved feedback - Review comment
  5. Review (pkg/workflow/nodejs.go:35): address unresolved feedback - Review comment
  6. Review (pkg/workflow/threat_detection_engine_env_test.go:482): address unresolved feedback - Review comment

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "d61116c80a6f6f224ee247a9e254258af4da9c7e",
  "kind": "requested",
  "schema_version": "1",
  "state": "6d5137384eb3b83a654588c19158fbe7f4182cab9ac0c3f7fe3abd45b294949f",
  "work": [
    "08f0a844a44554b28864f1aca5d5132b898f2844f1c257a6aaefa7601c1d0d59",
    "3099e9c18250e081fead667fff9c001d35072f33b47c7cd9a5f563e77076b6b5",
    "4e0ced2da229db585d1cbb3698603616de7de0cfe6403ef078974c5250dbea40",
    "87649bfcd6d388b3f28a9cce8412a43adb6042af7cb8444305ef9b874adf63bc",
    "dab9c4206ec4c31518e61a59621f05f368b7ebf7b083b008dd30770421d372f3"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

@github-actions

Copy link
Copy Markdown
Contributor

Category: bug | Risk: medium | Score: 73/100 (impact 39 + urgency 19 + quality 15). Recommended action: batch_review. Batch: pr-batch:copilot-runtime. Reason: runtime pinning fix is important but best reviewed alongside neighboring environment hardening.

Generated by 🔧 PR Triage Agent · copilot · mai11 · ~5 AIC · ⌖ ~2 AIC · ⊞ 15.9K · ◷

@pelikhan
pelikhan merged commit 8b375b0 into main Nov 11, 2026
94 checks passed
@pelikhan
pelikhan deleted the copilot/fix-setup-node-js-override branch November 11, 2026 18:06
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent-job engine-install "Setup Node.js" step ignores runtimes.node.version

4 participants