|
Option C Tools
|
Public Member Functions | |
| tuple[int, str, str] | run (self, list[str] cmd, dict[str, str] env, Path cwd, int timeout, int|None memory_limit_bytes) |
Protocol for OS-level sandbox backends. Each backend wraps the subprocess call with platform-specific isolation (network namespace, resource limits, etc.). The backend receives a sanitised environment and returns raw ``(exit_code, stdout, stderr)`` — output capping and error handling live in :class:`SandboxExecutor`.
Definition at line 217 of file sandbox.py.
| tuple[int, str, str] oct.mcp.sandbox.SandboxBackend.run | ( | self, | |
| list[str] | cmd, | ||
| dict[str, str] | env, | ||
| Path | cwd, | ||
| int | timeout, | ||
| int | None | memory_limit_bytes ) |
Run *cmd* and return ``(exit_code, stdout, stderr)``.
Parameters
----------
cmd
Command + arguments list. Must not use ``shell=True``.
env
Sanitised environment dict.
cwd
Working directory (validated project root).
timeout
Maximum wall-clock seconds.
memory_limit_bytes
Virtual memory ceiling in bytes, or ``None`` to skip.
Implementations on POSIX apply this via ``setrlimit``; on
Windows it is silently ignored.
Definition at line 227 of file sandbox.py.