openclaw - ✅(Solved) Fix [Bug]: Slack inbound file attachments silently fail in 2026.4.5 (undici 8.x SSRF dispatcher incompatible with Node built-in fetch) [5 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#62218Fetched 2026-04-08 03:07:30
View on GitHub
Comments
1
Participants
2
Timeline
10
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×6closed ×1commented ×1labeled ×1

Slack file attachments are not downloaded in 2026.4.5; agent receives text-only [Slack file: name.png] placeholder instead of image content, confirmed by session transcript and empty media store.

Error Message

MediaFetchError: Failed to fetch media from https://files.slack.com/…: fetch failed | invalid onRequestStart method cause: InvalidArgumentError: invalid onRequestStart method at assertRequestHandler (undici/lib/core/util.js:550:11) code: 'UND_ERR_INVALID_ARG'

Root Cause

Slack file attachments are not downloaded in 2026.4.5; agent receives text-only [Slack file: name.png] placeholder instead of image content, confirmed by session transcript and empty media store.

Fix Action

Fix / Workaround

  1. After patching catch block: MediaFetchError with cause InvalidArgumentError: invalid onRequestStart method (UND_ERR_INVALID_ARG).

Affected: All Slack users sending file/image attachments on 2026.4.5 Severity: Blocks workflow (Slack vision/image workflows completely broken) Frequency: Always - 100% reproduction on every Slack file attachment Consequence: Agent cannot see any images sent via Slack; no error visible to user or in logs without patching source code

Last known good version: 2026.4.2 First known bad version: 2026.4.5 Workaround: npm install -g [email protected] && openclaw gateway restart

PR fix notes

PR #62240: fix(net): strip external undici dispatcher from custom fetchImpl calls

Description (problem / solution / changelog)

Summary

  • Fixes Slack file attachment downloads silently failing on OpenClaw 2026.4.5 with InvalidArgumentError: invalid onRequestStart method
  • Root cause: fetchWithSsrFGuard passes an external undici dispatcher (from the bundled undici package) through init to custom fetchImpl callers. These custom fetchers (e.g. Slack/Telegram media) wrap Node's built-in fetch(), which bundles its own undici 8.x internally. The handler interface changed between undici 7→8, causing the version mismatch error.
  • Fix: strip the dispatcher property from init before forwarding to custom fetchImpl callers. The SSRF DNS-pinning validation has already been performed before the custom fetcher is invoked, so security guarantees are preserved.

Test plan

  • Existing fetch-guard.ssrf.test.ts tests pass (no behavior change for runtime-fetch path)
  • Slack file attachment download works on Node 22+ with undici 8.x
  • Verify SSRF protection still blocks private IPs when custom fetchImpl is used

Fixes #62218

🤖 Generated with Claude Code

Changed files

  • src/infra/net/fetch-guard.ts (modified, +16/-4)

PR #62239: fix(slack): prevent undici dispatcher leak to globalThis.fetch causing media download failure Markdown

Description (problem / solution / changelog)

Summary

  • Problem: Slack file and image attachments fail to download silently. The issue occurs in extensions/slack/src/monitor/media.ts where createSlackMediaFetch is used.
  • Root Cause: The SSRF guard (fetchWithSsrFGuard) creates an undici 8.x dispatcher and passes it in the init object to the custom fetchImpl. Inside createSlackMediaFetch, the init object is destructured using ...rest and passed directly to globalThis.fetch (Node's built-in fetch, which uses undici 7.x). The built-in fetch does not recognize the undici 8.x dispatcher's onRequestStart method, throwing an InvalidArgumentError which is then silently swallowed by a catch { return null; } block in resolveSlackMedia.
  • Fix: Explicitly destructure and exclude the dispatcher property from the init object inside createSlackMediaFetch before passing ...rest to globalThis.fetch. This prevents the incompatible project-level undici dispatcher from leaking into the Node-bundled fetch runtime.
  • What changed:
    • extensions/slack/src/monitor/media.ts: Stripped dispatcher from init in createSlackMediaFetch.
    • extensions/slack/src/monitor/media.test.ts: Added a unit test to verify dispatcher is not forwarded to globalThis.fetch.
  • What did NOT change (scope boundary): The SSRF guard logic itself, other extensions' fetch implementations, and the general Slack media resolution flow remain unchanged.

Reproduction

  1. Configure a Slack bot with the OpenClaw gateway.
  2. Send a message containing an image or file attachment in a monitored Slack channel.
  3. Observe that the bot fails to download the attachment (no placeholder or file is saved), and no error is logged.

Risk / Mitigation

  • Risk: The SSRF guard relies on the dispatcher to enforce network policies. Stripping it might bypass the SSRF protection for Slack media downloads.
  • Mitigation: This is safe because createSlackMediaFetch is only used for fetching from Slack's own CDN (files.slack.com etc.), which are trusted external URLs. The SSRF guard's primary purpose is to prevent access to internal/private networks, which is not a risk when fetching from known Slack domains. The added unit test ensures the dispatcher is correctly stripped without affecting the rest of the request initialization.

Change Type (select all)

  • Bug fix

Scope (select all touched areas)

  • Gateway
  • Slack Extension

Linked Issue/PR

Fixes #62218

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/slack/src/monitor/media.test.ts (modified, +28/-0)
  • extensions/slack/src/monitor/media.ts (modified, +14/-2)

PR #62241: fix(net): strip external undici dispatcher from custom fetchImpl calls

Description (problem / solution / changelog)

Summary

  • Fixes Slack file attachment downloads silently failing on OpenClaw 2026.4.5 with InvalidArgumentError: invalid onRequestStart method
  • Root cause: fetchWithSsrFGuard passes an external undici dispatcher (from the bundled undici package) through init to custom fetchImpl callers. These custom fetchers (e.g. Slack/Telegram media) wrap Node's built-in fetch(), which bundles its own undici 8.x internally. The handler interface changed between undici 7→8, causing the version mismatch error.
  • Fix: strip the dispatcher property from init before forwarding to custom fetchImpl callers. The SSRF DNS-pinning validation has already been performed before the custom fetcher is invoked, so security guarantees are preserved.

Test plan

  • Existing fetch-guard.ssrf.test.ts tests pass (no behavior change for runtime-fetch path)
  • Slack file attachment download works on Node 22+ with undici 8.x
  • Verify SSRF protection still blocks private IPs when custom fetchImpl is used

Fixes #62218

🤖 Generated with Claude Code

Changed files

  • extensions/slack/src/monitor/media.ts (modified, +6/-2)

PR #1: fix(slack): reliably ingest Slack file images instead of filename placeholders

Description (problem / solution / changelog)

Summary

Fixes Slack inbound file/image ingestion regressions end-to-end (including Errol runtime validation):

  • Use files.info hydration when Slack events include file id without usable download URLs.
  • Use the correct media-read token path (userToken fallback) in monitor context, so file reads are not restricted to bot-token-only paths.
  • Harden Slack media fetch init handling to avoid passing incompatible fetch guard hook options into Node fetch, which caused silent download failure + filename-only placeholders.
  • Ensure staged inbound media filenames are unique across turns to avoid cross-turn collisions.
  • Add regression tests for id-only payload hydration and sandbox media staging collisions.

Validation

  • pnpm vitest extensions/slack/src/monitor/media.test.ts --run
  • pnpm vitest extensions/slack/src/monitor/message-handler/prepare.test.ts --run
  • pnpm vitest extensions/slack/src/monitor/message-handler/prepare-thread-context.test.ts --run
  • pnpm vitest src/auto-reply/reply.triggers.trigger-handling.stages-inbound-media-into-sandbox-workspace.test.ts --run
  • Live Errol Docker verification in Slack thread: image content now resolved (not placeholder-only filename).

AI assistance

This PR was AI-assisted (Hedwig/OpenClaw + Codex) and then validated with targeted tests and live runtime verification.

Related Slack file issues (tagging all matches)

Refs #50129 Refs #51050 Refs #62088 Refs #51458 Refs #62623 Refs #62551 Refs #61862 Refs #41657 Refs #45574 Refs #61850 Refs #36507 Refs #13634 Refs #44544 Refs #38457 Refs #47600 Refs #56508 Refs #52962 Refs #18426 Refs #62218 Refs #33368 Refs #15087 Refs #18642 Refs #7536 Refs #24681 Refs #23349 Refs #29304 Refs #7110 Refs #13740 Refs #15190 Refs #3595 Refs #3519 Refs #14258 Refs #6008

Changed files

  • extensions/slack/src/monitor/context.ts (modified, +3/-0)
  • extensions/slack/src/monitor/media.test.ts (modified, +58/-1)
  • extensions/slack/src/monitor/media.ts (modified, +84/-18)
  • extensions/slack/src/monitor/message-handler/prepare-thread-context.test.ts (modified, +109/-0)
  • extensions/slack/src/monitor/message-handler/prepare-thread-context.ts (modified, +30/-11)
  • extensions/slack/src/monitor/message-handler/prepare.ts (modified, +1/-1)
  • extensions/slack/src/monitor/monitor.media.test.ts (modified, +41/-2)
  • extensions/slack/src/monitor/provider.ts (modified, +1/-0)
  • src/auto-reply/reply.triggers.trigger-handling.stages-inbound-media-into-sandbox-workspace.test.ts (modified, +42/-6)
  • src/auto-reply/reply/stage-sandbox-media.ts (modified, +11/-4)

PR #62792: Fix Slack file access in channels and DMs

Description (problem / solution / changelog)

  • Tooling note: AI-assisted development (Hedwig/OpenClaw + Codex), with human validation and final review by @armsteadj1.

Summary

Describe the problem and fix in 2–5 bullets:

If this PR fixes a plugin beta-release blocker, title it fix(<plugin-id>): beta blocker - <summary> and link the matching Beta blocker: <plugin-name> - <summary> issue labeled beta-blocker. Contributors cannot label PRs, so the title is the PR-side signal for maintainers and automation.

  • Problem: Slack inbound image/file messages sometimes reached the model as filename placeholders only ([Slack file: IMG_4935.jpg]) instead of actual media content.
  • Why it matters: Image understanding and downstream workflows fail, causing repeated user retries and broken Slack UX.
  • What changed: Fixes the reproduced Slack filename-placeholder regression in this media ingestion path by hardening Slack media hydration/fetch, using the resolved media-read token path, and preventing cross-turn staged filename collisions.
  • What did NOT change (scope boundary): No UI changes, no outbound Slack behavior changes, and no claim that every historical Slack-file issue is resolved.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #50129
  • Related #51050
  • Related #51458
  • Related #62088
  • This PR fixes a bug or regression

Root Cause (if applicable)

For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write N/A. If the cause is unclear, write Unknown.

  • Root cause: Slack file events can arrive with partial metadata and restricted URL access semantics; combined with brittle media fetch init handling and token-read path selection, the ingestion path sometimes failed and fell back to filename placeholders.
  • Missing detection / guardrail: Tests did not lock in this specific Slack file metadata/token-read + staged-media collision path.
  • Contributing context (if known): Threaded Slack flows with repeated filenames and file payload variation increased failure probability.

Regression Test Plan (if applicable)

For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write N/A.

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file:
    • extensions/slack/src/monitor/media.test.ts
    • extensions/slack/src/monitor/message-handler/prepare.test.ts
    • extensions/slack/src/monitor/message-handler/prepare-thread-context.test.ts
    • src/auto-reply/reply.triggers.trigger-handling.stages-inbound-media-into-sandbox-workspace.test.ts
  • Scenario the test should lock in: Slack file events with partial metadata still produce real media payloads, and repeated inbound basenames across turns do not collide.
  • Why this is the smallest reliable guardrail: It exercises the failing boundary directly without requiring a full external Slack E2E harness.
  • Existing test that already covers this (if any): Existing Slack media/prepare coverage exists; this PR extends edge-path coverage.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

List user-visible changes (including defaults/config). If none, write None.

Slack image/file messages now resolve as actual media content more reliably in the affected ingestion path instead of filename-only placeholders.

Diagram (if applicable)

For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write N/A.

Before:
[Slack file event] -> [media fetch/hydration path fails] -> [placeholder only]

After:
[Slack file event] -> [robust hydration + read-token path + safe fetch init] -> [media staged] -> [model sees image]New permissions/capabilities? (No)Secrets/tokens handling changed? (Yes)New/changed network calls? (No)Command/tool execution surface changed? (No)Data access scope changed? (No)If any Yes, explain risk + mitigation:Risk: token selection for Slack media reads changed in this path.Mitigation: constrained to existing configured Slack token sources and media-read flow only; no new secret source or broader access added.OS: macOS host + Docker runtimeRuntime/container: Errol gateway in Docker (openclaw:local)Model/provider: openai-codex/gpt-5.3-codex (Errol runtime default)Integration/channel (if any): Slack (threaded channel flow)Relevant config (redacted): Slack bot/app tokens configured; Errol isolated config/workspace/port.Send Slack thread message with attached image (same repro case where response only saw filename placeholder).Observe pre-fix behavior (placeholder-only).Apply fix branch, rebuild/restart Errol, resend same image flow.Assistant can access and reason over actual image content.Before: placeholder-only behavior reproduced.After: image content was successfully resolved and identified.Attach at least one:Failing test/log before + passing afterTrace/log snippetsScreenshot/recordingPerf numbers (if relevant)What you personally verified (not just CI), and how:Verified scenarios:Reproduced filename-placeholder failure in live Slack thread.Verified post-fix behavior resolved actual image content in same thread flow.Edge cases checked:Slack file metadata hydration path.Repeated inbound basename staging across turns.What you did not verify:Broad claim across all historical Slack-file issues.Full multi-workspace/perf matrix beyond this runtime path.I replied to or resolved every bot review conversation I addressed in this PR.I left unresolved only the conversations that still need reviewer or maintainer judgment.If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.Backward compatible? (Yes)Config/env changes? (No)Migration needed? (No)If yes, exact upgrade steps:List only real risks for this PR. Add/remove entries as needed. If none, write None.Risk:Slack tenant/app-specific file payload variance may expose additional untested edge cases.Mitigation:Coverage added for the reproduced edge path and constrained changes to Slack media ingestion only.Risk:Token-read path change could behave differently in uncommon token setups.Mitigation:Uses existing resolved read-token path with fallback; no new token source introduced.

## Changed files

- `extensions/slack/src/monitor/context.ts` (modified, +3/-0)
- `extensions/slack/src/monitor/media.test.ts` (modified, +173/-0)
- `extensions/slack/src/monitor/media.ts` (modified, +204/-36)
- `extensions/slack/src/monitor/message-handler/prepare-content.ts` (modified, +3/-0)
- `extensions/slack/src/monitor/message-handler/prepare-thread-context.test.ts` (modified, +109/-0)
- `extensions/slack/src/monitor/message-handler/prepare-thread-context.ts` (modified, +37/-11)
- `extensions/slack/src/monitor/message-handler/prepare.ts` (modified, +2/-0)
- `extensions/slack/src/monitor/monitor.media.test.ts` (modified, +41/-2)
- `extensions/slack/src/monitor/provider.ts` (modified, +1/-0)
- `src/auto-reply/reply.triggers.trigger-handling.stages-inbound-media-into-sandbox-workspace.test.ts` (modified, +66/-6)
- `src/auto-reply/reply/stage-sandbox-media.ts` (modified, +39/-4)
- `src/commands/agent-via-gateway.test.ts` (modified, +25/-26)

Code Example

MediaFetchError: Failed to fetch media from https://files.slack.com/: fetch failed | invalid onRequestStart method
  cause: InvalidArgumentError: invalid onRequestStart method
    at assertRequestHandler (undici/lib/core/util.js:550:11)
    code: 'UND_ERR_INVALID_ARG'

---

1. Session transcript (jsonl) shows only text content block with "[Slack file: Screenshot.png]" — no image_url or base64 content.

2. Media store (ls -lt ~/.openclaw/media/inbound/) shows no new files after Slack attachment — only webchat uploads.

3. Gateway log shows zero file download attempts or errors (silent catch).

4. After patching catch block: MediaFetchError with cause InvalidArgumentError: invalid onRequestStart method (UND_ERR_INVALID_ARG).

5. Manual verification: curl and node fetch() both successfully download the same file with the same bot token and URL.

6. Version comparison:
   npm view openclaw@2026.4.2 dependencies → undici: '^7.24.6' (works)
   npm view openclaw@2026.4.5 dependencies → undici: '^8.0.1' (broken)
   Node 25.9.0 built-in undici: 7.24.4
   Node 24.14.1 built-in undici: 7.24.4
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Slack file attachments are not downloaded in 2026.4.5; agent receives text-only [Slack file: name.png] placeholder instead of image content, confirmed by session transcript and empty media store.

Steps to reproduce

  1. Install OpenClaw 2026.4.5 via npm global
  2. Configure Slack channel with bot token (files:read scope present)
  3. Send an image attachment in a Slack DM to the bot
  4. Observe agent receives [Slack file: name.png] text, no image content

Expected behavior

On 2026.4.2, the same Slack DM image attachment was downloaded, saved to ~/.openclaw/media/inbound/, and passed to the agent as image content. Agent could see and describe the image.

Actual behavior

Agent receives [Slack file: Screenshot.png] as text only. No image data in session transcript (confirmed via jsonl). No new files in ~/.openclaw/media/inbound/ after sending attachment. Zero log output at any level.

After instrumenting the silent catch { return null; } in resolveSlackMedia() (actions-ClxauASC.js), the following error was captured:

MediaFetchError: Failed to fetch media from https://files.slack.com/…: fetch failed | invalid onRequestStart method
  cause: InvalidArgumentError: invalid onRequestStart method
    at assertRequestHandler (undici/lib/core/util.js:550:11)
    code: 'UND_ERR_INVALID_ARG'

OpenClaw version

2026.4.5

Operating system

macOS 26.4 (arm64)

Install method

npm global

Model

anthropic/claude-opus-4-6

Provider / routing chain

openclaw -> anthropic

Additional provider/model setup details

Not model-related. Bug is in the Slack inbound media download pipeline (resolveSlackMedia), before any model call. Slack channel configured with Socket Mode, bot token with files:read scope.

Logs, screenshots, and evidence

1. Session transcript (jsonl) shows only text content block with "[Slack file: Screenshot.png]" — no image_url or base64 content.

2. Media store (ls -lt ~/.openclaw/media/inbound/) shows no new files after Slack attachment — only webchat uploads.

3. Gateway log shows zero file download attempts or errors (silent catch).

4. After patching catch block: MediaFetchError with cause InvalidArgumentError: invalid onRequestStart method (UND_ERR_INVALID_ARG).

5. Manual verification: curl and node fetch() both successfully download the same file with the same bot token and URL.

6. Version comparison:
   npm view [email protected] dependencies → undici: '^7.24.6' (works)
   npm view [email protected] dependencies → undici: '^8.0.1' (broken)
   Node 25.9.0 built-in undici: 7.24.4
   Node 24.14.1 built-in undici: 7.24.4

Impact and severity

Affected: All Slack users sending file/image attachments on 2026.4.5 Severity: Blocks workflow (Slack vision/image workflows completely broken) Frequency: Always - 100% reproduction on every Slack file attachment Consequence: Agent cannot see any images sent via Slack; no error visible to user or in logs without patching source code

Additional information

Last known good version: 2026.4.2 First known bad version: 2026.4.5 Workaround: npm install -g [email protected] && openclaw gateway restart

The silent catch { return null; } in resolveSlackMedia() produces zero log output on failure.

Related: #62181 — also related to the undici ^7→^8 bump in 2026.4.5.

extent analysis

TL;DR

The most likely fix is to downgrade the undici dependency to a version compatible with the previous working version of OpenClaw, such as ^7.24.6, due to an InvalidArgumentError caused by the updated undici version ^8.0.1.

Guidance

  • The error MediaFetchError: Failed to fetch media from https://files.slack.com/…: fetch failed | invalid onRequestStart method indicates an issue with the undici library used for making HTTP requests.
  • The fact that manual verification with curl and node fetch() successfully downloads the file suggests the problem lies in the undici version used by OpenClaw.
  • Downgrading undici to a version known to work, such as ^7.24.6, may resolve the issue.
  • As a temporary workaround, installing OpenClaw version 2026.4.2 via npm install -g [email protected] and restarting the gateway can restore functionality.

Example

No specific code example is provided as the issue seems to be related to a dependency version conflict rather than a code logic error.

Notes

The problem appears to be specific to the update of the undici library from version ^7.24.6 to ^8.0.1 in OpenClaw version 2026.4.5. This update seems to have introduced an incompatibility that prevents the successful download of Slack file attachments.

Recommendation

Apply the workaround by downgrading OpenClaw to version 2026.4.2 until a compatible update of undici or a fix in OpenClaw is available, as this version is known to work correctly with Slack file attachments.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

On 2026.4.2, the same Slack DM image attachment was downloaded, saved to ~/.openclaw/media/inbound/, and passed to the agent as image content. Agent could see and describe the image.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING