Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions bin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node
import { satisfies } from 'semver';
import { Agent, setGlobalDispatcher } from 'undici';
import { ErrorCodes } from './src/lib/errors/codes.js';
import { emitWizardError } from './src/lib/errors/emit.js';

Expand All @@ -9,6 +10,19 @@ import { emitWizardError } from './src/lib/errors/emit.js';
// TypeError on Node < 22.10).
const NODE_VERSION_RANGE = '>=22.22.0';

/*
* TODO(#1198): remove when fetch over HTTP/2 is safe on Node 26. Remove when all
* of these are true:
* - nodejs/node no longer creates an orphan ClientHttp2Stream when a client
* session gets HEADERS for a stream id it already reset. Repro: abort a fetch
* before its response headers, then idle 4s on Node 26. Fixed when the
* process survives.
* - modelcontextprotocol/typescript-sdk#2526 is closed.
* - pi-coding-agent's CLI drops `allowH2: false` from its http-dispatcher.
* Same workaround as pi's CLI and typescript-sdk#2526: HTTP/1.1 only.
*/
setGlobalDispatcher(new Agent({ allowH2: false }));

// Have to run this above the other imports because they are importing clack that
// has the problematic imports.
if (!satisfies(process.version, NODE_VERSION_RANGE)) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"recast": "^0.23.3",
"semver": "^7.5.3",
"typebox": "1.1.38",
"undici": "8.5.0",
"uuid": "^11.1.0",
"xcode": "3.0.1",
"xml-js": "^1.6.11",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading