From 4a3f5dd9b48ac54e0374e67b07bff7bc8e84359c Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Wed, 20 Aug 2025 15:51:19 -0400 Subject: [PATCH] fix(runtime): correctly set session_api_key for local runtime (#10506) --- openhands/runtime/impl/local/local_runtime.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openhands/runtime/impl/local/local_runtime.py b/openhands/runtime/impl/local/local_runtime.py index 5b5e354e98..208e89cf33 100644 --- a/openhands/runtime/impl/local/local_runtime.py +++ b/openhands/runtime/impl/local/local_runtime.py @@ -201,8 +201,14 @@ class LocalRuntime(ActionExecutionClient): # If there is an API key in the environment we use this in requests to the runtime session_api_key = os.getenv('SESSION_API_KEY') + self._session_api_key: str | None = None if session_api_key: self.session.headers['X-Session-API-Key'] = session_api_key + self._session_api_key = session_api_key + + @property + def session_api_key(self) -> str | None: + return self._session_api_key @property def action_execution_server_url(self) -> str: