diff --git a/src/langbot/pkg/box/service.py b/src/langbot/pkg/box/service.py index 50eb29cab..f5f2104ee 100644 --- a/src/langbot/pkg/box/service.py +++ b/src/langbot/pkg/box/service.py @@ -485,15 +485,11 @@ class BoxService: """Reject tenant-owned policy fields and apply the Cloud hard policy.""" payload = dict(spec_payload) - trusted_mounts = self._normalize_trusted_read_only_mounts( - trusted_read_only_mounts or [] - ) + trusted_mounts = self._normalize_trusted_read_only_mounts(trusted_read_only_mounts or []) if not self._cloud_managed: if trusted_mounts: if payload.get('extra_mounts'): - raise BoxValidationError( - 'extra_mounts and trusted_read_only_mounts cannot both be supplied' - ) + raise BoxValidationError('extra_mounts and trusted_read_only_mounts cannot both be supplied') payload['extra_mounts'] = trusted_mounts return payload policy = self._admission_policy @@ -568,12 +564,8 @@ class BoxService: if not os.path.isdir(host_path): raise BoxAdmissionError('Core-composed read-only mount source is unavailable') if not any(_is_path_under(host_path, root) for root in self.allowed_mount_roots): - raise BoxAdmissionError( - 'Core-composed read-only mount source is outside allowed_mount_roots' - ) - normalized.append( - mount.model_copy(update={'host_path': host_path}).model_dump(mode='json') - ) + raise BoxAdmissionError('Core-composed read-only mount source is outside allowed_mount_roots') + normalized.append(mount.model_copy(update={'host_path': host_path}).model_dump(mode='json')) return normalized def _reject_cloud_managed_process(self) -> None: diff --git a/src/langbot/pkg/box/workspace.py b/src/langbot/pkg/box/workspace.py index 2e1357f62..95f66ef93 100644 --- a/src/langbot/pkg/box/workspace.py +++ b/src/langbot/pkg/box/workspace.py @@ -18,6 +18,7 @@ import os from typing import Any from ..utils.python_workspace import list_python_manifest_files + _VENV_DIRS = frozenset({'.venv', 'venv', 'env', '.env'}) _VENV_BIN_DIRS = frozenset({'bin', 'Scripts'}) @@ -94,8 +95,6 @@ def classify_python_workspace(host_path: str | None) -> str | None: return None - - class BoxWorkspaceSession: """High-level handle for one reusable workspace-backed Box session. diff --git a/src/langbot/pkg/provider/tools/loaders/native.py b/src/langbot/pkg/provider/tools/loaders/native.py index ca8defa6f..e3ada52af 100644 --- a/src/langbot/pkg/provider/tools/loaders/native.py +++ b/src/langbot/pkg/provider/tools/loaders/native.py @@ -373,9 +373,7 @@ class NativeToolLoader(loader.ToolLoader): box_service = self.ap.box_service if selected_skill is not None: if not self._can_interpret_skill_host_paths(): - raise ValueError( - 'Secure Core host file operations are unavailable on this platform.' - ) + raise ValueError('Secure Core host file operations are unavailable on this platform.') host_root = selected_skill.get('package_root') workspace_anchor = None else: diff --git a/src/langbot/pkg/utils/python_workspace.py b/src/langbot/pkg/utils/python_workspace.py index b21f7a694..20a23ffa2 100644 --- a/src/langbot/pkg/utils/python_workspace.py +++ b/src/langbot/pkg/utils/python_workspace.py @@ -27,11 +27,7 @@ def list_python_manifest_files(host_path: str | None) -> list[str]: normalized_root = normalize_host_path(host_path) if not normalized_root: return [] - return [ - filename - for filename in PYTHON_MANIFEST_FILES - if os.path.isfile(os.path.join(normalized_root, filename)) - ] + return [filename for filename in PYTHON_MANIFEST_FILES if os.path.isfile(os.path.join(normalized_root, filename))] def should_prepare_python_env(host_path: str | None) -> bool: