PR-437-Fixed a bug where turns were getting fetched randomly

This commit is contained in:
Sarthak Deshpande 2024-11-13 18:37:23 +05:30
parent e6e49e1bc6
commit 70e30891ec

View file

@ -80,5 +80,5 @@ class AgentPersistence:
except Exception as e:
print(f"Error parsing turn: {e}")
continue
turns.sort(key=lambda x: (x.completed_at or datetime.min))
return turns