Skip to content

Regression: external channel plugin fetch() fails with TypeError: fetch failed in 2026.5.4 #78007

@techdou

Description

@techdou

Bug Report

Environment

  • OpenClaw version: 2026.5.4 (stable channel)
  • OS: macOS 26.4.1 (arm64, Mac mini M4)
  • Node.js: v25.9.0
  • Plugin: @tencent-weixin/openclaw-weixin v2.4.1 (Weixin/WeChat personal account channel)

Description

All fetch() calls inside external channel plugins fail with TypeError: fetch failed when running inside the OpenClaw 2026.5.4 gateway process. The same fetch calls succeed outside the gateway (curl, standalone node, CLI subcommands).

Evidence

1. fetch works outside the gateway:

# curl — works
$ curl -s -X POST "https://ilinkai.weixin.qq.com/ilink/bot/get_bot_qrcode?bot_type=3" \
  -H "Content-Type: application/json" -H "iLink-App-Id: bot" \
  -d '{"local_token_list":[]}'
{"qrcode":"...","qrcode_img_content":"...","ret":0}

# standalone node — works
$ node -e "fetch(\"https://ilinkai.weixin.qq.com/...\").then(r => console.log(\"OK\", r.status))"
fetch OK 200

2. fetch fails inside the gateway process:

# CLI login command (spawns gateway subcommand)
$ openclaw channels login --channel openclaw-weixin
Failed to start login: TypeError: fetch failed

# Gateway channel worker log (repeats every restart cycle)
[channel] notifyStart failed during startup (ignored): TypeError: fetch failed
[channel] waitForWeixinRuntime() failed: Error: Weixin runtime initialization timeout

3. Plugin registers successfully — the issue is specifically with fetch():

[compat] Host OpenClaw 2026.5.4 >= 2026.3.22, OK.
[runtime] setWeixinRuntime called, runtime set successfully

Timeline / Repro

  1. Install OpenClaw 2026.5.4
  2. Install weixin plugin: npx -y @tencent-weixin/openclaw-weixin-cli install
  3. Plugin loads and registers fine (version check passes, runtime set)
  4. Any fetch() call from plugin code inside gateway process → TypeError: fetch failed
  5. Channel worker enters crash loop: fetch fails → runtime init timeout → restart → repeat

Hypothesis

OpenClaw 2026.5.4 appears to replace globalThis.fetch with a custom implementation (for request auditing, SSRF protection, or proxy routing based on the 2026.5.x changelog entries). This custom fetch breaks for external channel plugins that make outbound HTTPS requests to third-party APIs (e.g., https://ilinkai.weixin.qq.com).

The TypeError: fetch failed without any underlying cause info (no ECONNREFUSED, no ENOTFOUND, no AggregateError) suggests the custom fetch is rejecting the request before it reaches the network stack.

Workaround

None found. Manually obtaining the QR code via curl and writing credentials to ~/.openclaw/openclaw-weixin/accounts/ allows the channel to appear as ON / OK in openclaw status, but the channel worker still cannot poll for messages because all fetch calls fail.

Requested Fix

  • Ensure the gateway's custom fetch implementation (if any) transparently passes through external plugin HTTPS requests
  • Or document any new configuration needed for external channel plugins to make outbound network requests

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions