Fix typing (#7083)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Rohit Malhotra
2025-03-03 15:41:11 -05:00
committed by GitHub
parent 4e4f4d64f8
commit 5ffb1ef704
11 changed files with 31 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
from typing import Callable, Optional
from typing import Callable
from openhands.core.config import AppConfig
from openhands.events.action import (
@@ -27,7 +27,7 @@ class E2BRuntime(Runtime):
sid: str = 'default',
plugins: list[PluginRequirement] | None = None,
sandbox: E2BSandbox | None = None,
status_callback: Optional[Callable] = None,
status_callback: Callable | None = None,
):
super().__init__(
config,

View File

@@ -7,7 +7,7 @@ import shutil
import subprocess
import tempfile
import threading
from typing import Callable, Optional
from typing import Callable
import requests
import tenacity
@@ -155,7 +155,7 @@ class LocalRuntime(ActionExecutionClient):
self.api_url = f'{self.config.sandbox.local_runtime_url}:{self._host_port}'
self.status_callback = status_callback
self.server_process: Optional[subprocess.Popen[str]] = None
self.server_process: subprocess.Popen[str] | None = None
self.action_semaphore = threading.Semaphore(1) # Ensure one action at a time
# Update env vars

View File

@@ -1,5 +1,5 @@
import os
from typing import Callable, Optional
from typing import Callable
from urllib.parse import urlparse
import requests
@@ -42,7 +42,7 @@ class RemoteRuntime(ActionExecutionClient):
sid: str = 'default',
plugins: list[PluginRequirement] | None = None,
env_vars: dict[str, str] | None = None,
status_callback: Optional[Callable] = None,
status_callback: Callable | None = None,
attach_to_existing: bool = False,
headless_mode: bool = True,
github_user_id: str | None = None,