Repository navigation
Conversation
Node 26's bundled undici negotiates HTTP/2 via ALPN, so every HTTPS fetch the daemon made ran over a native HTTP/2 session. On 2026-11-10 and 2026-11-13 the daemon spun inside Http2Session::SendPendingData until macOS jetsam killed it (about 30 minutes without jobs each time). src/cli.ts now installs a global dispatcher from the undici package with allowH2: false before any command runs (the way Node documents configuring fetch), matching Node 22 behaviour. undici 7.30.2 (engines >=20.18.1, no dependencies) is the fourth runtime dependency; AGENTS.md and CONTRIBUTING.md say so. A dispatcher Node made for NODE_USE_ENV_PROXY is kept. The new test starts a local TLS server offering h2 and http/1.1 with a throwaway self-signed certificate, checks it negotiates h2 when offered, and that the built-in fetch gets HTTP/1.1 after the hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Every skillhook process started through the CLI (the
servedaemon included) now makes Node's built-infetchuse HTTP/1.1, as it did on Node 22:src/http1.ts:useHttp1ForFetch()installssetGlobalDispatcher(new Agent({ allowH2: false }))from theundicipackage, which is how Node documents configuring the built-infetch. If Node already installed its own proxy-aware dispatcher forNODE_USE_ENV_PROXY, the function leaves it in place.src/cli.tscalls it beforemain(), so all commands do it before any request. The library entry (src/index.ts) is unchanged and does not touch its host's dispatcher.undici@^7.30.2is a new runtime dependency (lockfile: 7.30.2). Itsengines.nodeis>=20.18.1, which our>=22satisfies, and it has no dependencies. undici 8.x needs>=22.19.0, so I did not use it. It sets both global dispatcher symbols (undici.globalDispatcher.1and.2), so Node 22's bundled undici 6 and Node 26's bundled undici 8 both read it.undicias the fourth runtime dependency. Please confirm you are OK with this.## Unreleasedentry. No version bump.Why (RA-020)
The main skillhook daemon ran away twice, on 2026-11-10 and 2026-11-13, inside Node's native HTTP/2 write path (
Http2Session::SendPendingData→nghttp2_session_mem_send). It grew to about 23M resident pages and macOS jetsam killed it, which stopped all agent work for about 30 minutes each time. The operator machine runs Node 26.13.0, whose bundled undici (8.12.2) negotiatesh2via ALPN in the built-infetch. Node 22 (undici 6.x) uses HTTP/1.1. Neither skillhook nor its dependencies importnode:http2, so the HTTP/2 sessions come from the built-infetch. Node creates the bundled global dispatcher lazily on the firstfetch, so the only way to configure it before the first request is a dispatcher from theundicipackage.How it was tested
New
src/http1.test.ts. It creates a throwaway self-signed certificate at test time withopensslin a temp dir, deleted afterwards. Nothing is committed, and the test is skipped ifopensslis missing. It then starts a localhttp2.createSecureServer({ allowHTTP1: true })on 127.0.0.1 that responds withreq.httpVersion, and checks three things:h2, http/1.1getsh2from the server.fetchgets2.0when its dispatcher allows h2.useHttp1ForFetch(), the built-infetchgets1.1.The CA is passed only through the test's dispatcher
connect: { ca }.NODE_TLS_REJECT_UNAUTHORIZEDis not used. All traffic stays local.Locally on Node 26.13.0:
pnpm run typecheck,pnpm test(64 files, 536 tests),pnpm run build,pnpm run schema --checkandpnpm run release --checkall pass.node dist/cli.js --versionworks.Locally on Node 22.23.4:
src/http1.test.tspasses (3/3) anddist/cli.js --versionworks.CI covers Node 22, 24 and 26.
How to revert
Revert this squash commit. That removes the hook, the test and the dependency, and restores the docs. Nothing on disk or in config changes. If only the runtime behaviour has to go, deleting the
useHttp1ForFetch()call insrc/cli.tsbrings back the bundled default (HTTP/2 on Node 26).After merge
The fix only takes effect on the operator machine once a release containing it is published and the daemon restarts onto it. This PR does not release or restart anything.
🤖 Generated with Claude Code