WorkspaceSandboxRunner

org.llm4s.agent.harness.workspace.WorkspaceSandboxRunner
See theWorkspaceSandboxRunner companion object
@Experimental

Runs commands in a containerised workspace, for a SandboxBackend (design ยง4.33). It only runs: the backend wraps every run in C4's Unverifiable guard, so a completed command replays its stored ExecResult and one that may have run is refused, never run again. A command locks files/workspace/<id> (WorkspaceLocks), so it conflicts with every file mutation in its workspace.

The runner runs a command as a program and its arguments, never through a shell, and refuses what the sandbox's command policy forbids; that refusal is a tool error. Each stream is kept to maxOutputBytes characters by the runner while it reads, and cut again by the backend. A command the runner's timeout killed is an outcome, exit code -1, recorded like any other.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def locks(workdir: VPath): Set[LockKey]

The locks a command run in workdir holds (F2: workspace/<id>).

The locks a command run in workdir holds (F2: workspace/<id>).

Attributes

def run(command: String, workdir: VPath, timeout: FiniteDuration, maxOutputBytes: Int, ctx: FileContext): Result[ExecResult]

Runs command in workdir, for at most timeout, capturing at most maxOutputBytes of each of stdout and stderr (bytes of the stream as a JSON string, as ExecResult is recorded) and discarding the rest, with truncated set: the bound holds while the output is read, not after it is all in memory (rule 12). The backend cuts anything over it again.

Runs command in workdir, for at most timeout, capturing at most maxOutputBytes of each of stdout and stderr (bytes of the stream as a JSON string, as ExecResult is recorded) and discarding the rest, with truncated set: the bound holds while the output is read, not after it is all in memory (rule 12). The backend cuts anything over it again.

Attributes

Concrete fields

val id: String