Skip to content

Commit

Permalink
Compatibility for renamed attribute (#4582)
Browse files Browse the repository at this point in the history
Co-authored-by: tofarr <[email protected]>
  • Loading branch information
enyst and tofarr authored Oct 28, 2024
1 parent affb212 commit 421b4c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openhands/events/serialization/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ def action_from_dict(action: dict) -> Action:
# Remove timestamp from args if present
timestamp = args.pop('timestamp', None)

# compatibility for older event streams
# is_confirmed has been renamed to confirmation_state
is_confirmed = args.pop('is_confirmed', None)
if is_confirmed is not None:
args['confirmation_state'] = is_confirmed

try:
decoded_action = action_class(**args)
if 'timeout' in action:
Expand Down

0 comments on commit 421b4c1

Please sign in to comment.