Skip to content

Commit

Permalink
Exit with error code
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Jan 14, 2025
1 parent 652b6c0 commit a4785bb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openhands/core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def run_controller(
exit_on_message: bool = False,
fake_user_response_fn: FakeUserResponseFunc | None = None,
headless_mode: bool = True,
) -> State | None:
) -> State:
"""Main coroutine to run the agent controller with task input flexibility.
It's only used when you launch openhands backend directly via cmdline.
Expand Down Expand Up @@ -214,7 +214,7 @@ def auto_continue_response(
session_name = args.name
sid = generate_sid(config, session_name)

asyncio.run(
final_state = asyncio.run(
run_controller(
config=config,
initial_user_action=initial_user_action,
Expand All @@ -224,3 +224,6 @@ def auto_continue_response(
else auto_continue_response,
)
)

if final_state.last_error:
sys.exit(1)

0 comments on commit a4785bb

Please sign in to comment.