mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
fix: action.run executed twice if action is not awaitable (#1021)
This commit is contained in:
parent
34ecfe3c75
commit
8450b47609
@ -194,10 +194,9 @@ class AgentController:
|
||||
|
||||
if action.executable:
|
||||
try:
|
||||
if inspect.isawaitable(action.run(self)):
|
||||
observation = await cast(Awaitable[Observation], action.run(self))
|
||||
else:
|
||||
observation = action.run(self)
|
||||
observation = action.run(self)
|
||||
if inspect.isawaitable(observation):
|
||||
observation = await cast(Awaitable[Observation], observation)
|
||||
except Exception as e:
|
||||
observation = AgentErrorObservation(str(e))
|
||||
print_with_color(observation, 'ERROR')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user