Bladeren bron

React with 🚫 when processing is cancelled

ProcessingOutcome.CANCELLED fell through to the failure branch and drew a
second ❌; it now swaps 👀 for 🚫, backed by no_entry_sign/no_entry
shortcodes. Docs updated accordingly.
Paul Klumpp 1 week geleden
bovenliggende
commit
4a4ee2848b
5 gewijzigde bestanden met toevoegingen van 15 en 12 verwijderingen
  1. 5 5
      AGENTS.md
  2. 5 4
      README.md
  3. 2 2
      adapter.py
  4. 2 0
      platform_config.py
  5. 1 1
      plugin.yaml

+ 5 - 5
AGENTS.md

@@ -70,9 +70,9 @@ changes must keep them, or consciously renegotiate the docs.**
 - **Threads stay threads.** An inbound thread reply keeps its thread context;
   a fresh room reply opens a thread under the incoming message unless
   `auto_thread` is disabled or the room is a DM.
-- **Processing reactions.** 👀 while working, then ✅ or ❌ — driven by
-  `on_processing_start`/`on_processing_complete` and the `reactions` setting,
-  never applied to the bot's own events.
+- **Processing reactions.** 👀 while working, then ✅, ❌, or 🚫 (cancelled) —
+  driven by `on_processing_start`/`on_processing_complete` and the `reactions`
+  setting, never applied to the bot's own events.
 - **Room membership is server-side, commands ride over DMs.** `/join` and
   `/leave` in a DM call RoomService/JoinRoom/LeaveRoom, so membership survives
   restarts; the watch list mirrors it on every `_refresh_rooms()`. DMs and the
@@ -198,8 +198,8 @@ a wrong name is a loud `AttributeError` at the first call and a type checker can
 see it before that:
 
 ```python
-upload_id = upload.upload_id            # yes
-upload_id = str(getattr(cast(Any, upload), "id", ""))   # no
+upload_id = upload.upload_id  # yes
+upload_id = str(getattr(cast(Any, upload), "id", ""))  # no
 ```
 
 The second form cost us every single file upload. `AssetUpload` has no `id`

+ 5 - 4
README.md

@@ -15,7 +15,7 @@ Before setup, here's the part most people want to know: how Hermes behaves once
 | **DMs** | Hermes responds to every message. No `@mention` needed. Each DM has its own session. |
 | **Rooms** | Hermes responds to every room message by default. With `CHATTO_REQUIRE_MENTION=true`, channel-kind rooms answer only `@mentions`; group-kind rooms always respond. |
 | **Threads** | If you reply in a thread, Hermes keeps the thread context isolated from the parent room. The bot auto-follows threads it participates in. |
-| **Processing indicators** | Hermes adds a 👀 reaction when it starts processing a message, and replaces it with ✅ on success or ❌ on failure. |
+| **Processing indicators** | Hermes adds a 👀 reaction when it starts processing a message, and replaces it with ✅ on success, ❌ on failure, or 🚫 when processing was cancelled. |
 | **Typing indicators** | Hermes broadcasts persistent typing indicators while it's working, so users know the bot is active. |
 | **Message splitting** | Long responses (>10000 chars) are automatically split into multiple messages. |
 
@@ -34,7 +34,7 @@ Capabilities natively implemented by the Chatto plugin adapter:
 | message editing | yes |
 | message deletion | yes |
 | typing indicators | yes |
-| processing notifications | yes (👀/✅/❌) |
+| processing notifications | yes (👀/✅/❌/🚫) |
 | file attachments | yes (chunked upload) |
 | image / video / audio / documents | yes (native attachments) |
 | DM initiation | yes |
@@ -111,7 +111,7 @@ CHATTO_PASSWORD=your-password
 # Optional: auto-create threads for replies in rooms (default: true)
 # CHATTO_AUTO_THREAD=true
 
-# Optional: 👀/✅/❌ processing reactions (default: true)
+# Optional: 👀/✅/❌/🚫 processing reactions (default: true)
 # CHATTO_REACTIONS=true
 ```
 
@@ -150,7 +150,7 @@ gateway:
 | `CHATTO_REQUIRE_MENTION` | No | `false` | Only respond to `@mentions` in channels. DMs always get a response. |
 | `CHATTO_FREE_RESPONSE_CHANNELS` | No | — | Room IDs that answer without a mention even when `require_mention` is enabled |
 | `CHATTO_AUTO_THREAD` | No | `true` | Auto-create threads for replies in rooms (`true`/`false`) |
-| `CHATTO_REACTIONS` | No | `true` | 👀/✅/❌ processing reactions (`true`/`false`) |
+| `CHATTO_REACTIONS` | No | `true` | 👀/✅/❌/🚫 processing reactions (`true`/`false`) |
 
 \* Either login+password or `CHATTO_TOKEN` is required.
 
@@ -193,6 +193,7 @@ Hermes uses emoji reactions for processing lifecycle notifications:
 - 👀 — added when the agent starts processing your message
 - ✅ — replaces 👀 when processing completes successfully
 - ❌ — replaces 👀 when processing fails
+- 🚫 — replaces 👀 when processing was cancelled
 
 Disable the lifecycle reactions with `CHATTO_REACTIONS=false`.
 

+ 2 - 2
adapter.py

@@ -1712,8 +1712,8 @@ class ChattoAdapter(BasePlatformAdapter):
             await self.add_reaction(chat_id, message_id, "✅")
         elif outcome == ProcessingOutcome.FAILURE:
             await self.add_reaction(chat_id, message_id, "❌")
-        elif outcome == ProcessingOutcome.C:
-            await self.add_reaction(chat_id, message_id, "")
+        elif outcome == ProcessingOutcome.CANCELLED:
+            await self.add_reaction(chat_id, message_id, "🚫")
 
     # ------------------------------------------------------------------ #
     # Asset upload (chunked)

+ 2 - 0
platform_config.py

@@ -90,6 +90,8 @@ class ChattoConstants:
         "❤": "heart",
         "✅": "white_check_mark",
         "❌": "x",
+        "🚫": "no_entry_sign",
+        "⛔": "no_entry",
         "👀": "eyes",
         "🫥": "dotted_line_face",
         "🎉": "tada",

+ 1 - 1
plugin.yaml

@@ -49,6 +49,6 @@ optional_env:
     prompt: "Free-response room IDs (comma-separated)"
     password: false
   - name: CHATTO_REACTIONS
-    description: "Add 👀/✅/❌ reactions to messages during processing (default: true)"
+    description: "Add 👀/✅/❌/🚫 reactions to messages during processing (default: true)"
     prompt: "Enable message reactions? (true/false)"
     password: false