openclaw/extensions/telegram
hnshah c7f021f70f
fix: preflight invalid telegram photos (#52545) (thanks @hnshah)
* fix(telegram): validate photo dimensions before sendPhoto

Prevents PHOTO_INVALID_DIMENSIONS errors by checking image dimensions
against Telegram Bot API requirements before calling sendPhoto.

If dimensions exceed limits (width + height > 10,000px), automatically
falls back to sending as document instead of crashing with 400 error.

Tested in production (openclaw 2026.3.13) where this error occurred:
  [telegram] tool reply failed: GrammyError: Call to 'sendPhoto' failed!
  (400: Bad Request: PHOTO_INVALID_DIMENSIONS)

Uses existing sharp dependency to read image metadata. Gracefully
degrades if sharp fails (lets Telegram handle validation, backward
compatible behavior).

Closes: #XXXXX (will reference OpenClaw issue if one exists)

* fix(telegram): validate photo aspect ratio

* refactor: use shared telegram image metadata

* fix: fail closed on telegram image metadata

* fix: preflight invalid telegram photos (#52545) (thanks @hnshah)

---------

Co-authored-by: Bob Shah <bobshah@Macs-Mac-Studio.local>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-25 12:00:20 +05:30
..
src fix: preflight invalid telegram photos (#52545) (thanks @hnshah) 2026-03-25 12:00:20 +05:30
allow-from.ts perf: split telegram audit runtime seams 2026-03-22 00:53:12 +00:00
api.ts refactor: route extension seams through public apis 2026-03-19 03:20:10 +00:00
index.ts refactor: clean extension api boundaries 2026-03-17 09:38:21 -07:00
openclaw.plugin.json
package.json build: bump version to 2026.3.22 2026-03-22 11:58:33 -07:00
runtime-api.ts fix: harden plugin docker e2e 2026-03-22 23:42:34 -07:00
setup-entry.ts refactor: clean extension api boundaries 2026-03-17 09:38:21 -07:00