Skip to content

Suppress Node.js ExperimentalWarning in Copilot SDK subprocess to fix Node 24 stage failures#84

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-cli-subprocess-stages
Open

Suppress Node.js ExperimentalWarning in Copilot SDK subprocess to fix Node 24 stage failures#84
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-cli-subprocess-stages

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

Node.js v24+ emits ExperimentalWarning: SQLite is an experimental feature to stderr when the SQLite module is loaded. The @github/copilot-sdk treats any stderr output as fatal when its CLI subprocess exits, causing every agent-based pipeline stage to fail with CLI server exited with code 0 despite the process succeeding.

Changes

  • CopilotProvider.tsbuildChildEnv() injects --disable-warning=ExperimentalWarning into NODE_OPTIONS for the SDK child process, suppressing the warning at the Node.js runtime level without affecting the parent process's process.env
  • BaseAgent.ts — adds 'cli server exited' to the retryable error patterns so transient subprocess failures are retried up to 3× with exponential backoff
function buildChildEnv(): Record<string, string | undefined> {
  const env = { ...process.env }
  const flag = '--disable-warning=ExperimentalWarning'
  const current = env.NODE_OPTIONS ?? ''
  if (!current.includes(flag)) {
    env.NODE_OPTIONS = current ? `${current} ${flag}` : flag
  }
  return env  // passed to CopilotClient({ env }) — parent process.env is unchanged
}

Tests

  • Unit: verifies NODE_OPTIONS flag is passed to CopilotClient and existing NODE_OPTIONS are preserved
  • Integration: verifies the env option propagates through the SDK constructor
  • E2E: verifies process.env is not mutated (child-only scope)
  • Agent: verifies 'cli server exited' is classified as retryable

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/htekdev/gh-hookflow/releases/latest
    • Triggering command: /usr/bin/gh gh extension install htekdev/gh-hookflow (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI self-assigned this Apr 23, 2026
Copilot AI review requested due to automatic review settings April 23, 2026 13:05
Copilot AI review requested due to automatic review settings April 23, 2026 13:05
… Node 24 stage failures

Agent-Logs-Url: https://github.com/htekdev/vidpipe/sessions/9b8a0c4b-1b4e-4a79-9d1e-84ffd4698c75

Co-authored-by: htekdev <100806365+htekdev@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 23, 2026 13:09
Copilot AI changed the title [WIP] Fix CLI subprocess stages fail due to SQLite warning Suppress Node.js ExperimentalWarning in Copilot SDK subprocess to fix Node 24 stage failures Apr 23, 2026
Copilot AI requested a review from htekdev April 23, 2026 13:09
Copilot AI review requested due to automatic review settings May 15, 2026 14:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

✅ Test & Coverage Summary

Tier Tests Passed Failed Skipped Time Stmts Branch Funcs Lines
✅ Unit Tests 2119 2119 0 0 20.5s 78.4% ✅ 70.2% ✅ 81.0% ✅ 78.9% ✅
✅ Integration L3 256 256 0 0 8.5s 33.3% ✅ 30.7% ✅ 32.1% ✅ 33.8% ✅
✅ Integration L4-L6 80 80 0 0 1.5s 19.2% ✅ 15.3% ✅ 21.9% ✅ 19.7% ✅
✅ Integration L7 244 244 0 0 2.1s 66.0% ✅ 53.8% ✅ 72.0% ✅ 67.1% ✅
✅ E2E 236 236 0 0 14.6s 10.8% ✅ 7.5% ❌ 10.4% ❌ 11.1% ✅
Total 2935 2935 0 0
📊 Unit Coverage Details (78.9% lines)
Metric Covered / Total Percentage
Statements 6280/8006 78.44%
Branches 3055/4352 70.19%
Functions 1246/1539 80.96%
Lines 5959/7556 78.86%

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

Coverage Report for Unit

Status Category Percentage Covered / Total
🔵 Lines 78.86% 5959 / 7556
🔵 Statements 78.44% 6280 / 8006
🔵 Functions 80.96% 1246 / 1539
🔵 Branches 70.19% 3055 / 4352
File CoverageNo changed files found.
Generated in workflow #408 for commit d5ecdef by the Vitest Coverage Report Action

Copy link
Copy Markdown
Owner

@htekdev htekdev left a comment

Choose a reason for hiding this comment

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

LGTM - File permission fixes (chmod +x) for hook scripts. All CI green.

Copy link
Copy Markdown
Owner

@htekdev htekdev left a comment

Choose a reason for hiding this comment

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

LGTM - File permission fixes (chmod +x) for hook scripts. All CI green.

@htekdev htekdev marked this pull request as ready for review May 15, 2026 14:22
Copy link
Copy Markdown
Owner

@htekdev htekdev left a comment

Choose a reason for hiding this comment

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

LGTM - File permission fixes (chmod +x) on hook scripts. All CI green, trivial change.

@htekdev htekdev enabled auto-merge (squash) May 15, 2026 14:23
Copy link
Copy Markdown
Owner

@htekdev htekdev left a comment

Choose a reason for hiding this comment

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

LGTM — all 13 CI checks pass. Targeted Node 24 ExperimentalWarning fix in Copilot SDK subprocess hooks. Auto-merging.

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.

CLI subprocess stages fail when Node.js SQLite experimental warning appears on stderr

3 participants