-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Fix litellm_proxy model info JSON parsing error handling #10009
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
86ad4d6
to
1c10032
Compare
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 |
Co-authored-by: openhands <openhands@all-hands.dev>
browsergym-core = "0.13.3" # integrate browsergym-core as the browsing interface | ||
html2text = "*" | ||
|
||
deprecated = "*" |
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.
Interesting that you fixed this bug. We have deprecated
dependency but we never explicitly declared it. I was debugging why released 0.49.0 pypi version suddenly stopped working (due to missing "deprecated" package), and found out you just fixed it.
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 guess it might be because we recently cleaned up some dependencies, maybe they were taking it in before. 🤷♂️
Co-authored-by: openhands <openhands@all-hands.dev>
End-user friendly description of the problem this fixes or functionality this introduces.
Fixed an issue where OpenHands could crash when the litellm_proxy service doesn't return valid JSON or expected data structure for model information. This improves reliability when using models through the OpenHands provider.
Summarize what the PR does, explaining any non-trivial design decisions.
This PR adds proper error handling around the JSON parsing of the litellm_proxy response in the
init_model_info
method. Previously, if the litellm_proxy service returned an invalid JSON response or didn't include the expected data structure, it would cause an unhandled exception.The changes:
response.json()
callerror
toinfo
for better visibility without alarming usersall_model_info
to an empty list when parsing failsThis ensures that even if the litellm_proxy service doesn't have information for the current model, the application will continue to function properly.
Link of any specific issues this addresses:
https://openhands-ai.slack.com/archives/C078L0FUGUX/p1753935514200279
To run this PR locally, use the following command: