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
..
2026-03-24 16:26:58 +00:00
2026-03-17 01:05:09 -07:00
2026-03-20 19:24:10 +00:00
2026-03-17 01:05:09 -07:00
2026-03-22 19:45:59 +00:00
2026-03-18 09:15:41 +05:30
2026-03-23 17:32:46 +05:30
2026-03-14 03:43:07 -07:00
2026-03-23 12:57:43 +00:00
2026-03-22 21:46:26 -07:00
2026-03-21 10:10:38 +05:30
2026-03-21 10:10:38 +05:30
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-21 10:10:38 +05:30
2026-03-24 08:37:00 +00:00
2026-03-21 10:10:38 +05:30
2026-03-14 02:50:17 -07:00
2026-03-20 19:24:10 +00:00
2026-03-23 04:34:42 -07:00
2026-03-20 19:24:10 +00:00
2026-03-17 20:36:03 -07:00
2026-03-24 10:51:26 -04:00
2026-03-17 20:13:52 -07:00
2026-03-25 11:31:01 +05:30
2026-03-24 15:57:16 +00:00
2026-03-20 19:24:10 +00:00
2026-03-24 15:57:16 +00:00
2026-03-25 11:31:01 +05:30
2026-03-14 02:50:17 -07:00
2026-03-24 21:41:46 +00:00
2026-03-24 21:41:46 +00:00
2026-03-14 02:50:17 -07:00
2026-03-25 11:31:01 +05:30
2026-03-23 12:57:43 +00:00
2026-03-25 11:31:01 +05:30
2026-03-14 13:23:25 -05:00
2026-03-24 10:51:26 -04:00
2026-03-21 15:03:55 -07:00
2026-03-14 02:50:17 -07:00
2026-03-24 21:48:07 +00:00
2026-03-23 04:34:42 -07:00
2026-03-24 15:16:18 +00:00
2026-03-24 10:51:26 -04:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-17 23:09:26 -07:00
2026-03-19 00:01:14 -05:00
2026-03-24 21:41:46 +00:00
2026-03-23 11:09:12 +00:00
2026-03-24 15:57:16 +00:00
2026-03-24 15:57:16 +00:00
2026-03-18 12:46:09 +05:30
2026-03-23 11:09:12 +00:00
2026-03-24 21:41:46 +00:00
2026-03-25 11:18:54 +05:30
2026-03-16 21:16:32 -07:00
2026-03-24 21:41:46 +00:00
2026-03-24 10:51:26 -04:00
2026-03-25 11:03:33 +05:30
2026-03-21 16:20:42 -07:00
2026-03-14 02:50:17 -07:00
2026-03-18 13:35:56 +05:30
2026-03-19 00:01:14 -05:00
2026-03-19 00:01:14 -05:00
2026-03-23 11:46:54 +00:00
2026-03-18 10:12:15 +05:30
2026-03-25 11:18:54 +05:30
2026-03-21 16:20:42 -07:00
2026-03-16 05:54:16 +00:00
2026-03-18 11:30:34 +05:30
2026-03-22 15:58:33 -07:00
2026-03-14 02:50:17 -07:00
2026-03-18 09:15:41 +05:30
2026-03-23 17:32:46 +05:30
2026-03-17 23:09:26 -07:00
2026-03-22 03:50:41 +00:00
2026-03-22 23:37:12 +00:00
2026-03-20 19:24:10 +00:00
2026-03-17 00:41:44 -07:00
2026-03-17 17:27:52 +01:00
2026-03-21 20:18:16 +00:00
2026-03-25 11:03:33 +05:30
2026-03-25 11:03:33 +05:30
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-22 18:54:01 -07:00
2026-03-22 18:54:01 -07:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-24 15:16:18 +00:00
2026-03-22 23:05:42 -07:00
2026-03-14 02:50:17 -07:00
2026-03-21 11:14:48 +05:30
2026-03-15 18:10:49 +05:30
2026-03-22 15:58:33 -07:00
2026-03-14 02:50:17 -07:00
2026-03-14 02:50:17 -07:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-20 19:24:10 +00:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-20 22:42:04 +05:30
2026-03-20 22:42:04 +05:30
2026-03-14 02:50:17 -07:00
2026-03-16 23:11:59 -07:00
2026-03-19 01:08:23 -04:00
2026-03-14 02:50:17 -07:00
2026-03-14 02:50:17 -07:00
2026-03-24 15:16:18 +00:00
2026-03-17 21:56:12 +05:30
2026-03-23 11:09:12 +00:00
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-23 23:37:34 -05:00
2026-03-22 09:35:36 +00:00
2026-03-14 02:50:17 -07:00
2026-03-23 11:09:12 +00:00
2026-03-23 15:01:42 +05:30
2026-03-24 15:16:18 +00:00
2026-03-21 10:10:38 +05:30
2026-03-23 11:09:12 +00:00
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-16 21:16:32 -07:00
2026-03-24 15:57:16 +00:00
2026-03-25 12:00:20 +05:30
2026-03-25 12:00:20 +05:30
2026-03-25 12:00:20 +05:30
2026-03-24 15:16:18 +00:00
2026-03-16 21:16:32 -07:00
2026-03-22 18:09:45 +00:00
2026-03-14 17:27:54 +02:00
2026-03-16 21:16:32 -07:00
2026-03-21 10:10:38 +05:30
2026-03-25 05:21:16 +00:00
2026-03-23 01:56:01 +00:00
2026-03-22 20:30:21 +00:00
2026-03-22 23:04:04 +00:00
2026-03-20 19:24:10 +00:00
2026-03-14 02:50:17 -07:00
2026-03-20 19:24:10 +00:00
2026-03-16 22:58:55 -07:00
2026-03-16 22:58:55 -07:00
2026-03-16 21:16:32 -07:00
2026-03-25 05:21:16 +00:00
2026-03-14 02:50:17 -07:00
2026-03-20 00:30:11 -07:00
2026-03-22 18:09:45 +00:00
2026-03-22 19:01:52 +00:00
2026-03-22 19:01:52 +00:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-14 02:50:17 -07:00
2026-03-16 21:16:32 -07:00
2026-03-24 17:16:25 +00:00
2026-03-22 21:46:26 -07:00