Added flag to disable the V1 endpoints inside nested V0 runtimes (#11391)

This commit is contained in:
Tim O'Farrell
2025-10-15 15:33:52 -06:00
committed by GitHub
parent e9413aaded
commit f4fd8ea907
8 changed files with 15 additions and 21 deletions

View File

@@ -89,8 +89,8 @@ class OpenHandsConfig(BaseModel):
)
# Deprecated parameters - will be removed in a future version
workspace_mount_path: str | None = Field(default=None, deprecated=True)
workspace_mount_rewrite: str | None = Field(default=None, deprecated=True)
workspace_mount_path: str | None = Field(default=None)
workspace_mount_rewrite: str | None = Field(default=None)
# End of deprecated parameters
cache_dir: str = Field(default='/tmp/cache')

View File

@@ -376,11 +376,6 @@ def get_or_create_jwt_secret(file_store: FileStore) -> str:
def finalize_config(cfg: OpenHandsConfig) -> 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 SANDBOX_VOLUMES instead, e.g. 'SANDBOX_VOLUMES=/my/host/dir:/workspace:rw'"
)
if cfg.sandbox.volumes is not None:
# Split by commas to handle multiple mounts
mounts = cfg.sandbox.volumes.split(',')

View File

@@ -90,6 +90,7 @@ app.include_router(settings_router)
app.include_router(secrets_router)
if server_config.app_mode == AppMode.OSS:
app.include_router(git_api_router)
app.include_router(v1_router.router)
if server_config.enable_v1:
app.include_router(v1_router.router)
app.include_router(trajectory_router)
add_health_endpoints(app)

View File

@@ -30,6 +30,7 @@ class ServerConfig(ServerConfigInterface):
user_auth_class: str = (
'openhands.server.user_auth.default_user_auth.DefaultUserAuth'
)
enable_v1: bool = os.getenv('ENABLE_V1') != '0'
def verify_config(self):
if self.config_cls:

View File

@@ -10,7 +10,6 @@ from pydantic import (
field_validator,
model_validator,
)
from pydantic.json import pydantic_encoder
from openhands.core.config.llm_config import LLMConfig
from openhands.core.config.mcp_config import MCPConfig
@@ -72,7 +71,7 @@ class Settings(BaseModel):
if context and context.get('expose_secrets', False):
return secret_value
return pydantic_encoder(api_key)
return str(api_key)
@model_validator(mode='before')
@classmethod