mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-11-27 23:58:47 +00:00
* fix: sandbox Python execution and disable benchmark service exposure * fix: preserve optional sandbox policy for AutoBash * fix: sandbox AutoBash with a read-only workspace by default * fix: preserve sandboxed Python timeout diagnostics * Simplify Python timeout handling and sandbox workspace defaults * fix: require patched core for home and allow sandboxed Apple Git * fix: preserve Python execution workspace directory * fix: cap Python execution timeouts and allow Xcode Git runtime * Fix macOS sandbox Git resolution and add Xcode CI coverage * Make Seatbelt runtime grant test independent of host Xcode symlinks
23 lines
1 KiB
Python
23 lines
1 KiB
Python
"""Resolve executor sandbox policies."""
|
|
|
|
from ...utils.file_sandbox import create_file_sandbox_backend
|
|
from ...utils.file_sandbox.file_sandbox_backend import FileSandboxBackend
|
|
from ..base_step import BaseStep
|
|
|
|
|
|
def file_sandbox_for_step(step: BaseStep) -> FileSandboxBackend:
|
|
"""Default to a read-only workspace; callers cannot supply path grants."""
|
|
assert step.context is not None
|
|
for name in ("read_only_paths", "writable_paths"):
|
|
if name in step.context:
|
|
raise ValueError(f"{name} must be configured on the Step, not supplied by the caller")
|
|
workspace = step.workspace_path.resolve()
|
|
read_only_paths = step.kwargs.get("read_only_paths", [])
|
|
writable_paths = step.kwargs.get("writable_paths", [])
|
|
memory_limit_mib = step.context.get("memory_limit_mib", step.kwargs.get("memory_limit_mib"))
|
|
return create_file_sandbox_backend(
|
|
cwd=workspace,
|
|
read_only_paths=read_only_paths,
|
|
writable_paths=writable_paths,
|
|
memory_limit_mib=memory_limit_mib,
|
|
)
|