You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Slack download-file fails silently on Node.js v25 — globalThis.fetch does not support dispatcher option #63393
message(action="download-file") for Slack files always returns "File could not be downloaded (not found, too large, or inaccessible)." even when the file exists and the bot token has files:read scope.
Root Cause
createSlackMediaFetch in extensions/slack/src/actions.ts calls globalThis.fetch() and passes through the dispatcher option from the SSRF guard's fetchWithSsrFGuard. In Node.js v25, globalThis.fetch does not support the dispatcher option (only undici.fetch does), causing a TypeError: fetch failed.
The error is silently swallowed by the catch {} in resolveSlackMedia, making the download return null with no logging.
Always returns error, even though files.info API and direct curl with the bot token both work fine
// This fails in Node.js v25:globalThis.fetch(url,{dispatcher: newundici.Agent(),redirect: 'manual'})// TypeError: fetch failed// This works:undici.fetch(url,{dispatcher: newundici.Agent(),redirect: 'manual'})
Fix
Strip dispatcher from the options before passing to globalThis.fetch in createSlackMediaFetch:
The SSRF DNS validation still runs upstream in fetchWithSsrFGuard — the dispatcher was only needed for DNS pinning which already completed before the custom fetch is called.
Environment
OpenClaw: 2026.4.5
Node.js: v25.6.1
Platform: macOS arm64
Additional Note
The catch {} in resolveSlackMedia should ideally log the error rather than silently swallowing it, to make debugging easier.
Current main and released tag v2026.4.23 already route dispatcher-backed Slack media downloads through the runtime Undici fetch path instead of ambient globalThis.fetch, which covers the Node.js v25 failure described in #63393.
What I checked:
Slack media download path avoids ambient fetch when a dispatcher is present:createSlackMediaFetch() checks for dispatcher in the guarded request init and switches to fetchWithRuntimeDispatcher instead of globalThis.fetch, then performs the Slack file request with redirect: "manual". (extensions/slack/src/monitor/media.ts:88, 86f8c826e20a)
Shared guarded fetch already falls back to runtime Undici for dispatcher-backed requests:fetchWithSsrFGuard() computes shouldUseRuntimeFetch when a dispatcher is attached and the caller is not using an explicit mocked/stub fetch, then calls fetchWithRuntimeDispatcher(...) rather than the ambient global fetch. (src/infra/net/fetch-guard.ts:393, 86f8c826e20a)
Regression test covers the exact Slack dispatcher scenario:media.test.ts asserts that dispatcher-backed Slack media requests do not hit globalThis.fetch, do call fetchWithRuntimeDispatcher, and still carry both redirect: "manual" and the Slack Authorization header. (extensions/slack/src/monitor/media.test.ts:601, 86f8c826e20a)
The fix is already shipped in the latest release: The same createSlackMediaFetch() runtime-dispatcher logic is present in release tag v2026.4.23, so this is not only fixed on unreleased main but also in the latest published release. (extensions/slack/src/monitor/media.ts:90, a9797214338b)
Related discussion already pointed at the same root cause: The issue timeline cross-references PR fix(slack): strip dispatcher option before passing to globalThis.fetch #63401, which proposed handling the same dispatcher/globalThis.fetch mismatch. Current main already covers that outcome via the runtime-fetch routing above.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Activity
steipete commentedon Apr 25, 2026
Closing this as implemented after Codex review.
Current
mainand released tagv2026.4.23already route dispatcher-backed Slack media downloads through the runtime Undici fetch path instead of ambientglobalThis.fetch, which covers the Node.js v25 failure described in #63393.What I checked:
createSlackMediaFetch()checks fordispatcherin the guarded request init and switches tofetchWithRuntimeDispatcherinstead ofglobalThis.fetch, then performs the Slack file request withredirect: "manual". (extensions/slack/src/monitor/media.ts:88, 86f8c826e20a)fetchWithSsrFGuard()computesshouldUseRuntimeFetchwhen a dispatcher is attached and the caller is not using an explicit mocked/stub fetch, then callsfetchWithRuntimeDispatcher(...)rather than the ambient global fetch. (src/infra/net/fetch-guard.ts:393, 86f8c826e20a)media.test.tsasserts that dispatcher-backed Slack media requests do not hitglobalThis.fetch, do callfetchWithRuntimeDispatcher, and still carry bothredirect: "manual"and the SlackAuthorizationheader. (extensions/slack/src/monitor/media.test.ts:601, 86f8c826e20a)createSlackMediaFetch()runtime-dispatcher logic is present in release tagv2026.4.23, so this is not only fixed on unreleasedmainbut also in the latest published release. (extensions/slack/src/monitor/media.ts:90, a9797214338b)dispatcher/globalThis.fetchmismatch. Currentmainalready covers that outcome via the runtime-fetch routing above.So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review notes: reviewed against 86f8c826e20a; fix evidence: release v2026.4.23, commit a9797214338b.