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

perf : optimizations to send event logging performance (#1635)

Co-authored-by: mengziyi.mzy <mengziyi.mzy@alibaba-inc.com>
mzyddd 1 год назад
Родитель
Сommit
e1a1c9a00c
1 измененных файлов с 2 добавлено и 6 удалено
  1. 2 6
      opendevin/server/agent/agent.py

+ 2 - 6
opendevin/server/agent/agent.py

@@ -134,13 +134,9 @@ class AgentUnit:
         Args:
             event: The agent event (Observation or Action).
         """
-        if isinstance(event, NullAction):
-            return
-        if isinstance(event, NullObservation):
-            return
-        if event.source == 'agent':
+        if event.source == 'agent' and not isinstance(event, (NullAction, NullObservation)):
             await self.send(event.to_dict())
-            return
+        return
 
     def close(self):
         if self.controller is not None: