Skip to content

Commit

Permalink
Merge branch 'main' into fix/llm-mypy-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
enyst authored Feb 19, 2025
2 parents 5b8db98 + b95840d commit 5b1c8bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openhands/core/config/llm_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,9 @@ def model_post_init(self, __context: Any):
os.environ['OR_SITE_URL'] = self.openrouter_site_url
if self.openrouter_app_name:
os.environ['OR_APP_NAME'] = self.openrouter_app_name

# Assign an API version for Azure models
# While it doesn't seem required, the format supported by the API without version seems old and will likely break.
# Azure issue: https://github.com/All-Hands-AI/OpenHands/issues/6777
if self.model.startswith('azure') and self.api_version is None:
self.api_version = '2024-08-01-preview'
6 changes: 6 additions & 0 deletions openhands/runtime/impl/remote/remote_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ def _check_existing_runtime(self) -> bool:
return False
self.log('debug', f'Error while looking for remote runtime: {e}')
raise
except requests.exceptions.JSONDecodeError as e:
self.log(
'error',
f'Invalid JSON response from runtime API: {e}. URL: {self.config.sandbox.remote_runtime_api_url}/sessions/{self.sid}. Response: {response}',
)
raise

if status == 'running':
return True
Expand Down

0 comments on commit 5b1c8bc

Please sign in to comment.