openclaw - ✅(Solved) Fix Telegram MEDIA image replies fail when optional sharp is missing or unresolved in 2026.5.2 [2 pull requests, 2 comments, 3 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#77081Fetched 2026-05-05 05:52:36
View on GitHub
Comments
2
Participants
3
Timeline
8
Reactions
2
Timeline (top)
cross-referenced ×3commented ×2closed ×1mentioned ×1

On OpenClaw 2026.5.2, Telegram assistant MEDIA: image replies in a DM repeatedly fell back to No response generated. Please try again. because the Telegram final-reply path attempted image optimization via optional sharp, but the installed OpenClaw package did not include a resolvable sharp dependency.

After manually installing sharp, the gateway still tried to import /opt/homebrew/lib/node_modules/openclaw/node_modules/sharp/index.js, but [email protected] exposes lib/index.js and has no root index.js. Adding a local compatibility shim made the path resolvable. A malformed test PNG then produced pngload_buffer: IDAT stream error; a valid PNG created by sharp itself delivered successfully.

Error Message

[telegram] final reply failed: Error: Failed to optimize image: Optional dependency sharp is required for image attachment processing | Cannot find package 'sharp' imported from /opt/homebrew/lib/node_modules/openclaw/dist/extensions/media-understanding-core/image-ops.js

Root Cause

Summary

On OpenClaw 2026.5.2, Telegram assistant MEDIA: image replies in a DM repeatedly fell back to No response generated. Please try again. because the Telegram final-reply path attempted image optimization via optional sharp, but the installed OpenClaw package did not include a resolvable sharp dependency.

Fix Action

Fix / Workaround

Workaround used locally:

// /opt/homebrew/lib/node_modules/openclaw/node_modules/sharp/index.js
module.exports = require('./lib/index.js');

PR fix notes

PR #77117: fix(media): tolerate missing image optimizer for in-limit images

Description (problem / solution / changelog)

Summary

  • fixes #77081
  • allow image media loading to fall back to the original image when optional sharp optimization is unavailable and the image is already under the configured size cap
  • preserve the size cap by continuing to fail when optimization is unavailable for images over the cap
  • add regression coverage for both paths

Test

  • npx vitest run --config test/vitest/vitest.media.config.ts src/media/web-media.test.ts

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • scripts/load-channel-config-surface.ts (modified, +9/-0)
  • src/channels/plugins/module-loader.test.ts (modified, +37/-12)
  • src/config/load-channel-config-surface.test.ts (modified, +21/-3)
  • src/media/web-media.test.ts (modified, +47/-0)
  • src/media/web-media.ts (modified, +36/-1)
  • src/plugin-sdk/channel-entry-contract.test.ts (modified, +19/-6)

PR #77460: feat(skills): add post-update-awareness skill [AI]

Description (problem / solution / changelog)

Summary

Adds a bundled post-update-awareness skill so the running agent can read the CHANGELOG entry for a newly-installed OpenClaw version and surface what changed to the user — once, briefly, via the active channel.

The skill:

  • Detects a version change between the current install (openclaw -V) and a small JSON state file the skill maintains
  • Reads the relevant CHANGELOG section (local install copy first, GitHub raw fallback)
  • Distills it into three buckets: 🆕 new for the user, ⚠️ breaking or removed, 🔧 may need attention
  • Probes known-flaky optional native deps (sharp, ffmpeg-static, node-pty) when the changelog mentions them
  • Sends one brief message via the active channel and persists the new version so subsequent heartbeats stay quiet

Why

OpenClaw releases are already well-documented in CHANGELOG.md and per-version GitHub Releases, but the running agent has no built-in mechanism to consume that information after an update. The real-world failure mode: when an update introduces a new optional dependency requirement (e.g. sharp for image attachment optimization), the user discovers it only when an unrelated workflow fails — typically the moment they post an image into a chat and the agent replies with a stack trace instead of useful output.

I hit exactly this pattern today on a 2026.5.2 → 2026.5.3-1 update on a personal-agent install. The CHANGELOG already mentioned sharp graceful-fallback work (#77081 for Telegram), but the running agent had no way to surface "by the way, sharp is missing on your install" until something tried to use it. This skill closes that loop using the existing CHANGELOG as the source of truth — no new release-process work required.

Scope and non-goals

Intentionally narrow:

  • Reads existing CHANGELOG content, surfaces it, probes known-flaky optional deps non-destructively
  • Does not apply updates (openclaw update already handles that), modify configuration, install missing dependencies without explicit user confirmation, or roll back versions

The skill complements existing update flows rather than replacing them.

Files

  • skills/post-update-awareness/SKILL.md — the new skill
  • CHANGELOG.md — single bullet under Unreleased > Changes

No code changes, no plugin internals touched, no CODEOWNERS-protected paths edited.

Verification

This is a documentation-only skill PR (no TypeScript, no test surfaces). I have not run pnpm check:changed or codex review --base origin/main locally because the change is SKILL.md text plus one CHANGELOG bullet. I'm happy to run either if a maintainer wants the proof; just point me at the relevant lane.

What I did verify:

  • Skill frontmatter format matches the existing skills/gh-issues/SKILL.md convention (top-level name, description, user-invocable, then metadata block with the openclaw key)
  • Skill folder layout matches the simple skills/<name>/SKILL.md pattern used by 50+ existing stock skills (e.g. healthcheck, clawhub)
  • CHANGELOG entry placed under the existing ## Unreleased > ### Changes section, sentence-cased and ending with a period, matching the surrounding style

AI-assisted

  • Marked: drafted with Claude Sonnet 4.5
  • Testing degree: lightly tested — skill text was reviewed against existing stock skills for tone/structure; no live OpenClaw integration test yet (the skill describes the workflow rather than executing code, so the integration surface is at runtime when an agent loads and follows it)
  • I understand what the skill instructs the agent to do
  • I will resolve / reply to any bot review conversations after addressing them

Open questions for maintainers

  1. State file location. I suggested ~/.openclaw/state/post-update-awareness.json for the last-known-version cache. If there's an existing per-skill state convention I missed, happy to adjust.
  2. Known-flaky deps list. The skill ships with sharp, ffmpeg-static, node-pty. Anything else worth adding upfront?
  3. Surface channel. The skill says "active channel" — for a heartbeat-triggered run on a multi-channel agent, is there a preferred convention (DM only? primary channel only?) I should encode rather than leaving to the agent's judgment?

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • skills/post-update-awareness/SKILL.md (added, +139/-0)

Code Example

MEDIA:/Users/.../.openclaw/media/tool-telegram-test/lumen-telegram-image-test.png

---

[telegram] final reply failed: Error: Failed to optimize image: Optional dependency sharp is required for image attachment processing | Cannot find package 'sharp' imported from /opt/homebrew/lib/node_modules/openclaw/dist/extensions/media-understanding-core/image-ops.js

---

[telegram] final reply failed: Error: Failed to optimize image: Optional dependency sharp is required for image attachment processing | Cannot find package '/opt/homebrew/lib/node_modules/openclaw/node_modules/sharp/index.js' imported from /opt/homebrew/lib/node_modules/openclaw/dist/extensions/media-understanding-core/image-ops.js

---

// /opt/homebrew/lib/node_modules/openclaw/node_modules/sharp/index.js
module.exports = require('./lib/index.js');
RAW_BUFFERClick to expand / collapse

Summary

On OpenClaw 2026.5.2, Telegram assistant MEDIA: image replies in a DM repeatedly fell back to No response generated. Please try again. because the Telegram final-reply path attempted image optimization via optional sharp, but the installed OpenClaw package did not include a resolvable sharp dependency.

After manually installing sharp, the gateway still tried to import /opt/homebrew/lib/node_modules/openclaw/node_modules/sharp/index.js, but [email protected] exposes lib/index.js and has no root index.js. Adding a local compatibility shim made the path resolvable. A malformed test PNG then produced pngload_buffer: IDAT stream error; a valid PNG created by sharp itself delivered successfully.

Environment

  • OpenClaw: 2026.5.2 (8b2a6e5)
  • OS: macOS 26.4.1 arm64
  • Node: 25.8.1
  • Channel: Telegram DM
  • Gateway: LaunchAgent, local loopback

Repro steps

  1. Configure Telegram bot and send/receive normal text successfully.
  2. Reply from an assistant turn with a managed local media path, e.g.:
    MEDIA:/Users/.../.openclaw/media/tool-telegram-test/lumen-telegram-image-test.png
  3. Observe Telegram receives fallback text: No response generated. Please try again.
  4. Check gateway error log.

Observed log signatures

Before installing sharp:

[telegram] final reply failed: Error: Failed to optimize image: Optional dependency sharp is required for image attachment processing | Cannot find package 'sharp' imported from /opt/homebrew/lib/node_modules/openclaw/dist/extensions/media-understanding-core/image-ops.js

After npm install sharp --omit=dev in the OpenClaw package dir and gateway restart:

[telegram] final reply failed: Error: Failed to optimize image: Optional dependency sharp is required for image attachment processing | Cannot find package '/opt/homebrew/lib/node_modules/openclaw/node_modules/sharp/index.js' imported from /opt/homebrew/lib/node_modules/openclaw/dist/extensions/media-understanding-core/image-ops.js

Workaround used locally:

// /opt/homebrew/lib/node_modules/openclaw/node_modules/sharp/index.js
module.exports = require('./lib/index.js');

After that, a valid PNG generated with sharp delivered correctly to Telegram.

Expected

Telegram media delivery should either:

  • include/resolve the optional image optimization dependency correctly, or
  • skip optimization/fallback to document/photo upload when sharp is unavailable, without dropping the reply to No response generated.

If sharp is optional, missing sharp should not break basic Telegram local image delivery.

Notes

This may be related to the 5.2 plugin/dependency externalization and optional dependency handling. The root sharp/index.js import expectation is also incompatible with the installed package layout for [email protected].

extent analysis

TL;DR

Manually installing sharp and adding a local compatibility shim can resolve the Telegram media delivery issue.

Guidance

  • Verify that sharp is installed in the correct directory and version ([email protected]) to ensure compatibility with OpenClaw.
  • Check the gateway error log for specific error messages to determine if the issue is related to sharp installation or configuration.
  • Consider adding a compatibility shim, as shown in the workaround, to resolve the index.js import issue with sharp.
  • Test with a valid PNG image generated by sharp to ensure successful delivery to Telegram.

Example

// Local compatibility shim
module.exports = require('./lib/index.js');

This shim can be added to /opt/homebrew/lib/node_modules/openclaw/node_modules/sharp/index.js to resolve the import issue.

Notes

The issue may be related to the externalization of plugins and dependencies in OpenClaw 2026.5.2, and the optional dependency handling for sharp. The workaround provided may not be a permanent solution and may need to be revisited in future updates.

Recommendation

Apply the workaround by manually installing sharp and adding a local compatibility shim, as this has been shown to resolve the issue in the short term.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix Telegram MEDIA image replies fail when optional sharp is missing or unresolved in 2026.5.2 [2 pull requests, 2 comments, 3 participants]