Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix: `task_str` validation not required for trajectory replay (#6957)

Ryan H. Tran34fa9ed4dbf5
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