From 35426a04d82956e8282f557c4ef75d022804a9f4 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Fri, 23 May 2025 15:11:53 -0400 Subject: [PATCH] fix warning for workspace_base (#8667) --- openhands/core/config/utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openhands/core/config/utils.py b/openhands/core/config/utils.py index b86784b3d0..49d317f6c0 100644 --- a/openhands/core/config/utils.py +++ b/openhands/core/config/utils.py @@ -305,6 +305,11 @@ def get_or_create_jwt_secret(file_store: FileStore) -> str: def finalize_config(cfg: AppConfig) -> None: """More tweaks to the config after it's been loaded.""" # Handle the sandbox.volumes parameter + if cfg.workspace_base is not None or cfg.workspace_mount_path is not None: + logger.openhands_logger.warning( + 'DEPRECATED: The WORKSPACE_BASE and WORKSPACE_MOUNT_PATH environment variables are deprecated. ' + "Please use RUNTIME_MOUNT instead, e.g. 'RUNTIME_MOUNT=/my/host/dir:/workspace:rw'" + ) if cfg.sandbox.volumes is not None: # Split by commas to handle multiple mounts mounts = cfg.sandbox.volumes.split(',') @@ -348,11 +353,6 @@ def finalize_config(cfg: AppConfig) -> None: # Handle the deprecated workspace_* parameters elif cfg.workspace_base is not None or cfg.workspace_mount_path is not None: - logger.openhands_logger.warning( - 'DEPRECATED: The WORKSPACE_BASE and WORKSPACE_MOUNT_PATH environment variables are deprecated. ' - "Please use RUNTIME_MOUNT instead, e.g. 'RUNTIME_MOUNT=/my/host/dir:/workspace:rw'" - ) - if cfg.workspace_base is not None: cfg.workspace_base = os.path.abspath(cfg.workspace_base) if cfg.workspace_mount_path is None: