mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(telegram): use valid reaction emojis for processing completion (#7175)
Telegram's Bot API only allows a specific set of emoji for bot reactions (the ReactionEmoji enum). ✅ (U+2705) and ❌ (U+274C) are not in that set, causing on_processing_complete reactions to silently fail with REACTION_INVALID (caught at debug log level). Replace with 👍 (U+1F44D) / 👎 (U+1F44E) which are always available in Telegram's allowed reaction list. The 👀 (eyes) reaction used by on_processing_start was already valid. Based on the fix by @ppdng in PR #6685. Fixes #6068
This commit is contained in:
parent
6d2fa03837
commit
0e315a6f02
2 changed files with 5 additions and 5 deletions
|
|
@ -2802,5 +2802,5 @@ class TelegramAdapter(BasePlatformAdapter):
|
|||
await self._set_reaction(
|
||||
chat_id,
|
||||
message_id,
|
||||
"\u2705" if outcome == ProcessingOutcome.SUCCESS else "\u274c",
|
||||
"\U0001f44d" if outcome == ProcessingOutcome.SUCCESS else "\U0001f44e",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ async def test_on_processing_start_handles_missing_ids(monkeypatch):
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_on_processing_complete_success(monkeypatch):
|
||||
"""Successful processing should set check mark reaction."""
|
||||
"""Successful processing should set thumbs-up reaction."""
|
||||
monkeypatch.setenv("TELEGRAM_REACTIONS", "true")
|
||||
adapter = _make_adapter()
|
||||
event = _make_event()
|
||||
|
|
@ -185,13 +185,13 @@ async def test_on_processing_complete_success(monkeypatch):
|
|||
adapter._bot.set_message_reaction.assert_awaited_once_with(
|
||||
chat_id=123,
|
||||
message_id=456,
|
||||
reaction="\u2705",
|
||||
reaction="\U0001f44d",
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_on_processing_complete_failure(monkeypatch):
|
||||
"""Failed processing should set cross mark reaction."""
|
||||
"""Failed processing should set thumbs-down reaction."""
|
||||
monkeypatch.setenv("TELEGRAM_REACTIONS", "true")
|
||||
adapter = _make_adapter()
|
||||
event = _make_event()
|
||||
|
|
@ -201,7 +201,7 @@ async def test_on_processing_complete_failure(monkeypatch):
|
|||
adapter._bot.set_message_reaction.assert_awaited_once_with(
|
||||
chat_id=123,
|
||||
message_id=456,
|
||||
reaction="\u274c",
|
||||
reaction="\U0001f44e",
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue