Просмотр исходного кода

Limit room activity events to terminal messages

samien 2 месяцев назад
Родитель
Сommit
893ff34b30

+ 5 - 1
hermes-plugins/yaoyao/dashboard/group_store.py

@@ -5289,7 +5289,11 @@ class GroupStore:
                 VALUES (?, ?, 'topic.updated', ?, ?)""",
                 (epoch, room_id, self._canonical_json(topic), event_time),
             )
-        if event_type in {"message.upsert", "run.updated"}:
+        message_activity = (
+            event_type == "message.upsert"
+            and payload.get("status") in {"completed", "failed", "interrupted"}
+        )
+        if event_type == "run.updated" or message_activity:
             activity = self._room_activity_from_connection(connection, room_id)
             connection.execute(
                 """INSERT INTO group_events

+ 0 - 1
hermes-plugins/yaoyao/dashboard/tests/test_group_topics_contract.py

@@ -437,7 +437,6 @@ class GroupTopicsContractTests(unittest.TestCase):
                     "room.activity",
                     "message.upsert",
                     "topic.updated",
-                    "room.activity",
                     "run.updated",
                     "room.activity",
                 ],