OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Don't start conversation runtime without valid API key

Open raymyers opened this issue 11 months ago • 0 comments

End-user friendly description of the problem this fixes or functionality that this introduces

  • [ ] Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Give a summary of what the PR does, explaining any non-trivial design decisions

Currently if a session started with a bad API-Key we will only display an error after the runner has started. On a local docker run that could be quite some time. This change checks the settings before the conversation starts, so the user sees quickly that the settings need to be changed.

Logic: This could use some confirmation from someone familiar with various environments to know that this is correct: We should never start a conversation when settings_store.load() returns nothing?

Validation: This only checks that the API key is non-empty, but IMO it would be reasonable to go further and run litellm's check_valid_key - however it runs an inference (10 token limit).

Logging: This is logging as Warning on the server-side. I could also see it being Error.


Link of any specific issues this addresses

ALL-956

raymyers avatar Jan 09 '25 22:01 raymyers