Skip to content
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

Fix issue #6940: [Bug]: Incorrect Provider Name on Advanced Setting Toggle #6941

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

openhands-agent
Copy link
Contributor

@openhands-agent openhands-agent commented Feb 25, 2025

This pull request fixes #6940.

The issue has been successfully resolved based on the following concrete changes and their effects:

  1. The core bug was fixed by modifying the handleChangeProvider function to properly map display names to internal provider keys. When "Mistral AI" is selected, it now correctly maps to "mistral" internally through the new lookup logic:
const providerKey = Object.entries(MAP_PROVIDER).find(
  ([_, displayName]) => displayName === provider
)?.[0] || provider;
  1. The changes ensure that the internal state uses the correct provider key ("mistral") while maintaining the display name ("Mistral AI") in the UI, preventing the settings page from incorrectly switching to advanced mode.

  2. The fix was verified with a new test case that specifically checks the Mistral AI provider selection workflow, confirming:

  • Provider selection works correctly
  • Model dropdown becomes enabled
  • Correct Mistral models are available
  1. The implementation addresses both reported issues:
  • Prevents unwanted switching to advanced mode by using correct internal provider keys
  • Fixes the provider name changing to incorrect values by properly maintaining the mapping between display names and internal keys

The changes directly target and resolve the reported behavior problems through proper provider name handling and state management.

Automatic fix generated by OpenHands 🙌


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:38f1b56-nikolaik   --name openhands-app-38f1b56   docker.all-hands.dev/all-hands-ai/openhands:38f1b56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrect Provider Name on Advanced Setting Toggle
1 participant