Skip to content

fix: keep fetch on HTTP/1.1 so Node 26 does not exit the wizard mid-run - #1203

Merged
gewenyu99 merged 1 commit into
mainfrom
fix/disable-h2-fetch
Sep 3, 2026
Merged

fix: keep fetch on HTTP/1.1 so Node 26 does not exit the wizard mid-run#1203
gewenyu99 merged 1 commit into
mainfrom
fix/disable-h2-fetch

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

Summary

  • On Node 26, fetch uses HTTP/2. The MCP SDK aborts its GET event stream when fetchInstructions calls client.close() before the response headers arrive. node:http2 then creates an orphan ClientHttp2Stream for the server's late HEADERS. Four seconds later undici's idle-session reaper destroys the socket with an InformationalError, the orphan re-emits it with no listener, and posthog-node's exception autocapture exits the wizard. Closes wizard exits mid-run with "InformationalError: socket idle timeout" #1198.
  • Fix: force HTTP/1.1 on the global dispatcher in bin.ts. This is the same call pi's CLI makes in its http-dispatcher. undici 8.5.0 becomes a direct dependency; it is already in the tree through pi.
  • Reproduced on Node 26.8.1: the wizard on main exits 1 about 6.5s after detection, on Node 22 the same run stays up. The orphan-stream behavior reproduces with raw node:http2 on Node 22, 24, and 26; only Node 26 turns HTTP/2 on. The TODO block in bin.ts lists what must change upstream before this line can go.
  • Checks: 2601 unit tests pass, Prettier and ESLint clean. With the fix, Node 22, 24, and 26 all negotiate http/1.1 to mcp.posthog.com.

Upstream status

Repo This crash Related
modelcontextprotocol/typescript-sdk none #2526, Node 26 HTTP/2 SSE hangs, same workaround, open since 2026-07-21, no replies
nodejs/undici none #5546 merged in July fixed a different h2 uncaughtException
nodejs/node none none

Alternative on the table: #1199 adds a process-level uncaughtException handler that ignores this one error. This PR removes the HTTP/2 session instead, so there is nothing to ignore. Node 26 in the CI matrix is a separate PR.

🤖 Generated with Claude Code

Node 26 bundles undici 8, which turns HTTP/2 on for fetch. The MCP SDK
aborts its GET event stream on close() before the response headers arrive,
node:http2 creates an orphan ClientHttp2Stream for the server's late HEADERS,
and undici's idle-session reaper destroys the socket 4s later with an
InformationalError that the orphan re-emits with no listener. posthog-node's
exception autocapture exits the process on it.

Force HTTP/1.1 on the global dispatcher, the same call pi's CLI makes.

Closes #1198

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@gewenyu99
gewenyu99 requested a review from a team as a code owner September 3, 2026 17:07
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/groq
  • /wizard-ci ai-observability/manual-capture
Show more apps
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a Context Mill branch:

  • /wizard-ci all context-mill:my-branch

Add context-mill:<branch> to any command above to pin the Context Mill branch. It defaults to main.

Results will be posted here when complete.

@sarahxsanders sarahxsanders left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lololol but yes

@gewenyu99
gewenyu99 merged commit b75540b into main Sep 3, 2026
20 checks passed
@gewenyu99
gewenyu99 deleted the fix/disable-h2-fetch branch September 3, 2026 17:39
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.

wizard exits mid-run with "InformationalError: socket idle timeout"

2 participants