OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Refactor]: ShortTermHistory is confusing - refactoring could be useful

Open neubig opened this issue 1 year ago • 1 comments

Summary

I was trying to better understand how the event stream works, and looked at ShortTermHistory, and the class is a bit confusing I think: https://github.com/All-Hands-AI/OpenHands/blob/0a3d46a90b4a390180d33381c94cc98c88e36f48/openhands/memory/history.py#L21

  1. This class inherits from list[Event], but I don't think that this list is ever used? This inheritance should probably just be removed.
  2. The relationship between ShortTermHistory and EventStream is not very clear. I'm not sure why we need two classes, and can't just use the EventStream.

I feel that this could prorbably be refactored to make the class a bit more clear and intuitive. Just starting an issue here to track this for now.

neubig avatar Aug 20 '24 09:08 neubig

For reference: grafik

tobitege avatar Aug 20 '24 09:08 tobitege

Closing as duplicate of https://github.com/All-Hands-AI/OpenHands/issues/3731. Please feel free to reopen if you disagree.

enyst avatar Sep 06 '24 18:09 enyst