Skip to content

fix(sdk): workflow scripts run on Node 26 - #375

Merged
ChrisKrawczyk merged 3 commits into
mainfrom
fix/node26-script-net
Nov 25, 2026
Merged

ChrisKrawczyk merged 3 commits into
mainfrom
fix/node26-script-net

Conversation

@ChrisKrawczyk

@ChrisKrawczyk ChrisKrawczyk commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #388

Workflow script nodes failed on Node 26. Node 26's permission model also limits the network, so a script node started with --permission could not reach its own loopback endpoint. Every script that called setResult or a tool failed with fetch failed (ERR_ACCESS_DENIED). The engines field allows Node >=26.12.1, but CI ran only Node 24.22.1, whose permission model has no network permission, so CI did not catch it.

Fix

The runner passes --allow-net when the worker's Node has the flag (process.allowedNodeEnvironmentFlags), so a script reaches the network on Node 26 as it does on Node 24. The flag has no host scope. Node 26 prints an experimental-flag warning on the script's stderr, so the script's captured stderr differs between the two versions.

  • The docs (workflow-sessions.md, configuration.md) state this.
  • configuration.md now states the trust decision next to the opt-out: anyone who can save and start a Workflow Definition can run code with the worker's network. Where they are not all trusted with it, and scripts are not isolated by other means, set PILOTSWARM_WORKFLOW_SCRIPTS=0 on the workers, the portal and the MCP server.
  • The CHANGELOG has an Unreleased entry.

CI

A new PR-checks job, Workflow scripts (Node 26), builds the workspace on Node 26.13.0 and runs workflow-script-guard, workflow-node-guardrails and workflow-script-tool-result-limit. Every other check pins Node 24.22.1 and never reaches the --allow-net branch.

Multi-model review

Three models (Claude Opus 5.5, GPT-6.2 Sol and Gemini 4 Argon) reviewed this PR as three specialists in a threaded debate, then a synthesis kept only findings grounded in the diff. The consensus was 0 must-fix, 2 should-fix, 5 to consider and 1 trade-off.

  • TST-1 (should-fix): CI never ran the Node 26 branch. All three reviewers wanted the job in this PR; it is the new job above.
  • SEC-1 (should-fix): the trust statement in configuration.md above.
  • Consider, fixed: the isolation bullet no longer contradicts itself, the docs name the Node 26 stderr warning, and the CHANGELOG says which script nodes failed.
  • Consider, not changed: the only unit test change matches runner.ts source text; the new CI job is the behavioral test. A least-privilege broker that keeps Node 26's network denial is a separate design change.
  • Trade-off COR-3, resolved as the review recommended: Workflow scripts: name the cause when a Node major gates the network but has no --allow-net #389 makes a script fail with a named cause when a future Node major limits the network but has no --allow-net, rather than narrowing the engines range.

Validation

All runs were on Linux (Node 24.22.1, PostgreSQL 16), one suite at a time, at abce2a70, rebased on 0.8.18 (1f6af957), unless noted.

  • CI steps: lint, privacy (0 findings), deploy-scripts (402 passed, 43 skipped of 445), ci-scripts 152/152, sdk-api 63/63, SDK unit 3079/3079, campaign 57/57 and 3/3, app 99/99, 312 of 315 (3 skipped), 2134/2134 and 3/3.
  • Full run-tests.sh: 441 of 441 files; 4527 passed, 0 failed and 26 skipped of 4553.
  • New Node 26 job, simulated with Node 26.13.0: 15/15 pass. With runner.ts from main, 13 of 15 fail with fetch failed, so the job catches the bug.
  • Windows (Node 26.13.0): deploy/scripts/test/node-version.test.mjs passes. It now allows the single 26.13.0 pin, and only in pr-checks.yml.

chkraw and others added 3 commits November 24, 2026 18:00
Node 26's permission model also limits the network, so a script node
started with --permission could not reach its own loopback endpoint:
every script failed with "fetch failed" (ERR_ACCESS_DENIED). The engines
field allows Node >= 26.12.1; CI runs only Node 24.22.1, whose
permission model has no network permission, so CI did not see it.

The runner now passes --allow-net where the worker's Node has the flag
(process.allowedNodeEnvironmentFlags), so a script reaches the network on
Node 26 as it does on Node 24, as the docs already state. The flag has
no host scope. Node 26 prints an experimental-flag warning on the
script's stderr.

workflow-script-guard, workflow-node-guardrails and
workflow-script-tool-result-limit: 12 of 15 fail on Node 26.13.0
without the fix; 15 of 15 pass with it on Node 26.13.0 and 24.22.1.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cc944a13-3e0b-43de-8040-5863182bbdb0
… review)

- configuration.md: who can run script code with the worker's network, and
  when to set PILOTSWARM_WORKFLOW_SCRIPTS=0 (375-SEC-1).
- workflow-sessions.md: the network bullet no longer contradicts itself and
  names the Node 26 stderr warning (375-COR-2, 375-COR-1).
- runner.ts comment: parity is reachability, not identical stderr (375-COR-1).
- CHANGELOG: only script nodes that called setResult or a tool failed on
  Node 26 (375-COR-4).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cc944a13-3e0b-43de-8040-5863182bbdb0
Node 26's permission model limits the network, so the runner's --allow-net
grant runs only there. Every other PR check pins Node 24.22.1, which is how
the original failure shipped. The new job builds the workspace on Node 26.13.0
and runs the three workflow script test files (375-TST-1). The setup-node
policy test allows that one pin, and the CI docs say so.

Fixes #388

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cc944a13-3e0b-43de-8040-5863182bbdb0
@ChrisKrawczyk
ChrisKrawczyk merged commit 62fe621 into main Nov 25, 2026
6 checks passed
ChrisKrawczyk pushed a commit that referenced this pull request Nov 25, 2026
Take #375 (workflow scripts on Node 26). CHANGELOG.md conflicted only in
the Unreleased section: keep both entries, #375's first.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cc944a13-3e0b-43de-8040-5863182bbdb0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI never runs workflow scripts on Node 26

2 participants