|
43 | 43 | ) |
44 | 44 |
|
45 | 45 |
|
46 | | - |
47 | | - |
48 | 46 | def _capabilities() -> Capabilities: |
49 | 47 | global _CAPS_CACHE |
50 | 48 | if _CAPS_CACHE is None: |
@@ -280,7 +278,9 @@ async def run_cell( |
280 | 278 | return dto_to_result(dto, signal_factory=self._signal_factory) |
281 | 279 |
|
282 | 280 | @staticmethod |
283 | | - def _namespace_updates(builtins: dict[str, Any]) -> tuple[dict[str, Any], list[tuple[int, Any]] | None]: |
| 281 | + def _namespace_updates( |
| 282 | + builtins: dict[str, Any], |
| 283 | + ) -> tuple[dict[str, Any], list[tuple[int, Any]] | None]: |
284 | 284 | """Return picklable per-cell namespace refreshes and an ``Out`` snapshot.""" |
285 | 285 | updates: dict[str, Any] = {} |
286 | 286 | out_events: list[tuple[int, Any]] | None = None |
@@ -404,13 +404,19 @@ def _is_visible_root_attr(self, name: str) -> bool: |
404 | 404 |
|
405 | 405 | def _validate_broker_path(self, path: list[str]) -> None: |
406 | 406 | """Reject worker-supplied paths that cross hidden/private boundaries.""" |
407 | | - if not isinstance(path, list) or not path or not all(isinstance(p, str) and p for p in path): |
| 407 | + if ( |
| 408 | + not isinstance(path, list) |
| 409 | + or not path |
| 410 | + or not all(isinstance(p, str) and p for p in path) |
| 411 | + ): |
408 | 412 | raise AttributeError("invalid sandbox broker path") |
409 | 413 | if not self._is_visible_root_attr(path[0]): |
410 | 414 | raise AttributeError(f"sandbox broker cannot access hidden attribute self.{path[0]}") |
411 | 415 | for part in path[1:]: |
412 | 416 | if part.startswith("_") and part not in _BROKER_PROTOCOL_DUNDERS: |
413 | | - raise AttributeError(f"sandbox broker cannot access private nested attribute {part}") |
| 417 | + raise AttributeError( |
| 418 | + f"sandbox broker cannot access private nested attribute {part}" |
| 419 | + ) |
414 | 420 |
|
415 | 421 | async def _dispatch_tool_call(self, msg: dict[str, Any]) -> dict[str, Any]: |
416 | 422 | """Run a brokered ``self.<path>`` access against the parent's live agent.""" |
|
0 commit comments