Skip to content

Commit

Permalink
only pop if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyaoww committed Feb 11, 2025
1 parent 7d56e1d commit f1985bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openhands/agenthub/codeact_agent/function_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@ def response_to_actions(response: ModelResponse) -> list[Action]:
view_range=other_kwargs.get('view_range', None),
)
else:
other_kwargs.pop(
'view_range'
) # Remove view_range from other_kwargs since it is not needed for FileEditAction
if 'view_range' in other_kwargs:
# Remove view_range from other_kwargs since it is not needed for FileEditAction
other_kwargs.pop('view_range')
action = FileEditAction(
path=path,
command=command,
Expand Down

0 comments on commit f1985bb

Please sign in to comment.