Skip to content

fix(deps): bump undici to 8.11.2 so native fetch decodes responses again - #2514

Merged
zfy0701 merged 1 commit into
mainfrom
claude/undici-8-11-2
Sep 25, 2026
Merged

zfy0701 merged 1 commit into
mainfrom
claude/undici-8-11-2

Conversation

@zfy0701

@zfy0701 zfy0701 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

undici 8.11.0, which #2504 brought in, breaks Node's built-in fetch in any process that loads it. When HTTP/2 is negotiated, the legacy dispatcher bridge Node's fetch goes through drops the response headers, which causes two failures:

  • Content-Encoding goes missing, so gzip bodies reach JSON.parse without being decoded.
  • Redirects stop being followed.

Upstream tracks this as nodejs/undici#5865 and nodejs/undici#5858. It is fixed in 8.11.1, which reverts nodejs/undici#5811 in nodejs/undici#5860.

The daemon and the relay both import undici at startup (Slack's proxy-aware fetch), so every native fetch they make was affected. On the test environment, every formal code review since the daemons upgraded failed to publish: the daemon's GitHub review client threw Unexpected token '\x1f', "\x1f\x8b\b..." is not valid JSON on GitHub's gzip responses. Those runs are recorded as ambiguous_write or github_rejected, with a red review check. In some of them GitHub had in fact accepted the review.

Changes

  • packages/daemon and packages/relay: undici ^8.11.0 becomes ^8.11.2. The lockfile moves them, and @slack/bolt / @slack/socket-mode, which peer on undici, to 8.11.2.
  • undici@8.11.0 stays in the lockfile only for @apidevtools/json-schema-ref-parser under the root dev dependency promptfoo. The eval tool uses it; no shipped package loads it.

Tests

  • Reproduced before the change: in Node 24.16, import "undici" at 8.11.0 alone is enough. Afterwards a native fetch of https://api.github.com/repos/…/pulls/…/reviews returns content-encoding: null and a body starting with \x1f\x8b\b. With 8.10.2 the same request returns content-encoding: gzip and JSON.
  • Verified after the change, from packages/daemon and from packages/relay with the resolved 8.11.2:
    • that native fetch returns content-encoding: gzip and decoded JSON;
    • a HEAD to a GitHub archive URL reports redirected: true and status 200.
  • No regression test: the failure needs HTTP/2 through the bridge, which a local HTTP/1.1 fixture does not reach.
  • pnpm --filter @agentconnect.md/daemon --filter @agentconnect.md/relay typecheck: clean.
  • Daemon suites that load the Slack connection code: connection.test.ts, slack-streaming.test.ts, slack-upload-file.test.ts and daemon-permission-autoallow.test.ts, run with --maxWorkers=2. Vitest ran 33 files: 890 tests passed.
  • Relay Slack suites: http-ingest, http-ingress and ingress-plugin, run with --maxWorkers=2: 3 files, 66 tests passed.

🤖 Generated with Claude Code . Opus 5.5

undici 8.11.0 (#2504) broke Node's built-in fetch in any process that loads
it: over HTTP/2, the legacy dispatcher bridge dropped response headers, so
Content-Encoding went missing and gzip bodies reached JSON.parse undecoded,
and redirects stopped being followed (nodejs/undici#5865, #5858). The daemon
and relay import undici at startup, so every native fetch they make was
affected; the daemon's formal code reviews failed to publish with
"Unexpected token '\x1f' ... is not valid JSON". 8.11.1 reverts the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zfy0701
zfy0701 enabled auto-merge (squash) September 25, 2026 22:09
@zfy0701
zfy0701 disabled auto-merge September 25, 2026 22:11
@zfy0701
zfy0701 merged commit 1f9bc08 into main Sep 25, 2026
1 of 3 checks passed
@zfy0701
zfy0701 deleted the claude/undici-8-11-2 branch September 25, 2026 22:16
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.

1 participant