From 33879fef48580038dcc91b5d0d164968befd440c Mon Sep 17 00:00:00 2001 From: bux Date: Thu, 7 May 2026 21:17:47 +0000 Subject: [PATCH] =?UTF-8?q?agency:=20react=20to=20the=20card=20with=20?= =?UTF-8?q?=F0=9F=94=A5=20on=20any=20button=20tap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the keyboard is stripped after a Yes / Skip / Edit tap, the card loses its only visual indicator that the user already weighed in. Across a feed of 30+ cards in a half-hour /agency cycle, "did I already answer this one?" becomes a real question. Drop a 🔥 reaction on the card itself via setMessageReaction. Universal across all kinds (action / dismiss / refine / custom) — the choice itself is recorded in agency.db; the reaction is just a persistent "this card was answered" marker. setMessageReaction replaces the prior set, so tapping a second custom button on a multi-option card just keeps the fire — reactions don't accumulate. Co-Authored-By: Claude Opus 4.7 (1M context) --- agent/telegram_bot.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/agent/telegram_bot.py b/agent/telegram_bot.py index 4d92955..c03a179 100644 --- a/agent/telegram_bot.py +++ b/agent/telegram_bot.py @@ -5914,6 +5914,25 @@ def _handle_agency_callback(self, cb: dict, data: str) -> None: msg_id = msg.get("message_id") + # Universal 🔥 reaction on any agency-button tap so the user + # can tell at a glance which cards have been answered, even + # after the keyboard is stripped. Fires for every kind + # (action / dismiss / refine / custom). setMessageReaction + # replaces prior reactions, so tapping again on a custom + # multi-button card keeps the fire in place rather than + # accumulating. + if msg_id: + try: + self.call( + "setMessageReaction", + chat_id=chat_id, + message_id=msg_id, + reaction=[{"type": "emoji", "emoji": "🔥"}], + is_big=False, + ) + except Exception: + LOG.exception("agency setMessageReaction failed") + # Lookup the suggestion row (for title + prompt) and record the # decision. Best-effort: a missing row (button posted out-of-band, # e.g. the legacy tg-buttons helper) means action/refine fall back