From 34fa9ed4dbf51ef6673bdae557f5eb6d5c7bc430 Mon Sep 17 00:00:00 2001 From: "Ryan H. Tran" Date: Wed, 26 Feb 2025 20:17:03 +0700 Subject: [PATCH] fix: `task_str` validation not required for trajectory replay (#6957) --- openhands/core/main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openhands/core/main.py b/openhands/core/main.py index a5192b9c5f..3c8efe38ab 100644 --- a/openhands/core/main.py +++ b/openhands/core/main.py @@ -247,17 +247,18 @@ if __name__ == '__main__': # Read task from file, CLI args, or stdin task_str = read_task(args, config.cli_multiline_input) + initial_user_action: Action = NullAction() if config.replay_trajectory_path: if task_str: raise ValueError( 'User-specified task is not supported under trajectory replay mode' ) + else: + if not task_str: + raise ValueError('No task provided. Please specify a task through -t, -f.') - if not task_str: - raise ValueError('No task provided. Please specify a task through -t, -f.') - - # Create initial user action - initial_user_action: MessageAction = MessageAction(content=task_str) + # Create actual initial user action + initial_user_action = MessageAction(content=task_str) # Set session name session_name = args.name