fix(plugin): attached photo reference, image count, deduped photo buttons#8
Merged
Conversation
…photo buttons
Three user-visible bugs in /antigravity_image, all fixed plugin-side (no
framework patch):
1. Attached photo was silently ignored ("вот этот товар" produced a made-up
product). A plugin command ctx carries no media, so capture the downloaded
attachment via the internal message:received hook (key is type:action, not
message_received; opts.name is mandatory), stash it per sender, and hand it
to agy via --add-dir plus an explicit use-this-reference-file instruction.
Verified live: shape/colours/label text of the attached product carry over.
2. "3 изображения ..." generated exactly one image. Parse a count prefix after
the aspect prefix: x3/3x (latin or Cyrillic х) or a number with an image
noun (изображения/картинки/фото/варианта/... , images/pictures/...). A bare
leading number that describes the subject stays one image. Sequential
generation, delivered as mediaUrls (separate photos, caption+keyboard on
the first); capped at 4 per command (ANTIGRAVITY_IMAGE_MAX_COUNT).
3. Button labels rendered twice on photos (caption bullet list + real inline
keyboard). Root cause: OpenClaw's media path flattens presentation.blocks
into the caption too. Ship the keyboard as raw channelData.telegram.buttons
(same opaque tgcb1: callback encoding) and drop presentation from photo
replies.
Recreate/Edit now reproduce count and photo reference too; a pruned inbound
reference degrades to text-only with an explicit warning.
Hardening: sender-strict sighting match (group chats can't cross-claim a
photo), stale refs/ staging dirs pruned (crash-safe), command queue capped at
depth 2 (quota protection), docs updated (EN/RU README + plugin-internals).
nicshik
added a commit
that referenced
this pull request
Jul 16, 2026
fix(plugin): attached photo reference, image count, deduped photo buttons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Три бага /antigravity_image (все проверены вживую на opcl)
1. Вложенное фото игнорировалось. "…вот этот товар" + фото давало выдуманный продукт.
PluginCommandContextне несёт media, поэтому вложение ловится внутренним хукомmessage:received(ключtype:action, неmessage_received;opts.nameобязателен — иначе падает вся регистрация плагина), стэшится по отправителю и уходитagyчерез--add-dir+ явная инструкция взять референс-файл. Проверено: форма/цвета/текст этикетки переносятся точно.2. "3 изображения …" давало одну картинку. Парсинг количества после формата:
x3/3x(латинская и кириллическаях) или число с «картиночным» словом. Число, описывающее сюжет ("3 котика идут гулять"), остаётся одной картинкой. Генерация последовательная, доставка черезmediaUrls(отдельные фото, подпись и кнопки на первом), потолок 4 (ANTIGRAVITY_IMAGE_MAX_COUNT).3. Дубль подписей кнопок над кнопками. Медиа-путь OpenClaw «сплющивает»
presentation.blocksещё и в текст подписи (• label). Клавиатура теперь едет сырой черезchannelData.telegram.buttons(тот же opaquetgcb1:),presentationиз фото-ответов убран.«Ещё раз»/«Изменить» воспроизводят и количество, и референс; вычищенный OpenClaw'ом референс — честное предупреждение и генерация по тексту.
Хардненинг
refs/-каталогов (падение gateway посреди генерации);Всё исправлено на стороне плагина, dist OpenClaw не патчится. Развёрнуто на opcl, healthcheck 6/6.