Skip to content

fix(plugin): attached photo reference, image count, deduped photo buttons#8

Merged
nicshik merged 1 commit into
mainfrom
fix/image-ref-count-buttons
Jul 9, 2026
Merged

fix(plugin): attached photo reference, image count, deduped photo buttons#8
nicshik merged 1 commit into
mainfrom
fix/image-ref-count-buttons

Conversation

@nicshik

@nicshik nicshik commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Три бага /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 (тот же opaque tgcb1:), presentation из фото-ответов убран.

«Ещё раз»/«Изменить» воспроизводят и количество, и референс; вычищенный OpenClaw'ом референс — честное предупреждение и генерация по тексту.

Хардненинг

  • матч референса строго по отправителю (в группе нельзя захватить чужое фото);
  • прюнинг осиротевших refs/-каталогов (падение gateway посреди генерации);
  • кап очереди команд (depth 2) — защита квоты Google;
  • доки: README EN/RU + plugin-internals (ловушки: кнопки на фото, хук message:received, файл-документ не диспетчит команду).

Всё исправлено на стороне плагина, dist OpenClaw не патчится. Развёрнуто на opcl, healthcheck 6/6.

…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 nicshik merged commit 8e5e4ac into main Jul 9, 2026
2 checks passed
nicshik added a commit that referenced this pull request Jul 16, 2026
fix(plugin): attached photo reference, image count, deduped photo buttons
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.

1 participant