Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Update msg_stack.py (#1820)

yangpryili52e21c20e383
diff --git a/opendevin/server/session/msg_stack.py b/opendevin/server/session/msg_stack.py
index 36fc7da2a9..6e0862af44 100644
--- a/opendevin/server/session/msg_stack.py
+++ b/opendevin/server/session/msg_stack.py
@@ -99,7 +99,11 @@ class MessageStack:
new_data = {}
for sid, msgs in data.items():
if sid != del_sid:
- new_data[sid] = [msg.to_dict() for msg in msgs]
+ new_data[sid] = msgs
+ # Move the file pointer to the beginning of the file to overwrite the original contents
+ file.seek(0)
+ # clean previous content
+ file.truncate()
json.dump(new_data, file)
except FileNotFoundError:
pass