#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")/../.."

mkdir -p logs

TIMESTAMP="$(date +%Y%m%d_%H%M%S)"
LOG_FILE="${LOG_FILE:-logs/run_gpt54_${TIMESTAMP}.log}"

echo "Logging to ${LOG_FILE}"

python scripts/python/run_multienv_gpt54.py \
  --provider_name "${PROVIDER_NAME:-aws}" \
  --headless \
  --observation_type screenshot \
  --model "${MODEL:-gpt-5.4}" \
  --result_dir "${RESULT_DIR:-./results_gpt54}" \
  --test_all_meta_path "${TEST_META_PATH:-evaluation_examples/test_nogdrive.json}" \
  --max_steps "${MAX_STEPS:-50}" \
  --num_envs "${NUM_ENVS:-10}" \
  --client_password "${CLIENT_PASSWORD:-${OSWORLD_CLIENT_PASSWORD:-osworld-public-evaluation}}" \
  --region "${REGION:-${AWS_REGION:-us-east-1}}" \
  --sleep_after_execution "${SLEEP_AFTER_EXECUTION:-3}" \
  --log_level "${LOG_LEVEL:-DEBUG}" \
  2>&1 | tee "${LOG_FILE}"
