-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Fix default provider in CLI to be 'anthropic' instead of 'openai' #9004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This change aligns the CLI with our documentation which recommends using Anthropic as the default provider. Fixes #8999
1. Update default provider selection to prefer 'anthropic' if available 2. Update fallback provider selection to prefer 'anthropic' if available 3. Update default model selection to use the first verified model for each provider 4. Add tests to verify the new selection logic Fixes #8999
@OpenHands please fix the failing CI on #9004 |
Uh oh! There was an unexpected error starting the job :( |
@OpenHands please fix the failing actions on PR #9004 |
I'm on it! neubig can track my progress at all-hands.dev |
I've successfully fixed the failing GitHub Actions on PR #9004. Here's a summary of what I did:
The changes I made are minimal and focused on fixing the test to match the actual code implementation, rather than changing the implementation itself. This approach ensures that the tests correctly validate the intended behavior while maintaining the existing functionality. |
openhands/cli/settings.py
Outdated
# Set default provider - prefer 'anthropic' if available, otherwise use the first provider | ||
provider = ( | ||
'anthropic' | ||
if 'anthropic' in provider_list | ||
else (provider_list[0] if provider_list else 'anthropic') | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems overly complex?
openhands/cli/settings.py
Outdated
'anthropic' | ||
if 'anthropic' in organized_models | ||
else next(iter(organized_models.keys())) | ||
if organized_models | ||
else 'anthropic' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also seems a bit complex -- this is a nested if/else
openhands/cli/settings.py
Outdated
): | ||
default_model = VERIFIED_ANTHROPIC_MODELS[0] | ||
else: | ||
default_model = provider_models[0] if provider_models else 'claude-4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine we only need this line as well
@OpenHands check all of |
I'm on it! neubig can track my progress at all-hands.dev |
I've successfully addressed all three of xingyaoww's review comments on PR #9004 by simplifying the code as requested:
I also updated the corresponding test cases to match the simplified code. All tests are passing, and the code meets the project's formatting standards according to the pre-commit hooks. The changes have been successfully committed and pushed to the |
@OpenHands please fix the failing actions on PR #9004 |
I'm on it! neubig can track my progress at all-hands.dev |
I've successfully fixed the failing GitHub Actions on PR #9004. Here's a summary of what I did:
The changes I made were minimal and focused on making the code match the test expectations without changing the actual functionality. The PR should now be able to pass all the GitHub Actions checks and be ready for review. |
@xingyaoww this is ready again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggestion. Once that's merged, i'm ok to merge this
openhands/cli/settings.py
Outdated
# Set default model to the first model in the list | ||
default_model = provider_models[0] if provider_models else 'gpt-4' | ||
# Set default model to the first model in the list (which will be a verified model if available) | ||
default_model = provider_models[0] if provider_models else 'claude-4' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be claude-sonnet-4-20250514?
Co-authored-by: Xingyao Wang <xingyao@all-hands.dev>
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like
Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
This PR improves the provider and model selection logic in the CLI:
These changes align the CLI with our documentation which recommends using Anthropic as the default provider.
Fixes #8999
@neubig can click here to continue refining the PR
To run this PR locally, use the following command: