fix(remote_runtime): define runtime_id first to fix attrbute error (#6393)

This commit is contained in:
Xingyao Wang 2025-01-21 13:13:43 -05:00 committed by GitHub
parent 8bd7613724
commit ff3880c76d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,6 +31,9 @@ class RemoteRuntime(ActionExecutionClient):
"""This runtime will connect to a remote oh-runtime-client."""
port: int = 60000 # default port for the remote runtime client
runtime_id: str | None = None
runtime_url: str | None = None
_runtime_initialized: bool = False
def __init__(
self,
@ -71,10 +74,7 @@ class RemoteRuntime(ActionExecutionClient):
self.config.sandbox.api_key,
self.session,
)
self.runtime_id: str | None = None
self.runtime_url: str | None = None
self.available_hosts: dict[str, int] = {}
self._runtime_initialized: bool = False
def log(self, level: str, message: str) -> None:
message = f'[runtime session_id={self.sid} runtime_id={self.runtime_id or "unknown"}] {message}'