Skip to main content

Module compat

Module compat 

Source
Expand description

Choosing between the two code-execution layers.

Code execution has two layers. Both are supported; neither is deprecated.

LayerBackend traitRequest and resultBuilt on it
adk-sandboxSandboxBackendExecRequest, ExecResultRustExecutor, CodeTool, adk_sandbox::SandboxTool
adk-codeCodeExecutorExecutionRequest, ExecutionResult, with a SandboxPolicyRustSandboxExecutor, ContainerCommandExecutor, the embedded JavaScript and Monty executors, and adk-tool’s PythonCodeTool and JavaScriptCodeTool

§Key API Differences

§SandboxBackend and CodeExecutor

CodeExecutor has lifecycle methods (start, stop, restart, is_running), reports BackendCapabilities, and takes an ExecutionRequest whose SandboxPolicy it validates against them. SandboxBackend is minimal: execute(ExecRequest) -> Result<ExecResult, SandboxError>, with isolation coming from the backend, such as a ProcessBackend under an OS enforcer.

§ExecutionRequest and ExecRequest

ExecutionRequest has payload (an enum with Source and GuestModule), sandbox (the policy), identity, and argv. ExecRequest is flat: language, code, stdin, timeout, memory_limit_mb, env.

§RustSandboxExecutor and RustExecutor

RustSandboxExecutor compiles and runs Rust as host processes. RustExecutor delegates execution to a SandboxBackend, separating compilation from isolation; construct it with RustExecutor::new(backend, config).

§Removed

adk-tool’s RustCodeTool was removed; CodeTool replaces it.