Repository: All-Hands-AI/OpenHands
File: openhands/resolver/send_pull_request.py (Python)

Code before:
    parser.add_argument(
        '--git-user-email',
        type=str,
        default='openhands@all-hands.dev',
        help='Git user email for commits',
    )
    my_args = parser.parse_args()

    token = my_args.token or os.getenv('GITHUB_TOKEN') or os.getenv('GITLAB_TOKEN')
    if not token:
        raise ValueError(
            'token is not set, set via --token or GITHUB_TOKEN or GITLAB_TOKEN environment variable.'
        )
    username = my_args.username if my_args.username else os.getenv('GIT_USERNAME')

    platform = call_async_from_sync(
        identify_token,
        GENERAL_TIMEOUT,
        token,
        my_args.base_domain,
    )

    api_key = my_args.llm_api_key or os.environ['LLM_API_KEY']
    model_name = my_args.llm_model or os.environ['LLM_MODEL']
    env_base_url = os.environ.get('LLM_BASE_URL')
    configured_base_url = my_args.llm_base_url
    if configured_base_url not in (None, ''):
        resolved_base_url = configured_base_url
    elif env_base_url not in (None, ''):
        resolved_base_url = env_base_url
    else:
        resolved_base_url = get_effective_llm_base_url(
            model_name,
            configured_base_url,
        )
    llm_config = LLMConfig(
        model=model_name,
        api_key=SecretStr(api_key) if api_key else None,
        base_url=resolved_base_url,
    )

    if not os.path.exists(my_args.output_dir):
        raise ValueError(f'Output directory {my_args.output_dir} does not exist.')

    if not my_args.issue_number.isdigit():
        raise ValueError(f'Issue number {my_args.issue_number} is not a number.')
    issue_number = int(my_args.issue_number)
    output_path = os.path.join(my_args.output_dir, 'output.jsonl')
    resolver_output = load_single_resolver_output(output_path, issue_number)
    if not username:
        raise ValueError('username is required.')

Review comment (suggestion):
```suggestion
    base_url = my_args.llm_base_url or os.environ.get('LLM_BASE_URL')
```

Code after:
    parser.add_argument(
        '--git-user-email',
        type=str,
        default='openhands@all-hands.dev',
        help='Git user email for commits',
    )
    my_args = parser.parse_args()

    token = my_args.token or os.getenv('GITHUB_TOKEN') or os.getenv('GITLAB_TOKEN')
    if not token:
        raise ValueError(
            'token is not set, set via --token or GITHUB_TOKEN or GITLAB_TOKEN environment variable.'
        )
    username = my_args.username if my_args.username else os.getenv('GIT_USERNAME')

    platform = call_async_from_sync(
        identify_token,
        GENERAL_TIMEOUT,
        token,
        my_args.base_domain,
    )

    api_key = my_args.llm_api_key or os.environ['LLM_API_KEY']
    model_name = my_args.llm_model or os.environ['LLM_MODEL']
    base_url = my_args.llm_base_url or os.environ.get('LLM_BASE_URL')
    resolved_base_url = get_effective_llm_base_url(
        model_name,
        base_url,
    )
    llm_config = LLMConfig(
        model=model_name,
        api_key=SecretStr(api_key) if api_key else None,
        base_url=resolved_base_url,
    )

    if not os.path.exists(my_args.output_dir):
        raise ValueError(f'Output directory {my_args.output_dir} does not exist.')

    if not my_args.issue_number.isdigit():
        raise ValueError(f'Issue number {my_args.issue_number} is not a number.')
    issue_number = int(my_args.issue_number)
    output_path = os.path.join(my_args.output_dir, 'output.jsonl')
    resolver_output = load_single_resolver_output(output_path, issue_number)
    if not username:
        raise ValueError('username is required.')
    process_single_issue(
        my_args.output_dir,
        resolver_output,
        token,
        username,
        platform,