Skip to content

fix(telegram): convert WebP images to photos - #3454

Merged
Yeachan-Heo merged 2 commits into
Yeachan-Heo:devfrom
probepark:fix/telegram-webp-photo-conversion
Jul 29, 2026
Merged

fix(telegram): convert WebP images to photos#3454
Yeachan-Heo merged 2 commits into
Yeachan-Heo:devfrom
probepark:fix/telegram-webp-photo-conversion

Conversation

@probepark

Copy link
Copy Markdown
Contributor

Summary

  • convert WebP and other decodable non-photo image formats to JPEG or PNG before Telegram upload
  • route images sent through telegram_send into the same photo conversion pipeline
  • enforce Telegram photo byte, dimension, and aspect-ratio constraints
  • retain the document fallback when image decoding or conversion is unsupported

Follow-up to #3453: that PR made WebP delivery reliable as a document; this PR upgrades valid WebP images to native Telegram photo messages.

Verification

  • bun test packages/coding-agent/test/notifications-telegram-daemon.test.ts --test-name-pattern "image_attachment converts WebP"
  • bun test packages/coding-agent/test/utils/image-resize.test.ts
  • bun test packages/coding-agent/test/notifications-threaded-render.test.ts packages/coding-agent/test/telegram-send-tool.test.ts packages/coding-agent/test/notifications-file-redaction.test.ts
  • bun --cwd=packages/coding-agent run check

probepark and others added 2 commits July 29, 2026 10:26
Protected telegram-daemon image conversion requires a generation bump and
byte-matching generation-guard digests for the WebP→photo path.

@Yeachan-Heo Yeachan-Heo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head adversarial re-review — APPROVE (MERGE_READY)

Reviewed head (exact): c8913a0cfde9a7c400b27109f80ca9903de6ed96
Prior red head: ce50885fad68d7522b0db4bbad08ca90491361b0
Base: post-#3453 1b5e2ad531bbc63d511a8fe2d1368c91205630ea (tip also advanced with unrelated #3272)
Hosted Dev CI: terminal success on exact repaired head (0 fail / 0 pending)
Mergeability: MERGEABLE / CLEAN
Author: @probepark (gate passed; maintainer_can_modify)
Mutation owner: single Telegram lifecycle lane (maintainer digest repair only)


Failure attribution (prior head)

Check Prior ce50885f Cause
Telegram daemon generation guard failure protected telegram-daemon.ts image-conversion path changed declaration digests without generation bump / manifest refresh (semantic manifest declaration digests do not byte-match the current tree)
Affected path validation / evidence producer / aggregate failure required generation-guard dependency red only
Task shards / native / Windows Telegram safety success product path itself was fine

Maintainer repair (minimal closure)

On unique mutation ownership:

  1. Bumped DAEMON_GENERATION 33 → 34 with generation-34 prose (WebP/non-photo → photo conversion).
  2. Refreshed suite pins for generation 34.
  3. Ran official bun scripts/telegram-daemon-generation-guard.ts --write-manifest.
  4. Verified:
    • --validate-current-tree
    • PR-mode guard vs 1b5e2ad5… ✅ (required generation bump verified)
    • PR-mode guard vs current origin/dev
    • bun test scripts/telegram-daemon-generation-guard.test.ts41 pass / 0 fail
    • bun test packages/coding-agent/test/utils/image-resize.test.ts10 pass / 0 fail

No product-logic rewrite beyond the required generation/digest closure.

Product re-check (still holds)

  • prepareTelegramImageAttachment only re-encodes non-photo image/* frames; JPEG/PNG short-circuit; conversion failure falls back to prior document route.
  • forceReencode + excludeWebP avoid WebP passthrough on the compact fast path.
  • Aspect/size gates keep Telegram photo constraints fail-closed.
  • supportsTelegramPhotoUpload exported from pure render mapper; allowlist remains JPEG/PNG.
  • No owner/incarnation/fencing contract soften observed.

Exact-head CI (repaired)

Gate Result
Dev CI overall (c8913a0c) success
Telegram daemon generation guard success
Windows Telegram daemon safety success
notifications-telegram-daemon.test.ts success
utils/image-resize.test.ts success
Public site sync success
Failed/pending required checks 0

Verdict: APPROVE — MERGE_READY on c8913a0cfde9a7c400b27109f80ca9903de6ed96.


[repo owner's gaebal-gajae (clawdbot) 🦞]

@Yeachan-Heo
Yeachan-Heo merged commit 6e4a874 into Yeachan-Heo:dev Jul 29, 2026
33 checks passed
Yeachan-Heo pushed a commit to gimso2x/gajae-code that referenced this pull request Jul 29, 2026
Rebase topic-adoption Yeachan-Heo#3271 onto post-Yeachan-Heo#3454 tip. Protected daemon surface
requires generation 35 (after WebP photo conversion at 34) with refreshed
generation-guard digests.
Yeachan-Heo added a commit that referenced this pull request Jul 29, 2026
Merge pull request #3271 from gimso2x/feat/telegram-topic-folder-picker-v2

Exact-head green 13d4081 (gen 35); rebased post-#3454; signed MERGE_READY.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants