Răsfoiți Sursa

Revert "Show relevant error in UI (#2516)" (#2657)

This reverts commit d0bdae232f0925ba4340ef10c172f2e3383d3efd.
Engel Nyst 1 an în urmă
părinte
comite
58b06cced7
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 3 2
      opendevin/controller/agent_controller.py

+ 3 - 2
opendevin/controller/agent_controller.py

@@ -120,9 +120,9 @@ class AgentController:
         - the string message should be user-friendly, it will be shown in the UI
         - the string message should be user-friendly, it will be shown in the UI
         - an ErrorObservation can be sent to the LLM by the agent, with the exception message, so it can self-correct next time
         - an ErrorObservation can be sent to the LLM by the agent, with the exception message, so it can self-correct next time
         """
         """
-        if exception:
-            message += f': {exception}'
         self.state.error = message
         self.state.error = message
+        if exception:
+            self.state.error += f': {str(exception)}'
         await self.event_stream.add_event(ErrorObservation(message), EventSource.AGENT)
         await self.event_stream.add_event(ErrorObservation(message), EventSource.AGENT)
 
 
     async def add_history(self, action: Action, observation: Observation):
     async def add_history(self, action: Action, observation: Observation):
@@ -140,6 +140,7 @@ class AgentController:
                 logger.info('AgentController task was cancelled')
                 logger.info('AgentController task was cancelled')
                 break
                 break
             except Exception as e:
             except Exception as e:
+                traceback.print_exc()
                 logger.error(f'Error while running the agent: {e}')
                 logger.error(f'Error while running the agent: {e}')
                 logger.error(traceback.format_exc())
                 logger.error(traceback.format_exc())
                 await self.report_error(
                 await self.report_error(