Skip to content

🙌 OpenHands: AI-Driven Development

Refactor: Simplify message formatting (#2670)

மனோஜ்குமார் பழனிச்சாமிaf9385322bc5
diff --git a/evaluation/swe_bench/scripts/setup/process_output_json_file.py b/evaluation/swe_bench/scripts/setup/process_output_json_file.py
index 6f903e7f7e..133d573160 100644
--- a/evaluation/swe_bench/scripts/setup/process_output_json_file.py
+++ b/evaluation/swe_bench/scripts/setup/process_output_json_file.py
@@ -21,7 +21,7 @@ def process_jsonl(input_file, model_name, output_file):
) # Write the list of JSON objects to a file
print(f'Output JSON list created at {output_file}')
except Exception as e:
- print(f'Error: {str(e)}')
+ print(f'Error: {e}')
# Usage: python script.py input.jsonl model_name output.json
diff --git a/opendevin/controller/agent_controller.py b/opendevin/controller/agent_controller.py
index 2dda8a4d48..c17e762e1f 100644
--- a/opendevin/controller/agent_controller.py
+++ b/opendevin/controller/agent_controller.py
@@ -122,7 +122,7 @@ class AgentController:
"""
self.state.error = message
if exception:
- self.state.error += f': {str(exception)}'
+ self.state.error += f': {exception}'
await self.event_stream.add_event(ErrorObservation(message), EventSource.AGENT)
async def add_history(self, action: Action, observation: Observation):